homunculus
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -0,0 +0,0 @@ var gulp = require('gulp'); |
@@ -0,0 +0,0 @@ var Lexer = require('./src/lexer/Lexer'); |
{ | ||
"name": "homunculus", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -0,0 +0,0 @@ var Lexer = require('./Lexer'); |
@@ -0,0 +0,0 @@ var Class = require('../util/Class'); |
@@ -0,0 +0,0 @@ var Match = require('./Match'); |
@@ -0,0 +0,0 @@ var Match = require('./Match'); |
@@ -0,0 +0,0 @@ var Match = require('./Match'); |
@@ -0,0 +0,0 @@ var Match = require('./Match'); |
@@ -0,0 +0,0 @@ var Class = require('../../util/Class'); |
@@ -0,0 +0,0 @@ var Match = require('./Match'); |
@@ -0,0 +0,0 @@ var Rule = require('./Rule'); |
@@ -0,0 +0,0 @@ var Rule = require('./Rule'); |
@@ -0,0 +0,0 @@ var Rule = require('./Rule'); |
@@ -0,0 +0,0 @@ var Rule = require('./Rule'); |
@@ -0,0 +0,0 @@ var Class = require('../../util/Class'); |
@@ -0,0 +0,0 @@ var Class = require('../util/Class'); |
@@ -0,0 +0,0 @@ var character = require('../../util/character'); |
@@ -0,0 +0,0 @@ var Class = require('../../util/Class'); |
@@ -0,0 +0,0 @@ var Class = require('../../util/Class'); |
@@ -14,2 +14,4 @@ var Class = require('../../util/Class'); | ||
this.p = null; | ||
this.pr = null; | ||
this.ne = null; | ||
return this; | ||
@@ -28,2 +30,7 @@ }).methods({ | ||
node.parent(self); | ||
var last = self.children[self.children.length - 1]; | ||
if(last) { | ||
last.next(node); | ||
node.prev(last); | ||
} | ||
self.children.push(node); | ||
@@ -41,2 +48,14 @@ }); | ||
return this.p; | ||
}, | ||
prev: function(pr) { | ||
if(pr) { | ||
this.pr = pr; | ||
} | ||
return this.pr; | ||
}, | ||
next: function(ne) { | ||
if(ne) { | ||
this.ne = ne; | ||
} | ||
return this.ne; | ||
} | ||
@@ -43,0 +62,0 @@ }).statics({ |
@@ -0,0 +0,0 @@ var Class = require('../../util/Class'); |
@@ -0,0 +0,0 @@ exports.LINE = '\n'; |
@@ -0,0 +0,0 @@ function inheritPrototype(subType, superType) { |
@@ -0,0 +0,0 @@ function quickSort(arr, begin, end, compare) { |
@@ -0,0 +0,0 @@ var homunculus = require('../homunculus'); |
@@ -0,0 +0,0 @@ var homunculus = require('../homunculus'); |
@@ -79,2 +79,16 @@ var homunculus = require('../homunculus'); | ||
}); | ||
it('node parent,prev,next', function() { | ||
var parser = homunculus.getParser('js'); | ||
var node = parser.parse('var a, b;'); | ||
var varstmt = node.leaves()[0]; | ||
var children = varstmt.leaves(); | ||
var a = children[0]; | ||
var b = children[1]; | ||
expect(node.parent()).to.be(null); | ||
expect(a.parent()).to.be(varstmt); | ||
expect(b.parent()).to.be(varstmt); | ||
expect(a.prev()).to.be(null); | ||
expect(a.next()).to.be(b); | ||
expect(b.prev()).to.be(a); | ||
}); | ||
}); | ||
@@ -81,0 +95,0 @@ describe('js lib exec test', function() { |
@@ -0,0 +0,0 @@ var fs = require('fs'); |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
@@ -0,0 +0,0 @@ define(function(require, exports, module) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
535284
15818