From 119eef2d294700c70619cdad88d67153ebf33b75 Mon Sep 17 00:00:00 2001 From: Jonathan Worthington Date: Sun, 11 Sep 2011 21:44:04 +0200 Subject: [PATCH] Handle 'Glass of Beer' style type names. --- src/Perl6/Actions.pm | 4 ++++ src/Perl6/SymbolTable.pm | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Perl6/Actions.pm b/src/Perl6/Actions.pm index 835ad04616b..03a1b705704 100644 --- a/src/Perl6/Actions.pm +++ b/src/Perl6/Actions.pm @@ -3139,6 +3139,10 @@ class Perl6::Actions is HLL::Actions { if $ { $type := $*ST.curry_role(%*HOW, $type, $, $/); } + if $ { + $type := $*ST.curry_role_with_args(%*HOW, $type, + [$[0].ast], hash()); + } make $type; } else { diff --git a/src/Perl6/SymbolTable.pm b/src/Perl6/SymbolTable.pm index 66b95cfb8c6..b33984b3592 100644 --- a/src/Perl6/SymbolTable.pm +++ b/src/Perl6/SymbolTable.pm @@ -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. @@ -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);