From 0901cac2d11660e9545a34a7ac7521aa27bcbfe8 Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 19 Nov 2023 22:43:56 +0100 Subject: [PATCH] fixed mixed quoting bug --- source/xml.l | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/xml.l b/source/xml.l index 37ee6ff..cce6796 100644 --- a/source/xml.l +++ b/source/xml.l @@ -11,6 +11,7 @@ bool is_comment_multiline; std::string current_tag; unsigned xml_tag_stack = 0; bool is_asymmetric; +char current_string_quote; unsigned long long cursor_position = 0; #define YY_USER_ACTION cursor_position += yyleng; @@ -138,6 +139,7 @@ identifier [A-z!][A-z0-9]* { \"|\' { + current_string_quote = yytext[0]; BEGIN STRING; } = { @@ -183,8 +185,12 @@ identifier [A-z!][A-z0-9]* { [^\\]\"|\' { - ECHOC(yytext[0]); - BEGIN TAG; + if (current_string_quote == yytext[1]) { + ECHOC(yytext[0]); + BEGIN TAG; + } else { + ECHO; + } } , { ECHOS("\\,");