Index: trunk/extensions/VisualEditor/tests/parser/parserTests.js |
— | — | @@ -34,6 +34,9 @@ |
35 | 35 | // Fetch up some of our wacky parser bits... |
36 | 36 | |
37 | 37 | var basePath = path.join(path.dirname(path.dirname(process.cwd())), 'modules'); |
| 38 | + |
| 39 | +pegSrcPath = path.join(basePath, 'parser', 'pegTokenizer.pegjs.txt'); |
| 40 | + |
38 | 41 | function _require(filename) { |
39 | 42 | var fullpath = path.join( basePath, filename ); |
40 | 43 | fileDependencies.push( fullpath ); |
— | — | @@ -162,8 +165,10 @@ |
163 | 166 | // Name of file used to cache the parser tests cases |
164 | 167 | this.cache_file = "parserTests.cache"; |
165 | 168 | |
| 169 | + // create tokenizer |
166 | 170 | // 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' ); |
168 | 173 | var parserEnv = {}; |
169 | 174 | //var parserEnv = new MWParserEnvironment({ |
170 | 175 | // tagHooks: { |