php-parser
Advanced tools
Comparing version 3.0.0-prerelease.2 to 3.0.0-prerelease.3
{ | ||
"name": "php-parser", | ||
"version": "3.0.0-prerelease.2", | ||
"version": "3.0.0-prerelease.3", | ||
"description": "Parse PHP code and returns its AST", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -134,3 +134,3 @@ /*! | ||
engine.parseCode = function(buffer, filename, options) { | ||
if (typeof filename === "object") { | ||
if (typeof filename === "object" && !options) { | ||
// retro-compatibility | ||
@@ -137,0 +137,0 @@ options = filename; |
@@ -285,2 +285,8 @@ /** | ||
} | ||
// #176 : register latest position | ||
this.prev = [ | ||
this.lexer.yylloc.last_line, | ||
this.lexer.yylloc.last_column, | ||
this.lexer.offset | ||
]; | ||
return program(childs, this._errors, this._docs, this._tokens); | ||
@@ -287,0 +293,0 @@ }; |
@@ -133,3 +133,15 @@ /** | ||
while (this.token === ",") { | ||
result.push(this.next().read_use_declaration(typed)); | ||
this.next(); | ||
if (typed) { | ||
if ( | ||
this.token !== this.tok.T_FUNCTION && | ||
this.token !== this.tok.T_CONST && | ||
this.token !== this.tok.T_STRING | ||
) { | ||
break; | ||
} | ||
} else if (this.token !== this.tok.T_STRING) { | ||
break; | ||
} | ||
result.push(this.read_use_declaration(typed)); | ||
} | ||
@@ -136,0 +148,0 @@ return result; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
706437
18923