homunculus
Advanced tools
Comparing version 0.1.10 to 0.1.11
@@ -142,6 +142,2 @@ var Lexer = require('./src/lexer/Lexer'); | ||
} | ||
}; | ||
var madge = require('madge'); | ||
var dependencyObject = madge('./web'); | ||
console.log(dependencyObject.tree); | ||
}; |
{ | ||
"name": "homunculus", | ||
"version": "0.1.10", | ||
"version": "0.1.11", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -1112,7 +1112,12 @@ var Class = require('../../util/Class'); | ||
switch(this.look.content()) { | ||
case '++': | ||
case '--': | ||
node.add( | ||
this.match(), | ||
this.leftexpr() | ||
); | ||
break; | ||
case 'delete': | ||
case 'void': | ||
case 'typeof': | ||
case '++': | ||
case '--': | ||
case '+': | ||
@@ -1136,6 +1141,6 @@ case '-': | ||
if(this.look && ['++', '--'].indexOf(this.look.content()) > -1 && !this.hasMoveLine) { | ||
node.add(leftexpr); | ||
while(this.look && ['++', '--'].indexOf(this.look.content()) > -1) { | ||
node.add(this.match(undefined, true)); | ||
} | ||
node.add( | ||
leftexpr, | ||
this.match(undefined, true) | ||
); | ||
} | ||
@@ -1142,0 +1147,0 @@ else { |
@@ -788,7 +788,12 @@ var Class = require('../../util/Class'); | ||
switch(this.look.content()) { | ||
case '++': | ||
case '--': | ||
node.add( | ||
this.match(), | ||
this.leftexpr() | ||
); | ||
break; | ||
case 'delete': | ||
case 'void': | ||
case 'typeof': | ||
case '++': | ||
case '--': | ||
case '+': | ||
@@ -812,6 +817,6 @@ case '-': | ||
if(this.look && ['++', '--'].indexOf(this.look.content()) > -1 && !this.hasMoveLine) { | ||
node.add(leftexpr); | ||
while(this.look && ['++', '--'].indexOf(this.look.content()) > -1) { | ||
node.add(this.match(undefined, true)); | ||
} | ||
node.add( | ||
leftexpr, | ||
this.match(undefined, true) | ||
); | ||
} | ||
@@ -818,0 +823,0 @@ else { |
@@ -351,3 +351,3 @@ var homunculus = require('../'); | ||
}); | ||
it('unaryexpr error', function() { | ||
it('unaryexpr error 1', function() { | ||
var parser = homunculus.getParser('js'); | ||
@@ -358,2 +358,19 @@ expect(function() { | ||
}); | ||
it('unaryexpr error 2', function() { | ||
var parser = homunculus.getParser('js'); | ||
expect(function() { | ||
parser.parse('++ +a'); | ||
}).to.throwError(); | ||
}); | ||
it('postfixexpr', function() { | ||
var parser = homunculus.getParser('js'); | ||
var node = parser.parse('a++'); | ||
expect(tree(node)).to.eql([JsNode.PROGRAM,[JsNode.EXPRSTMT,[JsNode.POSTFIXEXPR,[JsNode.PRMREXPR,["a"],"++"]]]]); | ||
}); | ||
it('postfixexpr error', function() { | ||
var parser = homunculus.getParser('js'); | ||
expect(function() { | ||
parser.parse('a++ ++'); | ||
}).to.throwError(); | ||
}); | ||
it('mtplexpr 1', function() { | ||
@@ -360,0 +377,0 @@ var parser = homunculus.getParser('js'); |
@@ -1113,7 +1113,12 @@ define(function(require, exports, module) { | ||
switch(this.look.content()) { | ||
case '++': | ||
case '--': | ||
node.add( | ||
this.match(), | ||
this.leftexpr() | ||
); | ||
break; | ||
case 'delete': | ||
case 'void': | ||
case 'typeof': | ||
case '++': | ||
case '--': | ||
case '+': | ||
@@ -1120,0 +1125,0 @@ case '-': |
@@ -789,7 +789,12 @@ define(function(require, exports, module) { | ||
switch(this.look.content()) { | ||
case '++': | ||
case '--': | ||
node.add( | ||
this.match(), | ||
this.leftexpr() | ||
); | ||
break; | ||
case 'delete': | ||
case 'void': | ||
case 'typeof': | ||
case '++': | ||
case '--': | ||
case '+': | ||
@@ -796,0 +801,0 @@ case '-': |
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
1173703
30008