Permalink
Browse files

Remove ⁇‼ Unicode ternary operator

  • Loading branch information...
zoffixznet committed Mar 15, 2017
1 parent 8574322 commit 9644fc360f455082c9bb7b2416ed18c063b3d832
Showing with 6 additions and 8 deletions.
  1. +6 −8 src/Perl6/Grammar.nqp
View
@@ -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> {
@@ -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>)>
}

0 comments on commit 9644fc3

Please sign in to comment.