Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

homunculus

Package Overview
Dependencies
Maintainers
2
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

homunculus - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

4

dist/parser/es6/Parser.js

@@ -2129,5 +2129,3 @@ (function(factory) {

}
if(this.look.content() != ')') {
node.add(this.arglist());
}
node.add(this.arglist());
node.add(this.match(')'));

@@ -2134,0 +2132,0 @@ return node;

@@ -11,2 +11,3 @@ (function(factory) {

var character = require('../util/character');
var nid = 0;
var Node = Class(function(type, children) {

@@ -26,4 +27,8 @@ this.type = type;

this.ne = null;
this.id = nid++;
return this;
}).methods({
nid: function() {
return this.id;
},
name: function(t) {

@@ -30,0 +35,0 @@ if(!character.isUndefined(t)) {

{
"name": "homunculus",
"version": "0.2.4",
"version": "0.2.5",
"description": "A lexer&parser by Javascript",

@@ -5,0 +5,0 @@ "maintainers": [

@@ -14,3 +14,3 @@ # A lexer&parser by Javascript

## 使用说明
* 解析语法并返回语法树和此法单元序列。、
* 解析语法并返回语法树和此法单元序列。
* CommonJS/AMD/CMD自适应。

@@ -17,0 +17,0 @@

@@ -2121,5 +2121,3 @@ var IParser = require('../Parser');

}
if(this.look.content() != ')') {
node.add(this.arglist());
}
node.add(this.arglist());
node.add(this.match(')'));

@@ -2126,0 +2124,0 @@ return node;

var Class = require('../util/Class');
var character = require('../util/character');
var nid = 0;
var Node = Class(function(type, children) {

@@ -17,4 +18,8 @@ this.type = type;

this.ne = null;
this.id = nid++;
return this;
}).methods({
nid: function() {
return this.id;
},
name: function(t) {

@@ -21,0 +26,0 @@ if(!character.isUndefined(t)) {

@@ -998,3 +998,9 @@ var homunculus = require('../');

expect(varstmt.size()).to.be(3);
expect(varstmt.leaves().length).to.be(3);
});
it('node #nid', function() {
var parser = homunculus.getParser('js');
var node = parser.parse('var a');
expect(node.nid()).to.be.a('number');
});
it('#ast should return as parse return', function() {

@@ -1001,0 +1007,0 @@ var parser = homunculus.getParser('js');

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc