jenkins-bot has submitted this change and it was merged. Change subject: Remove the last use of peg$FAILED from the PEG grammar ......................................................................
Remove the last use of peg$FAILED from the PEG grammar * However, the replacements in mediawiki.tokenizer.peg.js need to remain because, although we have no more hacky uses, internal failed results get cached so the failure object still needs to be the same throughout the async tokenizing. * When / if caching is turned off, it can be removed as well. https://gerrit.wikimedia.org/r/#/c/218822/ Change-Id: If7301ba339958e997d788199334ed0ac2c38703c --- M lib/pegTokenizer.pegjs.txt 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt index 0acdcf4..b361e5a 100644 --- a/lib/pegTokenizer.pegjs.txt +++ b/lib/pegTokenizer.pegjs.txt @@ -1957,7 +1957,7 @@ */ include_limits = - "<" c:"/"? name:$(n:$[oyinclude]i+ & { + il:("<" c:"/"? name:$(n:$[oyinclude]i+ & { var incl = n.toLowerCase(); return incl === "noinclude" || incl === "onlyinclude" || incl === "includeonly"; @@ -1994,8 +1994,7 @@ if ( incl !== "includeonly" && stops.onStack("sol_il") ) { var last = inclContent.split("\n"); if ( !/^(<!--([^-]|-(?!->))*-->)*$/.test(last[last.length - 1]) ) { - peg$currPos = peg$reportedPos; - return peg$FAILED; + return false; } } @@ -2010,7 +2009,7 @@ peg$currPos += inclContent.length; return [new TagTk(name, [], dp)].concat(inclContentToks); - } + }) & { return !!il; } { return il; } // Start of file sof = & { return endOffset() === 0 && !options.startOffset && !options.pipelineOffset; } -- To view, visit https://gerrit.wikimedia.org/r/219304 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7301ba339958e997d788199334ed0ac2c38703c Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra <[email protected]> Gerrit-Reviewer: Cscott <[email protected]> Gerrit-Reviewer: Subramanya Sastry <[email protected]> Gerrit-Reviewer: Tim Starling <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
