Skip to content

Commit

Permalink
Ununderscore named_param
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 11, 2023
1 parent e0cefed commit e015bfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Raku/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2426,7 +2426,7 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {

method parameter($/) {
my $parameter := $<param-var> ?? $<param-var>.ast !!
$<named_param> ?? $<named_param>.ast !!
$<named-param> ?? $<named-param>.ast !!
$<param-term> ?? $<param-term>.ast !!
self.r('Parameter').new;
my $capture := self.r('Type', 'Capture');
Expand Down Expand Up @@ -2523,12 +2523,12 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
}
}

method named_param($/) {
method named-param($/) {
my $parameter;
if $<name> {
# Explicitly specified name to attach.
if $<named_param> {
$parameter := $<named_param>.ast;
if $<named-param> {
$parameter := $<named-param>.ast;
}
else {
$parameter := $<param-var>.ast;
Expand Down
8 changes: 4 additions & 4 deletions src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -2999,15 +2999,15 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
$/.panic('Obsolete use of | or \\ with sigil on param ' ~ $<param-var>);
}
| $<quant>=['\\'|'|'|'+'] <param-term>
| [ <param-var> | <named_param> ] $<quant>=['?'|'!'|<?>]
| [ <param-var> | <named-param> ] $<quant>=['?'|'!'|<?>]
| <?>
]
| $<quant>=['**'|'*'|'+'] <param-var>
| $<quant>=['\\'|'|'] <param-var> {
$/.panic('Obsolete use of | or \\ with sigil on param ' ~ $<param-var>);
}
| $<quant>=['\\'|'|'|'+'] <param-term>
| [ <param-var> | <named_param> ] $<quant>=['?'|'!'|<?>]
| [ <param-var> | <named-param> ] $<quant>=['?'|'!'|<?>]
]
<.ws>
<trait>*
Expand Down Expand Up @@ -3066,13 +3066,13 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
<defterm>?
}
token named_param {
token named-param {
:my $*GOAL := ')';
:dba('named parameter')
':'
[
| <name=.identifier> '('
<.ws> [ <named_param> | <param-var> ] <.ws>
<.ws> [ <named-param> | <param-var> ] <.ws>
[ ')' || <.panic: 'Unable to parse named parameter; couldn\'t find right parenthesis'> ]
| <param-var>
]
Expand Down

0 comments on commit e015bfe

Please sign in to comment.