Fix bug with array iteration.
This commit is contained in:
parent
26345ebb31
commit
f65d123dc8
1 changed files with 10 additions and 10 deletions
|
|
@ -266,18 +266,18 @@ exports.XQueryLexer = function() {
|
|||
var diff = cachedLine.length - line.length;
|
||||
var idx = 0;
|
||||
var col = 0;
|
||||
for(var i in tokens) {
|
||||
for(var i = 0; i < tokens.length; i++) {
|
||||
var token = tokens[i];
|
||||
for(var j in this.tokens[row]) {
|
||||
var semanticToken = this.tokens[row][j];
|
||||
if(
|
||||
((col + token.value.length) <= begin.length && semanticToken.sc === col && semanticToken.ec === (col + token.value.length)) ||
|
||||
(semanticToken.sc === (col + diff) && semanticToken.ec === (col + token.value.length + diff))
|
||||
) {
|
||||
idx = i;
|
||||
tokens[i].type = semanticToken.type;
|
||||
}
|
||||
for(var j = 0; j < this.tokens[row].length; j++) {
|
||||
var semanticToken = this.tokens[row][j];
|
||||
if(
|
||||
((col + token.value.length) <= begin.length && semanticToken.sc === col && semanticToken.ec === (col + token.value.length)) ||
|
||||
(semanticToken.sc === (col + diff) && semanticToken.ec === (col + token.value.length + diff))
|
||||
) {
|
||||
idx = i;
|
||||
tokens[i].type = semanticToken.type;
|
||||
}
|
||||
}
|
||||
col += token.value.length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue