Skip to content

Commit 9e94c03

Browse files
committed
simplified read_match_pair function
1 parent 62e3880 commit 9e94c03

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/parser/expr.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,15 @@ module.exports = {
635635
return this.node("noop")();
636636
}
637637

638-
const entry = this.node("matchentry");
638+
return this.node("matchentry")(
639+
this.read_match_pair_keys(),
640+
this.read_expr(),
641+
false,
642+
false
643+
);
644+
},
639645

646+
read_match_pair_keys: function () {
640647
const keys = [];
641648
if (this.token === this.tok.T_DEFAULT) {
642649
keys.push(this.node("defaultkeyword")("default"));
@@ -651,9 +658,7 @@ module.exports = {
651658
if (this.expect(this.tok.T_DOUBLE_ARROW)) {
652659
this.next();
653660
}
654-
const value = this.read_expr();
655-
656-
return entry(keys, value, false, false);
661+
return keys;
657662
},
658663

659664
/**

0 commit comments

Comments
 (0)