homunculus
Advanced tools
Comparing version 0.3.7 to 0.3.8
{ | ||
"name": "homunculus", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "A lexer&parser by Javascript", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
# A lexer&parser by Javascript | ||
> `homunculus`取自`钢之炼金术师``人造人`,英语亦作`小矮人`,意指底层基石再造 | ||
`homunculus`取自`钢之炼金术师`中的`人造人`,英语亦作`小矮人`,意指底层基石再造 | ||
[![NPM version](https://badge.fury.io/js/homunculus.png)](https://npmjs.org/package/homunculus) | ||
@@ -5,0 +6,0 @@ [![Build Status](https://travis-ci.org/army8735/homunculus.svg?branch=master)](https://travis-ci.org/army8735/homunculus) |
@@ -82,4 +82,13 @@ var IParser = require('../Parser'); | ||
if(this.look.content() == 'module') { | ||
this.module = true; | ||
return this.moduleimport(); | ||
//根据LL2分辨是es6 module语法还是module.exports等语法 | ||
for(var i = this.index; i < this.length; i++) { | ||
var next = this.tokens[i]; | ||
if(!S[next.type()]) { | ||
if(next.type() == Token.ID) { | ||
this.module = true; | ||
return this.moduleimport(); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
@@ -94,5 +103,3 @@ else if(this.look.content() == 'import') { | ||
} | ||
else { | ||
return this.stmtlitem(); | ||
} | ||
return this.stmtlitem(); | ||
}, | ||
@@ -99,0 +106,0 @@ importdecl: function() { |
@@ -83,4 +83,13 @@ define(function(require, exports, module) { | ||
if(this.look.content() == 'module') { | ||
this.module = true; | ||
return this.moduleimport(); | ||
//根据LL2分辨是es6 module语法还是module.exports等语法 | ||
for(var i = this.index; i < this.length; i++) { | ||
var next = this.tokens[i]; | ||
if(!S[next.type()]) { | ||
if(next.type() == Token.ID) { | ||
this.module = true; | ||
return this.moduleimport(); | ||
} | ||
break; | ||
} | ||
} | ||
} | ||
@@ -95,5 +104,3 @@ else if(this.look.content() == 'import') { | ||
} | ||
else { | ||
return this.stmtlitem(); | ||
} | ||
return this.stmtlitem(); | ||
}, | ||
@@ -100,0 +107,0 @@ importdecl: function() { |
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
466995
13661
127