Skip to content

Commit

Permalink
add support and a test for ...
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed Jun 26, 2010
1 parent caa5ba5 commit 56d4bd0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NQP/Actions.pm
Expand Up @@ -311,6 +311,10 @@ method term:sym<regex_declarator>($/) { make $<regex_declarator>.ast; }
method term:sym<statement_prefix>($/) { make $<statement_prefix>.ast; }
method term:sym<lambda>($/) { make $<pblock>.ast; }

method term:sym<...>($/) {
make PAST::Op.new( :pirop('die'), 'Stub code executed', :node($/) );
}

method fatarrow($/) {
my $past := $<val>.ast;
$past.named( $<key>.Str );
Expand Down
1 change: 1 addition & 0 deletions src/NQP/Grammar.pm
Expand Up @@ -232,6 +232,7 @@ token term:sym<multi_declarator> { <?before 'multi'|'proto'|'only'> <multi_dec
token term:sym<regex_declarator> { <regex_declarator> }
token term:sym<statement_prefix> { <statement_prefix> }
token term:sym<lambda> { <?lambda> <pblock> }
token term:sym<...> { <sym> <args>? }

token fatarrow {
<key=.identifier> \h* '=>' <.ws> <val=.EXPR('i=')>
Expand Down
7 changes: 7 additions & 0 deletions t/nqp/52-yadda.t
@@ -0,0 +1,7 @@
# nqp
# check that ... works

say("1..1");

for <> { ... }
ok(1, 'yadda-yadda-yadda parses');

0 comments on commit 56d4bd0

Please sign in to comment.