Skip to content

Commit

Permalink
[error] Continue on invalid dollar character.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Aug 9, 2022
1 parent de2d1dd commit b0f5238
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 4 additions & 3 deletions CiLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,10 @@ CiToken ReadPreToken()
case '"':
return ReadString(false);
case '$':
if (ReadChar() != '"')
throw ParseException("Expected interpolated string");
return ReadString(true);
if (EatChar('"'))
return ReadString(true);
ReportError("Expected interpolated string");
continue;
case '0':
switch (PeekChar()) {
case 'B':
Expand Down
8 changes: 7 additions & 1 deletion test/error/LexInvalidDollar.ci
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
$foo //ERROR: Expected interpolated string
$public static class Test //ERROR: Expected interpolated string
{
public static bool Run()
{
return true;
}
}

0 comments on commit b0f5238

Please sign in to comment.