From 19c774d6e86b4e0c78abe5950854c963c063a097 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Mon, 4 Nov 2024 09:16:29 +0100 Subject: [PATCH] fix ada comment handling in strings --- l2/2.lex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/l2/2.lex b/l2/2.lex index e85f7b7..0e5cfa4 100644 --- a/l2/2.lex +++ b/l2/2.lex @@ -1,11 +1,16 @@ %x COMMENT +%x STRING %% -"--" { BEGIN(COMMENT); } -"\n" { ECHO; BEGIN(INITIAL); } +"--" { BEGIN(COMMENT); } +\" { ECHO; BEGIN(STRING); } +"\n" { ECHO; BEGIN(INITIAL); } +\\\" { ECHO; } +\" { ECHO; BEGIN(INITIAL); } -. { ECHO; } -. { } +. { ECHO; } +. { } +. { ECHO; } %% // https://westes.github.io/flex/manual/Start-Conditions.html