GWicke has uploaded a new change for review.

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

Change subject: Inline isEOF / isSOF
......................................................................

Inline isEOF / isSOF

We generally use the production, so directly inline the code to avoid
unnecessary indirections.

Change-Id: I9d080a5d27a07de88bd65152f49963abec9f8c74
---
M lib/pegTokenizer.pegjs.txt
1 file changed, 4 insertions(+), 12 deletions(-)


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

diff --git a/lib/pegTokenizer.pegjs.txt b/lib/pegTokenizer.pegjs.txt
index a8f121a..100b475 100644
--- a/lib/pegTokenizer.pegjs.txt
+++ b/lib/pegTokenizer.pegjs.txt
@@ -304,16 +304,6 @@
     // cache the input length
     var inputLength = input.length;
 
-    // pseudo-production that matches at start of input
-    var isSOF = function (pos) {
-        return pos === 0;
-    };
-
-    // pseudo-production that matches at end of input
-    var isEOF = function (pos) {
-        return pos === inputLength;
-    };
-
     // Current extension/include tag being parsed.
     var currExtTag = null;
 
@@ -2450,9 +2440,11 @@
       return [inclTag].concat(inclContentToks);
   }
 
-sof = & { return isSOF(pos); } { return true; }
+// Start of file
+sof = & { return pos === 0; } { return true; }
 
-eof = & { return isEOF(pos); } { return true; }
+// End of file
+eof = & { return pos === input.length; } { return true; }
 
 newline = '\n' / '\r\n'
 

-- 
To view, visit https://gerrit.wikimedia.org/r/130276
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d080a5d27a07de88bd65152f49963abec9f8c74
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: GWicke <gwi...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to