diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Lexer.l | 6 | ||||
| -rw-r--r-- | t/trivial.pas | 7 |
3 files changed, 13 insertions, 1 deletions
@@ -6,3 +6,4 @@ out Parser.cc Lexer.cc Parser.hh +*.ll @@ -50,6 +50,10 @@ identifier [a-z_][0-9a-z_]* white [\t\f\r ] +comment1 \{((.|[\n\r])*?)\} +comment2 \(\*((.|[\n\r])*?)\*\) +comment {comment1}|{comment2} + %{ #define YY_USER_ACTION loc.columns(yyleng); %} @@ -169,6 +173,8 @@ white [\t\f\r ] {white}+ {loc.step();} \n+ {loc.lines(yyleng); loc.step();} +{comment} {} + . { std::cerr<<"ERROR"; } diff --git a/t/trivial.pas b/t/trivial.pas index 2795e2e..72f2d40 100644 --- a/t/trivial.pas +++ b/t/trivial.pas @@ -5,12 +5,17 @@ const gi=5; gr=3.1415; gs='nagi'; -var +var {this is comment} gvi:integer; gvf:real; gvp:^char; gva:array[0..4] of integer; +(* multiline + + +comments *) + function arithmetic_test(a:integer;b:char;c:real):integer; var d:integer; |
