Skip to content

Commit

Permalink
tokenize shebang
Browse files Browse the repository at this point in the history
  • Loading branch information
AvicennaJr committed Oct 30, 2024
1 parent 13a0722 commit 5e7a29f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lexer/lexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ func (l *Lexer) NextToken() token.Token {
} else {
tok = newToken(token.MODULUS, l.line, l.ch)
}
case rune('#'):
if l.peekChar() == rune('!') && l.line == 1 {
l.skipSingleLineComment()
return l.NextToken()
}
case 0:
tok.Literal = ""
tok.Type = token.EOF
Expand Down

0 comments on commit 5e7a29f

Please sign in to comment.