Skip to content

Commit

Permalink
Ununderscore infix_prefix_meta_operator
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 10, 2023
1 parent cebe2ad commit 9b071c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/Raku/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,8 +1116,8 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
$ast := self.r('Infix').new(~$<infix>, :properties($operator_properties.new-compat(|%prec)));
}
}
elsif $<infix_prefix_meta_operator> {
$ast := $<infix_prefix_meta_operator>.ast;
elsif $<infix-prefix-meta-operator> {
$ast := $<infix-prefix-meta-operator>.ast;
}
elsif $<infix_circumfix_meta_operator> {
$ast := $<infix_circumfix_meta_operator>.ast;
Expand All @@ -1137,11 +1137,11 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
self.attach: $/, $ast;
}

method infix_prefix_meta_operator:sym<!>($/) {
method infix-prefix-meta-operator:sym<!>($/) {
self.attach: $/, self.r('MetaInfix', 'Negate').new($<infixish>.ast);
}

method infix_prefix_meta_operator:sym<R>($/) {
method infix-prefix-meta-operator:sym<R>($/) {
self.attach: $/, self.r('MetaInfix', 'Reverse').new($<infixish>.ast);
}

Expand All @@ -1152,11 +1152,11 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
make $O;
}

method infix_prefix_meta_operator:sym<X>($/) {
method infix-prefix-meta-operator:sym<X>($/) {
self.attach: $/, self.r('MetaInfix', 'Cross').new($<infixish>.ast);
}

method infix_prefix_meta_operator:sym<Z>($/) {
method infix-prefix-meta-operator:sym<Z>($/) {
self.attach: $/, self.r('MetaInfix', 'Zip').new($<infixish>.ast);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ role Raku::Common {
my $cursor := $lang."$meth"();
my $match := $cursor.MATCH;
if $cursor.pos == nqp::chars($op) && (
$match<infix_prefix_meta_operator> ||
$match<infix-prefix-meta-operator> ||
$match<infix_circumfix_meta_operator> ||
$match<infix_postfix_meta_operator> ||
$match<prefix_postfix_meta_operator> ||
Expand Down Expand Up @@ -1111,7 +1111,7 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
self.check-variable($<variable>);
}
| <infix_circumfix_meta_operator> { $*OPER := $<infix_circumfix_meta_operator> }
| <infix_prefix_meta_operator> { $*OPER := $<infix_prefix_meta_operator> }
| <infix-prefix-meta-operator> { $*OPER := $<infix-prefix-meta-operator> }
| <infix> { $*OPER := $<infix> }
| <?{ $*IN_META ~~ /^[ '[]' | 'hyper' | 'HYPER' | 'R' | 'S' ]$/ && !$*IN_REDUCE }> <.missing("infix inside " ~ $*IN_META)>
]
Expand All @@ -1134,9 +1134,9 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
]
}
proto token infix_prefix_meta_operator {*}
proto token infix-prefix-meta-operator {*}
token infix_prefix_meta_operator:sym<!> {
token infix-prefix-meta-operator:sym<!> {
<sym> <![!]> {} [ <infixish('neg')> || <.panic: "Negation metaoperator not followed by valid infix"> ]
<!{ $<infixish>.Str eq '=' }>
[
Expand All @@ -1146,7 +1146,7 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
]
}
token infix_prefix_meta_operator:sym<R> {
token infix-prefix-meta-operator:sym<R> {
<sym> <infixish('R')> {}
<.can-meta($<infixish>, "reverse the args of")>
<O=.revO($<infixish>)>
Expand All @@ -1157,13 +1157,13 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
<?>
}
token infix_prefix_meta_operator:sym<X> {
token infix-prefix-meta-operator:sym<X> {
<sym> <infixish('X')> {}
<.can-meta($<infixish>, "cross with")>
<O(|%list_infix)>
}
token infix_prefix_meta_operator:sym<Z> {
token infix-prefix-meta-operator:sym<Z> {
<sym> <infixish('Z')> {}
<.can-meta($<infixish>, "zip with")>
<O(|%list_infix)>
Expand Down

0 comments on commit 9b071c2

Please sign in to comment.