Skip to content

Commit d95c471

Browse files
committed
glayzzle#251 - lint
1 parent f817999 commit d95c471

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

src/parser/expr.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,10 @@ module.exports = {
197197

198198
switch (this.token) {
199199
case this.tok.T_INC:
200-
return this.node("pre")(
201-
"+",
202-
this.next().read_variable(false, false)
203-
);
200+
return this.node("pre")("+", this.next().read_variable(false, false));
204201

205202
case this.tok.T_DEC:
206-
return this.node("pre")(
207-
"-",
208-
this.next().read_variable(false, false)
209-
);
203+
return this.node("pre")("-", this.next().read_variable(false, false));
210204

211205
case this.tok.T_NEW:
212206
return this.read_new_expr();
@@ -355,7 +349,7 @@ module.exports = {
355349
if (isConst) this.error("VARIABLE");
356350
let right;
357351
if (this.next().token == "&") {
358-
right = this.node('byref');
352+
right = this.node("byref");
359353
if (this.next().token === this.tok.T_NEW) {
360354
if (this.php7) {
361355
this.error();

src/parser/variable.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,15 @@ module.exports = {
138138
what.loc.start = what.value[0].loc.start;
139139
}
140140
} else if (this.token === "{") {
141-
142141
// EncapsedPart
143-
const part = this.node('encapsedpart');
142+
const part = this.node("encapsedpart");
144143
const expr = this.next().read_expr();
145144
this.expect("}") && this.next();
146-
what = this.node("encapsed")([what, part(expr, true)], null, "offset");
145+
what = this.node("encapsed")(
146+
[what, part(expr, true)],
147+
null,
148+
"offset"
149+
);
147150
if (what.loc && what.value[0].loc) {
148151
what.loc.start = what.value[0].loc.start;
149152
}

0 commit comments

Comments
 (0)