diff --git a/addon/mode/simple.js b/addon/mode/simple.js index 655f991475..a1c626417a 100644 --- a/addon/mode/simple.js +++ b/addon/mode/simple.js @@ -137,10 +137,9 @@ var token = rule.token if (token && token.apply) token = token(matches) if (matches.length > 2 && rule.token && typeof rule.token != "string") { - state.pending = []; for (var j = 2; j < matches.length; j++) if (matches[j]) - state.pending.push({text: matches[j], token: rule.token[j - 1]}); + (state.pending || (state.pending = [])).push({text: matches[j], token: rule.token[j - 1]}); stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0)); return token[0]; } else if (token && token.join) {