Skip to content

Commit

Permalink
RakuAST: don't bother using especially named captures
Browse files Browse the repository at this point in the history
For the handling of if / with / elsif / orwith
  • Loading branch information
lizmat committed Sep 17, 2023
1 parent 19bd308 commit 35bdbbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Raku/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
for @*IF-PARTS {
@elsifs.push:
Nodify('Statement',$_).new:
condition => $<condition>[$index].ast,
then => $<then>[$index].ast;
condition => $<EXPR>[$index].ast,
then => $<pointy-block>[$index].ast;
++$index;
}

Expand Down
10 changes: 5 additions & 5 deletions src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,13 +1295,13 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
{}
:my $*GOAL := '{';
:my $*BORG := {};
<condition=.EXPR> # initial condition
<then=.pointy-block> # initial body
[ # any elsifs/orwiths
<EXPR> # initial condition
<pointy-block> # initial body
[ # any elsifs/orwiths
[
| [<.block-elsif>|<.block-orwith>]
<condition=.EXPR>
<then=.pointy-block>
<EXPR>
<pointy-block>
| $<what>=[<.block-else>\h*<.block-if>|elif]
<.malformed: ~$<what>, 'Elsif'>
Expand Down

0 comments on commit 35bdbbc

Please sign in to comment.