diff --git a/flap/src/hopix/hopixLexer.mll b/flap/src/hopix/hopixLexer.mll index 5e6312e..106b918 100644 --- a/flap/src/hopix/hopixLexer.mll +++ b/flap/src/hopix/hopixLexer.mll @@ -34,6 +34,8 @@ rule token = parse | newline { next_line_and token lexbuf } | blank+ { token lexbuf } | eof { EOF } + | "{*" { commentary lexbuf; token lexbuf } + | "##" {commentary_line lexbuf} (** Keywords *) | "let" { LET } @@ -47,3 +49,12 @@ rule token = parse (** Lexing error *) | _ { error lexbuf "unexpected character." } + + and commentary = parse + | "*}" { () } + | "{*" { commentary lexbuf; commentary lexbuf } + | _ { commentary lexbuf } + + and commentary_line = parse + | '\n' { next_line_and token lexbuf } + | _ { commentary_line lexbuf }