- fixed script line numbers after multi-line raw string literal

https://forum.zdoom.org/viewtopic.php?t=63210
This commit is contained in:
alexey.lysiuk 2019-01-11 17:44:45 +02:00 committed by Christoph Oelckers
parent f7489976ec
commit 7c0633a3e9

View file

@ -93,7 +93,7 @@ std2:
("#region"|"#endregion") (any\"\n")* "\n"
{ goto newline; } /* Region blocks [mxd] */
(["](([\\]["])|[^"])*["]) { RET(TK_StringConst); }
(["](([\\]["])|[^"])*["]) { goto string_const; }
'stop' { RET(TK_Stop); }
'wait' { RET(TK_Wait); }
'fail' { RET(TK_Fail); }
@ -234,7 +234,7 @@ std2:
{ RET(TK_FloatConst); }
(["](([\\]["])|[^"])*["])
{ RET(TK_StringConst); }
{ goto string_const; }
(['] (any\[\n'])* ['])
{ RET(TK_NameConst); }
@ -465,6 +465,13 @@ normal_token:
return_val = true;
goto end;
string_const:
for (const char *c = tok; c < YYCURSOR; ++c)
{
if (*c == '\n') ++Line;
}
RET(TK_StringConst);
string:
if (YYLIMIT != ScriptEndPtr)
{