cl-lexer: Treat #!/
| #!\
as a comment
This commit is contained in:
parent
3f5c5480ae
commit
e06a27a5b1
@ -254,10 +254,16 @@ impl<'t> Lexer<'t> {
|
|||||||
}
|
}
|
||||||
fn hash(&mut self) -> LResult<Token> {
|
fn hash(&mut self) -> LResult<Token> {
|
||||||
match self.peek() {
|
match self.peek() {
|
||||||
Ok('!') => self.consume()?.produce_op(Punct::HashBang),
|
Ok('!') => self.consume()?.hashbang(),
|
||||||
_ => self.produce_op(Punct::Hash),
|
_ => 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> {
|
fn less(&mut self) -> LResult<Token> {
|
||||||
match self.peek() {
|
match self.peek() {
|
||||||
Ok('=') => self.consume()?.produce_op(Punct::LtEq),
|
Ok('=') => self.consume()?.produce_op(Punct::LtEq),
|
||||||
|
Loading…
Reference in New Issue
Block a user