mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
Duplicate change from NodeLocator to NodeLocator2
R=danrubel@google.com Review-Url: https://codereview.chromium.org/2968023002 .
This commit is contained in:
parent
3c1c22a3a1
commit
9bb89bc026
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue