Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Accept → and ↔ to point blocks
  • Loading branch information
Fernando Correa committed Mar 14, 2017
1 parent d232f3c commit 8d54440
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Perl6/Grammar.nqp
Expand Up @@ -1352,8 +1352,13 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
:my $*GOAL := '{';
<signature> {
%*SIG_INFO := $<signature>.ast;
$*SIG_OBJ := $*W.create_signature_and_params($<signature>,
%*SIG_INFO, $*W.cur_lexpad(), 'Mu', :rw($<lambda> eq '<->'));
$*SIG_OBJ := $*W.create_signature_and_params(
$<signature>,
%*SIG_INFO,
$*W.cur_lexpad(),
'Mu',
:rw($<lambda> eq '<->' || $<lambda> eq '')
);
}
<blockoid>
| <?[{]>
Expand All @@ -1363,7 +1368,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
]
}

token lambda { '->' | '<->' }
token lambda { '->' | '<->' | '→' | '↔' }

token block($*IMPLICIT = 0) {
:my $*DECLARAND := $*W.stub_code_object('Block');
Expand Down Expand Up @@ -1809,7 +1814,7 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}

token infix:sym<lambda> {
<?before '{' | '->' > <!{ $*IN_META }> {
<?before '{' | '->' | '→' > <!{ $*IN_META }> {
my $needparens := 0;
my $pos := $/.from;
my $line := HLL::Compiler.lineof($/.orig, $/.from, :cache(1));
Expand Down

0 comments on commit 8d54440

Please sign in to comment.