ajout gestion commentaires
This commit is contained in:
parent
0240ac6d4c
commit
115e4426bd
1 changed files with 11 additions and 0 deletions
|
@ -34,6 +34,8 @@ rule token = parse
|
||||||
| newline { next_line_and token lexbuf }
|
| newline { next_line_and token lexbuf }
|
||||||
| blank+ { token lexbuf }
|
| blank+ { token lexbuf }
|
||||||
| eof { EOF }
|
| eof { EOF }
|
||||||
|
| "{*" { commentary lexbuf; token lexbuf }
|
||||||
|
| "##" {commentary_line lexbuf}
|
||||||
|
|
||||||
(** Keywords *)
|
(** Keywords *)
|
||||||
| "let" { LET }
|
| "let" { LET }
|
||||||
|
@ -47,3 +49,12 @@ rule token = parse
|
||||||
|
|
||||||
(** Lexing error *)
|
(** Lexing error *)
|
||||||
| _ { error lexbuf "unexpected character." }
|
| _ { 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 }
|
||||||
|
|
Reference in a new issue