homunculus
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -58,3 +58,3 @@ var fs = require('fs'); | ||
var 低位 = (编码 - 0x10000) % 0x400 + 0xDC00; | ||
return 补前缀(高位) + 补前缀(低位); | ||
return 补前缀(高位.toString(16)) + 补前缀(低位.toString(16)); | ||
} | ||
@@ -61,0 +61,0 @@ else { |
{ | ||
"name": "homunculus", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -635,3 +635,3 @@ var IParser = require('../Parser'); | ||
var next = this.tokens[j]; | ||
if(!S[token.type()]) { | ||
if(!S[next.type()]) { | ||
if(['in', 'of'].indexOf(next.content()) > -1) { | ||
@@ -687,14 +687,53 @@ node.add( | ||
else if(['let', 'const'].indexOf(this.look.content()) > -1) { | ||
node.add( | ||
this.match(), | ||
this.forbind() | ||
); | ||
if(!this.look || ['in', 'of'].indexOf(this.look.content()) == -1) { | ||
this.error(); | ||
outer: | ||
for(var i = this.index; i < this.length; i++) { | ||
var token = this.tokens[i]; | ||
if(!S[token.type()]) { | ||
//直接指向LexicalDeclaration | ||
if(['{', '['].indexOf(token.content()) > -1) { | ||
node.add(this.lexdecl(yYield)); | ||
if(this.look && this.look.content() != ';') { | ||
node.add(this.expr()); | ||
} | ||
node.add(this.match(';')); | ||
if(this.look && this.look.content() != ')') { | ||
node.add(this.expr()); | ||
} | ||
break; | ||
} | ||
//仅一个id之后跟着of或in也是LexicalDeclaration | ||
else if(token.type() == Token.ID) { | ||
for(var j = i + 1; j < this.length; j++) { | ||
var next = this.tokens[j]; | ||
if(!S[next.type()]) { | ||
if(['in', 'of'].indexOf(next.content()) > -1) { | ||
node.add( | ||
this.match(), | ||
this.forbind() | ||
); | ||
var isOf = next.content() == 'of'; | ||
node.add( | ||
this.match(), | ||
isOf ? this.assignexpr() : this.expr() | ||
); | ||
} | ||
else { | ||
node.add(this.lexdecl(yYield)); | ||
if(this.look && this.look.content() != ';') { | ||
node.add(this.expr()); | ||
} | ||
node.add(this.match(';')); | ||
if(this.look && this.look.content() != ')') { | ||
node.add(this.expr()); | ||
} | ||
} | ||
break outer; | ||
} | ||
} | ||
} | ||
else { | ||
this.error(); | ||
} | ||
} | ||
} | ||
var isOf = this.look.content() == 'of'; | ||
node.add( | ||
this.match(), | ||
isOf ? this.assignexpr() : this.expr() | ||
); | ||
} | ||
@@ -701,0 +740,0 @@ else { |
@@ -635,3 +635,3 @@ define(function(require, exports, module) {var IParser = require('../Parser'); | ||
var next = this.tokens[j]; | ||
if(!S[token.type()]) { | ||
if(!S[next.type()]) { | ||
if(['in', 'of'].indexOf(next.content()) > -1) { | ||
@@ -687,14 +687,53 @@ node.add( | ||
else if(['let', 'const'].indexOf(this.look.content()) > -1) { | ||
node.add( | ||
this.match(), | ||
this.forbind() | ||
); | ||
if(!this.look || ['in', 'of'].indexOf(this.look.content()) == -1) { | ||
this.error(); | ||
outer: | ||
for(var i = this.index; i < this.length; i++) { | ||
var token = this.tokens[i]; | ||
if(!S[token.type()]) { | ||
//直接指向LexicalDeclaration | ||
if(['{', '['].indexOf(token.content()) > -1) { | ||
node.add(this.lexdecl(yYield)); | ||
if(this.look && this.look.content() != ';') { | ||
node.add(this.expr()); | ||
} | ||
node.add(this.match(';')); | ||
if(this.look && this.look.content() != ')') { | ||
node.add(this.expr()); | ||
} | ||
break; | ||
} | ||
//仅一个id之后跟着of或in也是LexicalDeclaration | ||
else if(token.type() == Token.ID) { | ||
for(var j = i + 1; j < this.length; j++) { | ||
var next = this.tokens[j]; | ||
if(!S[next.type()]) { | ||
if(['in', 'of'].indexOf(next.content()) > -1) { | ||
node.add( | ||
this.match(), | ||
this.forbind() | ||
); | ||
var isOf = next.content() == 'of'; | ||
node.add( | ||
this.match(), | ||
isOf ? this.assignexpr() : this.expr() | ||
); | ||
} | ||
else { | ||
node.add(this.lexdecl(yYield)); | ||
if(this.look && this.look.content() != ';') { | ||
node.add(this.expr()); | ||
} | ||
node.add(this.match(';')); | ||
if(this.look && this.look.content() != ')') { | ||
node.add(this.expr()); | ||
} | ||
} | ||
break outer; | ||
} | ||
} | ||
} | ||
else { | ||
this.error(); | ||
} | ||
} | ||
} | ||
var isOf = this.look.content() == 'of'; | ||
node.add( | ||
this.match(), | ||
isOf ? this.assignexpr() : this.expr() | ||
); | ||
} | ||
@@ -701,0 +740,0 @@ else { |
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
16981
1176562