mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
- fixed script line numbers after multi-line raw string literal
https://forum.zdoom.org/viewtopic.php?t=63210
This commit is contained in:
parent
731fe67600
commit
e0826726ba
1 changed files with 9 additions and 2 deletions
|
@ -93,7 +93,7 @@ std2:
|
||||||
("#region"|"#endregion") (any\"\n")* "\n"
|
("#region"|"#endregion") (any\"\n")* "\n"
|
||||||
{ goto newline; } /* Region blocks [mxd] */
|
{ goto newline; } /* Region blocks [mxd] */
|
||||||
|
|
||||||
(["](([\\]["])|[^"])*["]) { RET(TK_StringConst); }
|
(["](([\\]["])|[^"])*["]) { goto string_const; }
|
||||||
'stop' { RET(TK_Stop); }
|
'stop' { RET(TK_Stop); }
|
||||||
'wait' { RET(TK_Wait); }
|
'wait' { RET(TK_Wait); }
|
||||||
'fail' { RET(TK_Fail); }
|
'fail' { RET(TK_Fail); }
|
||||||
|
@ -234,7 +234,7 @@ std2:
|
||||||
{ RET(TK_FloatConst); }
|
{ RET(TK_FloatConst); }
|
||||||
|
|
||||||
(["](([\\]["])|[^"])*["])
|
(["](([\\]["])|[^"])*["])
|
||||||
{ RET(TK_StringConst); }
|
{ goto string_const; }
|
||||||
|
|
||||||
(['] (any\[\n'])* ['])
|
(['] (any\[\n'])* ['])
|
||||||
{ RET(TK_NameConst); }
|
{ RET(TK_NameConst); }
|
||||||
|
@ -465,6 +465,13 @@ normal_token:
|
||||||
return_val = true;
|
return_val = true;
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
string_const:
|
||||||
|
for (const char *c = tok; c < YYCURSOR; ++c)
|
||||||
|
{
|
||||||
|
if (*c == '\n') ++Line;
|
||||||
|
}
|
||||||
|
RET(TK_StringConst);
|
||||||
|
|
||||||
string:
|
string:
|
||||||
if (YYLIMIT != ScriptEndPtr)
|
if (YYLIMIT != ScriptEndPtr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue