mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +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
f7489976ec
commit
7c0633a3e9
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