Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove ⁇‼ Unicode ternary operator
  • Loading branch information
zoffixznet committed Mar 15, 2017
1 parent 8574322 commit 9644fc3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Perl6/Grammar.nqp
Expand Up @@ -1791,7 +1791,6 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token term:sym<value> { <value> }
token term:sym<unquote> { '{{{' <?{ $*IN_QUASI }> <statementlist> '}}}' }
token term:sym<!!> { '!!' <?before \s> } # actual error produced inside infix:<?? !!>
token term:sym<> { '‼' <?before \s> } # actual error produced inside infix:<⁇ ‼>
token term:sym<> { <sym> }

token term:sym<::?IDENT> {
Expand Down Expand Up @@ -4403,18 +4402,17 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
token infix:sym<max> { <sym> >> <O(|%tight_or_minmax)> }

token infix:sym<?? !!> {
$<sym>=['⁇' || '??']
{} # update $/, so $<sym> on the next line has a value
:my $*GOAL := $<sym> eq '??' ?? '!!' !! '‼';
:my $*GOAL := '!!';
$<sym>='??'
<.ws>
<EXPR('i=')>
[ $*GOAL
[ '!!'
|| <?before '::' <.-[=]>> { self.typed_panic: "X::Syntax::ConditionalOperator::SecondPartInvalid", second-part => "::" }
|| <?before ':' <.-[=\w]>> { self.typed_panic: "X::Syntax::ConditionalOperator::SecondPartInvalid", second-part => ":" }
|| <infixish> { self.typed_panic: "X::Syntax::ConditionalOperator::PrecedenceTooLoose", operator => ~$<infixish> }
|| <?{ ~$<EXPR> ~~ / $*GOAL / }> { self.typed_panic: "X::Syntax::ConditionalOperator::SecondPartGobbled" }
|| <?before \N*? [\n\N*?]? $*GOAL> { self.typed_panic: "X::Syntax::Confused", reason => "Confused: Bogus code found before the !! of conditional operator" }
|| { self.typed_panic: "X::Syntax::Confused", reason => "Confused: Found $<sym> but no $*GOAL" }
|| <?{ ~$<EXPR> ~~ / '!!' / }> { self.typed_panic: "X::Syntax::ConditionalOperator::SecondPartGobbled" }
|| <?before \N*? [\n\N*?]? '!!'> { self.typed_panic: "X::Syntax::Confused", reason => "Confused: Bogus code found before the !! of conditional operator" }
|| { self.typed_panic: "X::Syntax::Confused", reason => "Confused: Found ?? but no !!" }
]
<O(|%conditional, :reducecheck<ternary>, :pasttype<if>)>
}
Expand Down

0 comments on commit 9644fc3

Please sign in to comment.