homunculus
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -18,3 +18,2 @@ var Lexer = require('./src/lexer/Lexer'); | ||
var JsContext = require('./src/parser/js/Context'); | ||
var JsEnv = require('./src/parser/js/Env'); | ||
@@ -77,13 +76,2 @@ exports.getClass = function(type, lan) { | ||
break; | ||
case 'env': | ||
switch(lan) { | ||
case 'js': | ||
case 'javascript': | ||
case 'es': | ||
case 'ecmascript': | ||
return JsEnv; | ||
default: | ||
throw new Error('Unsupport Language Env: ' + lan); | ||
} | ||
break; | ||
case 'token': | ||
@@ -90,0 +78,0 @@ return Token; |
{ | ||
"name": "homunculus", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -13,3 +13,2 @@ var homunculus = require('../homunculus'); | ||
var JsContext = require('../src/parser/js/Context'); | ||
var JsEnv = require('../src/parser/js/Env'); | ||
@@ -47,7 +46,2 @@ describe('api of homunculus', function() { | ||
expect(homunculus.getClass('context', 'ecmascript')).to.be(JsContext); | ||
expect(homunculus.getClass('env', 'js')).to.be(JsEnv); | ||
expect(homunculus.getClass('env', 'javascript')).to.be(JsEnv); | ||
expect(homunculus.getClass('env', 'es')).to.be(JsEnv); | ||
expect(homunculus.getClass('env', 'ecmascript')).to.be(JsEnv); | ||
}); | ||
@@ -54,0 +48,0 @@ it('#getLexer', function() { |
@@ -134,2 +134,7 @@ var homunculus = require('../homunculus'); | ||
}); | ||
it('returnstmt 5', function() { | ||
var parser = homunculus.getParser('js'); | ||
var node = parser.parse('{return}'); | ||
expect(tree(node)).to.eql([JsNode.PROGRAM, [JsNode.BLOCK, ['{', JsNode.RETSTMT, ['return'], '}']]]); | ||
}); | ||
it('postfixexpr 1', function() { | ||
@@ -136,0 +141,0 @@ var parser = homunculus.getParser('js'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1028255
24846