From abfc038b6b199644ac14273fa0c6d35a22066ade Mon Sep 17 00:00:00 2001 From: Timothy Bourke Date: Wed, 15 Feb 2017 17:27:25 +0100 Subject: [PATCH] Accept single line "--" comments --- compiler/heptagon/parsing/hept_lexer.mll | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/heptagon/parsing/hept_lexer.mll b/compiler/heptagon/parsing/hept_lexer.mll index f98418c..de58588 100644 --- a/compiler/heptagon/parsing/hept_lexer.mll +++ b/compiler/heptagon/parsing/hept_lexer.mll @@ -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 } | '"'