Fix matching of case-instensitive literals
Code that calculated which part of the input to match against a literal was wrong in case of case-insensitive literals when generating speed-optimized parsers. As a result, matching of case-insensitive literals worked only at the end of the input (where too big length passed to the |substr| method didn't matter). Fixes GH-153.
This commit is contained in:
parent
0df8989f7a
commit
34fe2c01ae
|
@ -546,7 +546,7 @@ module.exports = function(ast, options) {
|
|||
case op.MATCH_STRING_IC: // MATCH_STRING_IC s, a, f, ...
|
||||
compileCondition(
|
||||
'input.substr(peg$currPos, '
|
||||
+ ast.consts[bc[ip + 1]].length
|
||||
+ eval(ast.consts[bc[ip + 1]]).length
|
||||
+ ').toLowerCase() === '
|
||||
+ c(bc[ip + 1]),
|
||||
1
|
||||
|
|
Loading…
Reference in a new issue