Skip to content

Commit

Permalink
Handle 'Glass of Beer' style type names.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Sep 11, 2011
1 parent 3da8879 commit 119eef2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Perl6/Actions.pm
Expand Up @@ -3139,6 +3139,10 @@ class Perl6::Actions is HLL::Actions {
if $<arglist> {
$type := $*ST.curry_role(%*HOW<role-curried>, $type, $<arglist>, $/);
}
if $<typename> {
$type := $*ST.curry_role_with_args(%*HOW<role-curried>, $type,
[$<typename>[0].ast], hash());
}
make $type;
}
else {
Expand Down
7 changes: 6 additions & 1 deletion src/Perl6/SymbolTable.pm
Expand Up @@ -1241,7 +1241,7 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
}
}

# Builds a curried role with the specified arguments.
# Builds a curried role based on a parsed argument list.
method curry_role($curryhow, $role, $arglist, $/) {
# Build a list of compile time arguments to the role; whine if
# we find something without one.
Expand All @@ -1261,6 +1261,11 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
}
}

self.curry_role_with_args($curryhow, $role, @pos_args, %named_args);
}

# Curries a role with the specified arguments.
method curry_role_with_args($curryhow, $role, @pos_args, %named_args) {
# Make the curry right away and add it to the SC.
my $curried := $curryhow.new_type($role, |@pos_args, |%named_args);
my $slot := self.add_object($curried);
Expand Down

0 comments on commit 119eef2

Please sign in to comment.