Skip to content

Commit

Permalink
grammar: destructure Label.return call tail
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorbin committed Mar 3, 2021
1 parent c869af3 commit 304b0ee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,12 +686,11 @@ class Label {
return this.parent.return(labelScope, this.rets.concat([node]), [], scanner);
}
} else if (head === 'call') {
const label = tail[0][1];
const labelScope = scope.label(label);
const [label, ...args] = tail;
const labelScope = scope.label(label[1]);
const node = labelScope.create('def', null, scanner.position());
const params = [];
for (let i = 1; i < tail.length; i++) {
const arg = tail[i];
for (const arg of args) {
if (arg[0] === 'get') {
params.push(arg[1]);
} else {
Expand Down

0 comments on commit 304b0ee

Please sign in to comment.