Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1056103002: Fix interpretation of string contents after interpolation expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 60e873b2dd0e70d5ff02d85623173f441f11b333..2a90fbb491f0f93aebee7fbff00dc84a40fb0053 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -3454,7 +3454,9 @@ class Parser {
StringLexemeHelper helper = new StringLexemeHelper(lexeme, isFirst, isLast);
int start = helper.start;
int end = helper.end;
- if (end - start + 1 < 0) {
+ bool stringEndsAfterStart = end >= start;
+ assert(stringEndsAfterStart);
+ if (!stringEndsAfterStart) {
AnalysisEngine.instance.logger.logError(
"Internal error: computeStringValue($lexeme, $isFirst, $isLast)");
return "";
@@ -4228,7 +4230,8 @@ class Parser {
} finally {
_inInitializer = wasInInitializer;
}
- } else if (_matches(TokenType.PERIOD) || _matches(TokenType.QUESTION_PERIOD)) {
+ } else if (_matches(TokenType.PERIOD) ||
+ _matches(TokenType.QUESTION_PERIOD)) {
Token operator = getAndAdvance();
return new PropertyAccess(prefix, operator, parseSimpleIdentifier());
} else {
@@ -7822,8 +7825,8 @@ class Parser {
Token nextToken = _skipSimpleIdentifier(token);
if (nextToken != null) {
return nextToken;
- } else if (_tokenMatches(token, TokenType.CLOSE_PAREN)
- || _tokenMatches(token, TokenType.COMMA)) {
+ } else if (_tokenMatches(token, TokenType.CLOSE_PAREN) ||
+ _tokenMatches(token, TokenType.COMMA)) {
// If the `id.` is followed by something that cannot produce a valid
// structure then assume this is a prefixed identifier but missing the
// trailing identifier
« no previous file with comments | « pkg/analyzer/lib/src/generated/ast.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698