Skip to content

Commit

Permalink
- fixed script line numbers after multi-line raw string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Jan 12, 2019
1 parent 7c54c6c commit d64dac9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/sc_man_scanner.re
Expand Up @@ -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); }
Expand Down Expand Up @@ -234,7 +234,7 @@ std2:
{ RET(TK_FloatConst); }

(["](([\\]["])|[^"])*["])
{ RET(TK_StringConst); }
{ goto string_const; }

(['] (any\[\n'])* ['])
{ RET(TK_NameConst); }
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit d64dac9

Please sign in to comment.