Arlolra has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/219304

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/04/219304/1

diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index 4c48c66..ba4310f 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -1948,7 +1948,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";
@@ -1985,8 +1985,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;
       }
     }
 
@@ -2001,7 +2000,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: newchange
Gerrit-Change-Id: If7301ba339958e997d788199334ed0ac2c38703c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to