Skip to content

Commit

Permalink
Support writing of literals inside a signature.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jun 30, 2009
1 parent 997a1bd commit fa963c8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/parser/actions.pm
Expand Up @@ -1062,9 +1062,21 @@ method type_constraint($/) {
if $<fulltypename> {
$past := $<fulltypename>.ast;
}
else {
elsif $<EXPR> {
$past := make_anon_subtype($<EXPR>.ast);
}
else {
my $value := $<value>.ast;
$past := PAST::Op.new(
:name('infix:,'),
PAST::Op.new(
:pasttype('callmethod'),
:name('WHAT'),
$value
),
make_anon_subtype($value)
);
}
make $past;
}

Expand Down
2 changes: 1 addition & 1 deletion src/parser/grammar.pg
Expand Up @@ -502,9 +502,9 @@ rule type_declarator {
{*}
}

# XXX STD.pm also has value in here?
rule type_constraint {
[
| <value>
| <fulltypename>
| where <EXPR: 'm='> # XXX <EXPR(item %chaining)>
]
Expand Down

0 comments on commit fa963c8

Please sign in to comment.