Skip to content

Commit

Permalink
Ununspace infix_circumfix_meta_operator
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jun 10, 2023
1 parent 9b071c2 commit 2e77a03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/Raku/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,8 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
elsif $<infix-prefix-meta-operator> {
$ast := $<infix-prefix-meta-operator>.ast;
}
elsif $<infix_circumfix_meta_operator> {
$ast := $<infix_circumfix_meta_operator>.ast;
elsif $<infix-circumfix-meta-operator> {
$ast := $<infix-circumfix-meta-operator>.ast;
}
elsif $<infixish> {
$ast := self.r('BracketedInfix').new($<infixish>.ast);
Expand Down Expand Up @@ -1164,14 +1164,14 @@ class Raku::Actions is HLL::Actions does Raku::CommonActions {
self.attach: $/, self.r('MetaInfix', 'Assign');
}

method infix_circumfix_meta_operator:sym<« »>($/) {
method infix-circumfix-meta-operator:sym<« »>($/) {
self.attach: $/, self.r('MetaInfix', 'Hyper').new:
infix => $<infixish>.ast,
dwim-left => $<opening> eq '«',
dwim-right => $<closing> eq '»'
}

method infix_circumfix_meta_operator:sym«<< >>»($/) {
method infix-circumfix-meta-operator:sym«<< >>»($/) {
self.attach: $/, self.r('MetaInfix', 'Hyper').new:
infix => $<infixish>.ast,
dwim-left => $<opening> eq '<<',
Expand Down
10 changes: 5 additions & 5 deletions src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ role Raku::Common {
my $match := $cursor.MATCH;
if $cursor.pos == nqp::chars($op) && (
$match<infix-prefix-meta-operator> ||
$match<infix_circumfix_meta_operator> ||
$match<infix-circumfix-meta-operator> ||
$match<infix_postfix_meta_operator> ||
$match<prefix_postfix_meta_operator> ||
$match<postfix_prefix_meta_operator> ||
Expand Down Expand Up @@ -1110,7 +1110,7 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
$*OPER := $<variable>;
self.check-variable($<variable>);
}
| <infix_circumfix_meta_operator> { $*OPER := $<infix_circumfix_meta_operator> }
| <infix-circumfix-meta-operator> { $*OPER := $<infix-circumfix-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 Down Expand Up @@ -1190,17 +1190,17 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
<O(|%prec, :dba('assignment operator'), :iffy(0))> {}
}
proto token infix_circumfix_meta_operator {*}
proto token infix-circumfix-meta-operator {*}
token infix_circumfix_meta_operator:sym<« »> {
token infix-circumfix-meta-operator:sym<« »> {
$<opening>=[ '«' | '»' ]
{} <infixish('hyper')>
$<closing>=[ '«' | '»' || <.missing("« or »")> ]
<.can-meta($<infixish>, "hyper with")>
{} <O=.AS_MATCH($<infixish><OPER><O>)>
}
token infix_circumfix_meta_operator:sym«<< >>» {
token infix-circumfix-meta-operator:sym«<< >>» {
$<opening>=[ '<<' | '>>' ]
{} <infixish('HYPER')>
$<closing>=[ '<<' | '>>' || <.missing("<< or >>")> ]
Expand Down

0 comments on commit 2e77a03

Please sign in to comment.