Permalink
Browse files

rename filename of parser code

  • Loading branch information...
1 parent 16720b5 commit 29983c6f246d03c3b6db57cecd51dad5d70df4b2 @hax hax committed Jan 15, 2013
Showing with 16 additions and 14 deletions.
  1. +3 −2 src/{jedi.ometajs → parser.ometajs}
  2. +1 −1 src/transformer.ometajs
  3. +12 −11 test/index.js
@@ -68,9 +68,10 @@ ometa PlainParser <: OffsideRule {
import_ = "import" space+ char*:path -> [#import, string(path)],
if_ = "if" spaces expr:x spaces -> [#if, x],
+ unless_ = "unless" spaces expr:x spaces -> [#unless, x],
elseif_ = "else if" spaces expr:x spaces -> [#elseif, x],
else_ = "else" spaces -> [#else],
- for_ = "for" spaces for_content:x (comma for_content)*:y ->[#for, [x].concat(y)],
+ for_ = "for" spaces for_content:x (comma for_content)*:y -> [#for, [x].concat(y)],
for_content = Expression.bindingPattern:x spaces "in" spaces expr:y -> [x, y],
match_ = "match" spaces expr:x -> [#match, x],
case_ = "case" spaces expr:x -> [#case, x],
@@ -166,7 +167,7 @@ Parser.initialize = function() {
filename += '.jedi'
}
this.filename = filename
- console.log('read ', filename)
+ //console.log('read ', filename)
return fs.readFileSync(filename).toString()
}
}
View
@@ -1,6 +1,6 @@
"module path at 'path'"
"module fs at 'fs'"
-"import Parser from './jedi'"
+"import Parser from './parser'"
"import flattenArray from './util'"
"export Transformer, InstructionsProcessor, Sorter, TemplateMatcher"
View
@@ -29,22 +29,15 @@ testOMeta(expression.Expression, exprTests.Expression, [
'expression',
])
-var jedi = require('../src/jedi')
-var jediTests = require('./jedi')
-testOMeta(jedi.Parser, jediTests.Parser, [
+var parser = require('../src/parser')
+var parserTests = require('./jedi')
+testOMeta(parser.Parser, parserTests.Parser, [
'source'
//'text',
//'blocks',
//element,
])
-var transpilerPhp = require('../src/transpiler.php5')
-var transpilerPhpTests = require('./transpiler.php5')
-testOMeta(transpilerPhp.PHP5Transpiler, transpilerPhpTests.PHP5Transpiler, [
- 'block',
- 'document'
-])
-
var transformer = require('../src/transformer')
var transformerTests = require('./transformer')
testOMeta(transformer.InstructionsProcessor, transformerTests.InstructionsProcessor, [
@@ -53,4 +46,12 @@ testOMeta(transformer.InstructionsProcessor, transformerTests.InstructionsProces
testOMeta(transformer.Sorter, transformerTests.Sorter, [
'document',
-])
+])
+
+
+var transpilerPhp = require('../src/transpiler.php5')
+var transpilerPhpTests = require('./transpiler.php5')
+testOMeta(transpilerPhp.PHP5Transpiler, transpilerPhpTests.PHP5Transpiler, [
+ 'block',
+ 'document'
+])

0 comments on commit 29983c6

Please sign in to comment.