Skip to content

Commit 87eb27f

Browse files
committed
1 parent bc73c3c commit 87eb27f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/parser/class.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,18 @@ module.exports = {
459459
result.target = this.next().read_namespace_name();
460460
} else if (this.token === this.tok.T_AS) {
461461
result.act = 'as';
462-
result.flags = this.next().read_member_flags();
463-
result.target = this.expect(this.tok.T_STRING).text();
464-
this.next();
462+
if (this.next().is('T_MEMBER_FLAGS')) {
463+
result.flags = this.read_member_flags();
464+
} else {
465+
result.flags = null;
466+
}
467+
if (this.token === this.tok.T_STRING) {
468+
result.target = this.text();
469+
this.next();
470+
} else if (result.flags === null) {
471+
// no visibility flags and no name => too bad
472+
this.expect(this.tok.T_STRING)
473+
}
465474
} else {
466475
this.expect([
467476
this.tok.T_AS,

0 commit comments

Comments
 (0)