Skip to content

Commit

Permalink
RakuAST: remove the %multiplicative hash
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 9, 2023
1 parent 6578965 commit 6fa642c
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions src/Raku/Grammar.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,6 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
# Operators
# Precedence levels and their defaults
my %multiplicative := nqp::hash('prec', 'u=', 'assoc', 'left', 'dba', 'multiplicative');
my %multiplicative_iffy := nqp::hash('prec', 'u=', 'assoc', 'left', 'dba', 'multiplicative iffy', 'iffy', 1);
my %replication := nqp::hash('prec', 's=', 'assoc', 'left', 'dba', 'replication');
my %replication_xx := nqp::hash('prec', 's=', 'assoc', 'left', 'dba', 'replication', 'thunky', 't.');
Expand Down Expand Up @@ -2122,10 +2121,10 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
token infix:sym<?&> { <sym> <O(|%multiplicative_iffy)> }
# Multiplicative infixes requiring a word bound on the right side
token infix:sym<div> { <sym> >> <O(|%multiplicative)> }
token infix:sym<gcd> { <sym> >> <O(|%multiplicative)> }
token infix:sym<lcm> { <sym> >> <O(|%multiplicative)> }
token infix:sym<mod> { <sym> >> <O(|%multiplicative)> }
token infix:sym<div> { <sym> >> }
token infix:sym<gcd> { <sym> >> }
token infix:sym<lcm> { <sym> >> }
token infix:sym<mod> { <sym> >> }
# Multiplicatve infixes with meta interaction
token infix:sym«+<» {
Expand All @@ -2135,7 +2134,6 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
|| <?before '<<'>
|| <![<]>
]
<O(|%multiplicative)>
}
token infix:sym«+>» {
<sym>
Expand All @@ -2144,7 +2142,6 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
|| <?before '>>'>
|| <![>]>
]
<O(|%multiplicative)>
}
token infix:sym«~<» {
<sym>
Expand All @@ -2153,7 +2150,6 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
|| <?before '<<'>
|| <![<]>
]
<O(|%multiplicative)>
}
token infix:sym«~>» {
<sym>
Expand All @@ -2162,32 +2158,29 @@ grammar Raku::Grammar is HLL::Grammar does Raku::Common {
|| <?before '>>'>
|| <![>]>
]
<O(|%multiplicative)>
}
token infix:sym«<<» {
<sym>
<!{ $*IN-META }>
<?[\s]>
<.sorryobs('<< to do left shift', '+< or ~<')>
<O(|%multiplicative)>
}
token infix:sym«>>» {
<sym>
<!{ $*IN-META }>
<?[\s]>
<.sorryobs('>> to do right shift', '+> or ~>')>
<O(|%multiplicative)>
}
# Other multiplicative infixes
token infix:sym<*> { <sym> <O(|%multiplicative)> }
token infix:sym<×> { <sym> <O(|%multiplicative)> }
token infix:sym</> { <sym> <O(|%multiplicative)> }
token infix:sym<÷> { <sym> <O(|%multiplicative)> }
token infix:sym<%> { <sym> <O(|%multiplicative)> }
token infix:sym<+&> { <sym> <O(|%multiplicative)> }
token infix:sym<~&> { <sym> <O(|%multiplicative)> }
token infix:sym<*> { <sym> }
token infix:sym<×> { <sym> }
token infix:sym</> { <sym> }
token infix:sym<÷> { <sym> }
token infix:sym<%> { <sym> }
token infix:sym<+&> { <sym> }
token infix:sym<~&> { <sym> }
token infix:sym<-> { # 2D HYPHEN-MINUS -
# We want to match in '$a >>->> $b' but not 'if $a -> { ... }'.
Expand Down

0 comments on commit 6fa642c

Please sign in to comment.