homunculus
Advanced tools
Comparing version 0.3.2 to 0.3.3
{ | ||
"name": "homunculus", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -52,3 +52,3 @@ "maintainers": [ | ||
"expect.js": "^0.3.1", | ||
"gulp": "^3.6.0", | ||
"gulp": "^3.8.1", | ||
"gulp-clean": "^0.2.4", | ||
@@ -55,0 +55,0 @@ "gulp-util": "^2.2.14", |
@@ -356,2 +356,7 @@ var Lexer = require('./Lexer'); | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -389,2 +394,7 @@ this.tokenList.push(token); | ||
var token = new Token(Token.IGNORE, s, this.index - 1); | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -427,2 +437,7 @@ this.tokenList.push(token); | ||
} | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -429,0 +444,0 @@ this.tokenList.push(token); |
@@ -20,2 +20,3 @@ var Class = require('../util/Class'); | ||
this.colMax = 0; //最大列数 | ||
this.last = null; | ||
}, | ||
@@ -75,2 +76,7 @@ parse: function(code) { | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -186,2 +192,7 @@ this.tokenList.push(token); | ||
var token = new Token(Token.REG, this.code.slice(lastIndex, --this.index), lastIndex); | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -188,0 +199,0 @@ this.tokenList.push(token); |
@@ -8,2 +8,4 @@ var Class = require('../util/Class'); | ||
this.c = content; //token的字面内容,string包括头尾的引号 | ||
this.pr = null; | ||
this.ne = null; | ||
if(character.isNumber(val)) { | ||
@@ -22,3 +24,3 @@ sIndex = val; | ||
type: function(t) { | ||
if(!character.isUndefined(t)) { | ||
if(t !== void 0) { | ||
this.t = t; | ||
@@ -29,3 +31,3 @@ } | ||
content: function(c) { | ||
if(!character.isUndefined(c)) { | ||
if(c !== void 0) { | ||
this.c = c; | ||
@@ -36,3 +38,3 @@ } | ||
val: function(v) { | ||
if(!character.isUndefined(v)) { | ||
if(v !== void 0) { | ||
this.v = v; | ||
@@ -43,3 +45,3 @@ } | ||
tag: function(t) { | ||
if(!character.isUndefined(t)) { | ||
if(t !== void 0) { | ||
this.t = t; | ||
@@ -50,3 +52,3 @@ } | ||
tid: function(id) { | ||
if(!character.isUndefined(id)) { | ||
if(id !== void 0) { | ||
this.id = id; | ||
@@ -57,6 +59,18 @@ } | ||
sIndex: function(si) { | ||
if(!character.isUndefined(si)) { | ||
if(si !== void 0) { | ||
this.si = si; | ||
} | ||
return this.si; | ||
}, | ||
prev: function(t) { | ||
if(t !== void 0) { | ||
this.pr = t; | ||
} | ||
return this.pr; | ||
}, | ||
next: function(t) { | ||
if(t !== void 0) { | ||
this.ne = t; | ||
} | ||
return this.ne; | ||
} | ||
@@ -63,0 +77,0 @@ }).statics({ |
@@ -357,2 +357,7 @@ define(function(require, exports, module) { | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -390,2 +395,7 @@ this.tokenList.push(token); | ||
var token = new Token(Token.IGNORE, s, this.index - 1); | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -428,2 +438,7 @@ this.tokenList.push(token); | ||
} | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -430,0 +445,0 @@ this.tokenList.push(token); |
@@ -21,2 +21,3 @@ define(function(require, exports, module) { | ||
this.colMax = 0; //最大列数 | ||
this.last = null; | ||
}, | ||
@@ -76,2 +77,7 @@ parse: function(code) { | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -187,2 +193,7 @@ this.tokenList.push(token); | ||
var token = new Token(Token.REG, this.code.slice(lastIndex, --this.index), lastIndex); | ||
if(this.last) { | ||
token.prev(this.last); | ||
this.last.next(token); | ||
} | ||
this.last = token; | ||
temp.push(token); | ||
@@ -189,0 +200,0 @@ this.tokenList.push(token); |
@@ -9,2 +9,4 @@ define(function(require, exports, module) { | ||
this.c = content; //token的字面内容,string包括头尾的引号 | ||
this.pr = null; | ||
this.ne = null; | ||
if(character.isNumber(val)) { | ||
@@ -23,3 +25,3 @@ sIndex = val; | ||
type: function(t) { | ||
if(!character.isUndefined(t)) { | ||
if(t !== void 0) { | ||
this.t = t; | ||
@@ -30,3 +32,3 @@ } | ||
content: function(c) { | ||
if(!character.isUndefined(c)) { | ||
if(c !== void 0) { | ||
this.c = c; | ||
@@ -37,3 +39,3 @@ } | ||
val: function(v) { | ||
if(!character.isUndefined(v)) { | ||
if(v !== void 0) { | ||
this.v = v; | ||
@@ -44,3 +46,3 @@ } | ||
tag: function(t) { | ||
if(!character.isUndefined(t)) { | ||
if(t !== void 0) { | ||
this.t = t; | ||
@@ -51,3 +53,3 @@ } | ||
tid: function(id) { | ||
if(!character.isUndefined(id)) { | ||
if(id !== void 0) { | ||
this.id = id; | ||
@@ -58,6 +60,18 @@ } | ||
sIndex: function(si) { | ||
if(!character.isUndefined(si)) { | ||
if(si !== void 0) { | ||
this.si = si; | ||
} | ||
return this.si; | ||
}, | ||
prev: function(t) { | ||
if(t !== void 0) { | ||
this.pr = t; | ||
} | ||
return this.pr; | ||
}, | ||
next: function(t) { | ||
if(t !== void 0) { | ||
this.ne = t; | ||
} | ||
return this.ne; | ||
} | ||
@@ -64,0 +78,0 @@ }).statics({ |
Sorry, the diff of this file is not supported yet
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
414042
12747