#! support on Unix systems

pull/1308/head
Delyan Angelov 2019-07-25 13:27:59 +03:00 committed by Alexander Medvednikov
parent 082098ab67
commit 61fea2d82a
1 changed files with 6 additions and 0 deletions

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 `>`: