# Pastebin deeaFhZ0 diff --git a/lib/Cromponent.rakumod b/lib/Cromponent.rakumod index 8b353b3..a0ebef0 100644 --- a/lib/Cromponent.rakumod +++ b/lib/Cromponent.rakumod @@ -1,25 +1,30 @@ -unit role Cromponent; - -my %compiled := ::?CLASS.&compile-cromponent; -#::?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 $code = $cromponent.RENDER; my $*TEMPLATE-REPOSITORY = get-template-repository; my $ast = Cro::WebApp::Template::Parser.parse( - $code, + "", #$code, actions => Cro::WebApp::Template::ASTBuilder # if I comment out this actions, it stops breaking - ).ast; + );#.ast; + + say $ast; + + #$ast.compile; return Map.new: ( renderer => sub (|) { 42 } ); } + +unit role Cromponent; + +my %compiled := ::?CLASS.&compile-cromponent; +::?CLASS.^add_method: "Str", %compiled; +dd %compiled; +