diff --git a/compiler/cl-lexer/src/lib.rs b/compiler/cl-lexer/src/lib.rs index 399ac4f..1c1d294 100644 --- a/compiler/cl-lexer/src/lib.rs +++ b/compiler/cl-lexer/src/lib.rs @@ -254,10 +254,16 @@ impl<'t> Lexer<'t> { } fn hash(&mut self) -> LResult { match self.peek() { - Ok('!') => self.consume()?.produce_op(Punct::HashBang), + Ok('!') => self.consume()?.hashbang(), _ => self.produce_op(Punct::Hash), } } + fn hashbang(&mut self) -> LResult { + match self.peek() { + Ok('/' | '\'') => self.line_comment(), + _ => self.produce_op(Punct::HashBang), + } + } fn less(&mut self) -> LResult { match self.peek() { Ok('=') => self.consume()?.produce_op(Punct::LtEq),