Skip to content

Commit

Permalink
Fix parsing of whatever.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Apr 9, 2009
1 parent 4a95115 commit f9a2236
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
37 changes: 17 additions & 20 deletions src/parser/actions.pm
Expand Up @@ -1399,25 +1399,7 @@ method param_var($/) {


method expect_term($/, $key) {
my $past;
if $key eq '*' {
# Whatever.
$past := PAST::Op.new(
:pasttype('callmethod'),
:name('new'),
:node($/),
:lvalue(1),
PAST::Var.new(
:name('Whatever'),
:namespace(list()),
:scope('package'),
:node($/)
)
);
}
else {
$past := $( $/{$key} );
}
my $past := $( $/{$key} );

if $<post> {
for $<post> {
Expand Down Expand Up @@ -2515,7 +2497,22 @@ method term($/, $key) {
$short_name := @ns.pop();
}

if $key eq 'noarg' {
if $key eq '*' {
# Whatever.
$past := PAST::Op.new(
:pasttype('callmethod'),
:name('new'),
:node($/),
:lvalue(1),
PAST::Var.new(
:name('Whatever'),
:namespace(list()),
:scope('package'),
:node($/)
)
);
}
elsif $key eq 'noarg' {
if @ns {
$past := PAST::Op.new(
PAST::Var.new(
Expand Down
2 changes: 1 addition & 1 deletion src/parser/grammar.pg
Expand Up @@ -562,7 +562,6 @@ rule default_value {

token expect_term {
| <noun> <post>* {*} #= noun
| '*' {*} #= *
}


Expand Down Expand Up @@ -656,6 +655,7 @@ token term {
]
| <sigil> \s <arglist> {*} #= sigil
| '...' {*} #= ...
| '*' {*} #= *
]
}

Expand Down

0 comments on commit f9a2236

Please sign in to comment.