1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

#! support on Unix systems

This commit is contained in:
Delyan Angelov 2019-07-25 13:27:59 +03:00 committed by Alexander Medvednikov
parent 082098ab67
commit 61fea2d82a

View File

@ -414,6 +414,12 @@ fn (s mut Scanner) scan() ScanRes {
s.pos++ s.pos++
} }
s.line_nr++ s.line_nr++
if nextc == `!` {
// treat shebang line (#!) as a comment
s.line_comment = s.text.substr(start + 1, s.pos).trim_space()
s.fgenln('// shebang line "$s.line_comment"')
return s.scan()
}
hash := s.text.substr(start, s.pos) hash := s.text.substr(start, s.pos)
return scan_res(.hash, hash.trim_space()) return scan_res(.hash, hash.trim_space())
case `>`: case `>`: