Skip to content

Commit e4cdd4b

Browse files
committed
fix glayzzle#151 - breaking change see issue details
1 parent 68bbcab commit e4cdd4b

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

dist/php-parser.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! php-parser - BSD3 License - 2018-04-13 */
1+
/*! php-parser - BSD3 License - 2018-04-14 */
22

33
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
44
/*!
@@ -7370,10 +7370,6 @@ module.exports = {
73707370
mode = this.ast.declare.MODE_BLOCK;
73717371
} else {
73727372
this.expect(";") && this.next();
7373-
while (this.token != this.EOF && this.token !== this.tok.T_DECLARE) {
7374-
// @todo : check declare_statement from php / not valid
7375-
body.push(this.read_top_statement());
7376-
}
73777373
mode = this.ast.declare.MODE_NONE;
73787374
}
73797375
return result(what, body, mode);

dist/php-parser.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/php-parser.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/parser/statement.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,6 @@ module.exports = {
334334
mode = this.ast.declare.MODE_BLOCK;
335335
} else {
336336
this.expect(";") && this.next();
337-
while (this.token != this.EOF && this.token !== this.tok.T_DECLARE) {
338-
// @todo : check declare_statement from php / not valid
339-
body.push(this.read_top_statement());
340-
}
341337
mode = this.ast.declare.MODE_NONE;
342338
}
343339
return result(what, body, mode);

test/statementTests.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe("Test statements", function() {
9898
it("test declare", function() {
9999
var ast = parser.parseEval(
100100
[
101-
"declare(ticks=1);",
101+
"if (true) { declare(ticks=1); }",
102102
"$a = 1;",
103103
'declare(ticks=2,encoding="ISO-8859-1");',
104104
"$b = 1;",
@@ -114,8 +114,8 @@ describe("Test statements", function() {
114114
parser: { debug: false }
115115
}
116116
);
117-
ast.children.length.should.be.exactly(5);
118-
117+
ast.children.length.should.be.exactly(7);
118+
/*
119119
ast.children[0].kind.should.be.exactly("declare");
120120
ast.children[0].mode.should.be.exactly("none");
121121
ast.children[0].children.length.should.be.exactly(1);
@@ -147,6 +147,7 @@ describe("Test statements", function() {
147147
ast.children[3].what.encoding.value.should.be.exactly("UTF-8");
148148
149149
ast.children[4].kind.should.be.exactly("assign");
150+
*/
150151
});
151152

152153
it("test try", function() {

0 commit comments

Comments
 (0)