Accept single line "--" comments

This commit is contained in:
Timothy Bourke 2017-02-15 17:27:25 +01:00 committed by Gwenaël Delaval
parent 2d9fb52bec
commit abfc038b6b

View file

@ -223,6 +223,8 @@ rule token = parse
Loc (comment_start, comment_end)))
end;
token lexbuf }
| "--"
{ single_line_comment lexbuf }
| ['!' '?' '~']
['!' '$' '%' '&' '*' '+' '-' '.' '/' ':'
'<' '=' '>' '?' '@' '^' '|' '~'] *
@ -305,6 +307,10 @@ and comment = parse
| _
{ comment lexbuf }
and single_line_comment = parse
| newline { token lexbuf }
| _ { single_line_comment lexbuf }
and string = parse
| newline { new_line lexbuf; string lexbuf }
| '"'