Skip to content

Commit

Permalink
Add rand as a term, cloning the Nil term's code.
Browse files Browse the repository at this point in the history
Apparently this still needs special handling to get properly awesome error messages, but for the moment, this works.
  • Loading branch information
colomon committed Feb 17, 2010
1 parent d5d58cc commit 2c23657
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -1380,6 +1380,10 @@ method term:sym<Nil>($/) {
make PAST::Op.new(:name('&Nil'), :node($/) );
}

method term:sym<rand>($/) {
make PAST::Op.new(:name('&rand'), :node($/) );
}

method term:sym<...>($/) {
make PAST::Op.new( :pasttype('call'), :name('&fail'), 'Stub code executed', :node($/) );
}
Expand Down
3 changes: 2 additions & 1 deletion src/Perl6/Grammar.pm
Expand Up @@ -775,7 +775,8 @@ proto token term { <...> }

token term:sym<self> { <sym> <.nofun> }

token term:sym<Nil> { <sym> <.nofun> }
token term:sym<Nil> { <sym> <.nofun> }
token term:sym<rand> { <sym> <.nofun> }

token term:sym<...> { <sym> <args>? }
token term:sym<???> { <sym> <args>? }
Expand Down

0 comments on commit 2c23657

Please sign in to comment.