|
|
|
@ -727,12 +727,12 @@ PEG.Compiler = {
|
|
|
|
|
* Stupid IE considers regexps /[]/ and /[^]/ syntactically invalid, so we
|
|
|
|
|
* translate them into euqivalents it can handle.
|
|
|
|
|
*/
|
|
|
|
|
if (node.characters === "") {
|
|
|
|
|
if (node.chars === "") {
|
|
|
|
|
var regexp = "/^(?!)/";
|
|
|
|
|
} else if (node.characters === "^") {
|
|
|
|
|
} else if (node.chars === "^") {
|
|
|
|
|
var regexp = "/^[\\S\\s]/";
|
|
|
|
|
} else {
|
|
|
|
|
var regexp = "/^[" + node.characters + "]/";
|
|
|
|
|
var regexp = "/^[" + node.chars + "]/";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return PEG.Compiler.formatCode(
|
|
|
|
@ -742,11 +742,11 @@ PEG.Compiler = {
|
|
|
|
|
"} else {",
|
|
|
|
|
" var ${resultVar} = null;",
|
|
|
|
|
" if (context.reportMatchFailures) {",
|
|
|
|
|
" this._matchFailed('[' + ${characters|string} + ']');",
|
|
|
|
|
" this._matchFailed('[' + ${chars|string} + ']');",
|
|
|
|
|
" }",
|
|
|
|
|
"}",
|
|
|
|
|
{
|
|
|
|
|
characters: node.characters,
|
|
|
|
|
chars: node.chars,
|
|
|
|
|
regexp: regexp,
|
|
|
|
|
resultVar: resultVar
|
|
|
|
|
}
|
|
|
|
|