Duplicate change from NodeLocator to NodeLocator2

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2968023002 .
This commit is contained in:
Brian Wilkerson 2017-07-05 11:24:07 -07:00
parent 3c1c22a3a1
commit 9bb89bc026

View file

@ -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;