Fix bug on token iteration.
This commit is contained in:
parent
c9e86d3aa9
commit
26345ebb31
1 changed files with 3 additions and 2 deletions
|
|
@ -222,7 +222,8 @@ exports.XQueryLexer = function() {
|
|||
}
|
||||
|
||||
var token = h.tokens[0];
|
||||
for(var k in Rules[currentState]) {
|
||||
var rules = Rules[currentState];
|
||||
for(var k = 0; k < rules.length; k++) {
|
||||
var rule = Rules[currentState][k];
|
||||
if((typeof(rule.name) === "function" && rule.name(token)) || rule.name === token.name) {
|
||||
info = rule;
|
||||
|
|
@ -244,7 +245,7 @@ exports.XQueryLexer = function() {
|
|||
} catch(e) {
|
||||
if(e instanceof tokenizer.ParseException) {
|
||||
var index = 0;
|
||||
for(var i in tokens) {
|
||||
for(var i=0; i < tokens.length; i++) {
|
||||
index += tokens[i].value.length;
|
||||
}
|
||||
tokens.push({ type: "text", value: line.substring(index) });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue