ajout gestion commentaires

This commit is contained in:
Nicolas PENELOUX 2023-10-09 13:41:21 +02:00
parent 0240ac6d4c
commit 115e4426bd

View file

@ -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 }