cl-lexer: Treat #!/ | #!\ as a comment

This commit is contained in:
John 2024-07-27 18:41:18 -05:00
parent 3f5c5480ae
commit e06a27a5b1

View File

@ -254,10 +254,16 @@ impl<'t> Lexer<'t> {
}
fn hash(&mut self) -> LResult<Token> {
match self.peek() {
Ok('!') => self.consume()?.produce_op(Punct::HashBang),
Ok('!') => self.consume()?.hashbang(),
_ => self.produce_op(Punct::Hash),
}
}
fn hashbang(&mut self) -> LResult<Token> {
match self.peek() {
Ok('/' | '\'') => self.line_comment(),
_ => self.produce_op(Punct::HashBang),
}
}
fn less(&mut self) -> LResult<Token> {
match self.peek() {
Ok('=') => self.consume()?.produce_op(Punct::LtEq),