Reader throw error for pernicious "$" bug
This commit is contained in:
@@ -399,6 +399,9 @@ class Reader {
|
|||||||
endCurrentStringPart();
|
endCurrentStringPart();
|
||||||
var wrapInIf = false;
|
var wrapInIf = false;
|
||||||
var firstAfterDollar = stream.expect('interpolation expression', () -> stream.peekChars(1));
|
var firstAfterDollar = stream.expect('interpolation expression', () -> stream.peekChars(1));
|
||||||
|
if (firstAfterDollar == '"') {
|
||||||
|
throw new StreamError(pos, "$ at end of string should be prefixed with \\ or followed by an expression to interpolate");
|
||||||
|
}
|
||||||
if (firstAfterDollar == "?") {
|
if (firstAfterDollar == "?") {
|
||||||
wrapInIf = true;
|
wrapInIf = true;
|
||||||
stream.dropChars(1);
|
stream.dropChars(1);
|
||||||
|
Reference in New Issue
Block a user