fix ada comment handling in strings

This commit is contained in:
jacekpoz 2024-11-04 09:16:29 +01:00
parent 3171972dcb
commit 19c774d6e8
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -1,11 +1,16 @@
%x COMMENT %x COMMENT
%x STRING
%% %%
<INITIAL>"--" { BEGIN(COMMENT); } <INITIAL>"--" { BEGIN(COMMENT); }
<COMMENT>"\n" { ECHO; BEGIN(INITIAL); } <INITIAL>\" { ECHO; BEGIN(STRING); }
<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