diff --git a/lexer.mll b/lexer.mll index 75cbd53..1109e00 100644 --- a/lexer.mll +++ b/lexer.mll @@ -18,4 +18,10 @@ rule token = parse | '=' { Lassign } | ';' { Lsc } | ident as i { Lvar i } +| '#' { comment lexbuf } | _ as c { raise (Error c) } + +and comment = parse +| eof { Lend } +| '\n' { Lexing.new_line lexbuf; token lexbuf } +| _ { comment lexbuf }