add comments support

This commit is contained in:
Mylloon 2022-12-08 21:29:42 +01:00
parent 6188140b44
commit ab6e8c466b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -18,4 +18,10 @@ rule token = parse
| '=' { Lassign } | '=' { Lassign }
| ';' { Lsc } | ';' { Lsc }
| ident as i { Lvar i } | ident as i { Lvar i }
| '#' { comment lexbuf }
| _ as c { raise (Error c) } | _ as c { raise (Error c) }
and comment = parse
| eof { Lend }
| '\n' { Lexing.new_line lexbuf; token lexbuf }
| _ { comment lexbuf }