fix ada comment handling in strings
This commit is contained in:
parent
3171972dcb
commit
19c774d6e8
1 changed files with 9 additions and 4 deletions
13
l2/2.lex
13
l2/2.lex
|
@ -1,11 +1,16 @@
|
|||
%x COMMENT
|
||||
%x STRING
|
||||
|
||||
%%
|
||||
<INITIAL>"--" { BEGIN(COMMENT); }
|
||||
<COMMENT>"\n" { ECHO; BEGIN(INITIAL); }
|
||||
<INITIAL>"--" { BEGIN(COMMENT); }
|
||||
<INITIAL>\" { ECHO; BEGIN(STRING); }
|
||||
<COMMENT>"\n" { ECHO; BEGIN(INITIAL); }
|
||||
<STRING>\\\" { ECHO; }
|
||||
<STRING>\" { ECHO; BEGIN(INITIAL); }
|
||||
|
||||
<INITIAL>. { ECHO; }
|
||||
<COMMENT>. { }
|
||||
<INITIAL>. { ECHO; }
|
||||
<COMMENT>. { }
|
||||
<STRING>. { ECHO; }
|
||||
%%
|
||||
|
||||
// https://westes.github.io/flex/manual/Start-Conditions.html
|
||||
|
|
Loading…
Reference in a new issue