# Pastebin WKfuAYTU diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod index 8b353b3..2f7a2d3 100644 --- a/lib/Cromponent.rakumod +++ b/lib/Cromponent.rakumod @@ -1,24 +1,10 @@ unit role Cromponent; my %compiled := ::?CLASS.&compile-cromponent; -#::?CLASS.^add_method: "Str", %compiled; +::?CLASS.^add_method: "Str", %compiled; dd %compiled; sub compile-cromponent(Mu:U $cromponent) { - use Cro::WebApp::Template::Repository; - use Cro::WebApp::Template::Parser; - use Cro::WebApp::Template::ASTBuilder; - - my $*TEMPLATE-FILE = $cromponent.^name.IO; - my $code = $cromponent.RENDER; - - my $*TEMPLATE-REPOSITORY = get-template-repository; - - my $ast = Cro::WebApp::Template::Parser.parse( - $code, - actions => Cro::WebApp::Template::ASTBuilder # if I comment out this actions, it stops breaking - ).ast; - return Map.new: ( renderer => sub (|) { 42 } );