r107459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107458‎ | r107459 | r107460 >
Date:01:36, 28 December 2011
Author:neilk
Status:old
Tags:
Comment:
make peg src path outside of peg tokenizer
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/parserTests.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js
@@ -34,6 +34,9 @@
3535 // Fetch up some of our wacky parser bits...
3636
3737 var basePath = path.join(path.dirname(path.dirname(process.cwd())), 'modules');
 38+
 39+pegSrcPath = path.join(basePath, 'parser', 'pegTokenizer.pegjs.txt');
 40+
3841 function _require(filename) {
3942 var fullpath = path.join( basePath, filename );
4043 fileDependencies.push( fullpath );
@@ -162,8 +165,10 @@
163166 // Name of file used to cache the parser tests cases
164167 this.cache_file = "parserTests.cache";
165168
 169+ // create tokenizer
166170 // Preload the grammar file...
167 - var peg = fs.readFileSync(path.join(basePath, 'parser', 'pegTokenizer.pegjs.txt'), 'utf8');
 171+ // DEPENDS ON BASEPATH
 172+ var peg = fs.readFileSync( pegSrcPath, 'utf8' );
168173 var parserEnv = {};
169174 //var parserEnv = new MWParserEnvironment({
170175 // tagHooks: {

Status & tagging log