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