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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 2968023002: Duplicate change from NodeLocator to NodeLocator2 (Closed)
Patch Set: Created 3 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index 5f2d0b47ddc1357e9b27c3999b6dd0341bd5557d..96d278c4f3f895719bbe27c2738a53fc3926d381 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -4077,7 +4077,10 @@ class NodeLocator2 extends UnifyingAstVisitor<Object> {
Token endToken = node.endToken;
// Don't include synthetic tokens.
while (endToken != beginToken) {
- if (endToken.type == TokenType.EOF || !endToken.isSynthetic) {
+ // Fasta scanner reports unterminated string literal errors
+ // and generates a synthetic string token with non-zero length.
+ // Because of this, check for length > 0 rather than !isSynthetic.
+ if (endToken.type == TokenType.EOF || endToken.length > 0) {
break;
}
endToken = endToken.previous;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698