Fix incorrect token representation

The third element in a token should just be an object containing line
number and column info. This PR fixes the problem with one of the tokens
being set incorrectly.
This commit is contained in:
Shuan Wang 2015-02-04 02:06:35 -08:00
parent 64632e3332
commit 92e5ab2857
2 changed files with 8 additions and 10 deletions

View File

@ -662,14 +662,12 @@
if (interpolated) {
ref3 = this.tokens, lastToken = ref3[ref3.length - 1];
rparen = this.token(')', ')');
rparen[2] = [
')', ')', {
first_line: lastToken[2].last_line,
first_column: lastToken[2].last_column + 1,
last_line: lastToken[2].last_line,
last_column: lastToken[2].last_column + 1
}
];
rparen[2] = {
first_line: lastToken[2].last_line,
first_column: lastToken[2].last_column + 1,
last_line: lastToken[2].last_line,
last_column: lastToken[2].last_column + 1
};
return rparen.stringEnd = true;
}
};

View File

@ -582,12 +582,12 @@ exports.Lexer = class Lexer
if interpolated
[..., lastToken] = @tokens
rparen = @token ')', ')'
rparen[2] = [')', ')',
rparen[2] = {
first_line: lastToken[2].last_line
first_column: lastToken[2].last_column + 1
last_line: lastToken[2].last_line
last_column: lastToken[2].last_column + 1
]
}
rparen.stringEnd = true
# Pairs up a closing token, ensuring that all listed pairs of tokens are