softmoth / raku-Template-Mustache

Raku library for the Mustache template format
https://modules.raku.org/dist/Template::Mustache:cpan:SOFTMOTH
Artistic License 2.0
21 stars 19 forks source link

Not working after glr merge #10

Closed mj41 closed 9 years ago

mj41 commented 9 years ago

Output of: pre-glr-debug.sh t/01-basic.t Work in progress: https://github.com/mj41/p6-Template-Mustache/commits/mj-fix-glr


====================================================================================
origin  git@github.com:mj41/p6-Template-Mustache.git (fetch)
origin  git@github.com:mj41/p6-Template-Mustache.git (push)
up  git@github.com:softmoth/p6-Template-Mustache.git (fetch)
up  git@github.com:softmoth/p6-Template-Mustache.git (push)
====================================================================================
Output of 'git log -1 ; git diff HEAD~1':
commit b68f6819433fc25a338453f22a68b8b49ae0c4dd
Author: Michal Jurosz 
Date:   Sat Sep 5 15:41:41 2015 +0200

    !!! debug
diff --git a/lib/Template/Mustache.pm b/lib/Template/Mustache.pm
index 6b80083..1bb29e6 100644
--- a/lib/Template/Mustache.pm
+++ b/lib/Template/Mustache.pm
@@ -44,10 +44,12 @@ class Template::Mustache {

     class Template::Mustache::Actions {
         method TOP($/) {
+            note $/.perl;
             my %x = :val(''), :contents([]);
             my @frames;
             @frames.unshift: $%x;
             for $».made.flat -> $hunk {
+                note $hunk.perl;
                 if $hunk ~~ Associative and $hunk eq 'section' {
                     if $hunk {
                         @frames[0].push: $hunk;
@@ -78,7 +80,6 @@ class Template::Mustache {
                 }
             }
             @frames[0].push(~$0) if $0.chars;
-
             make %x;
         }
         method hunk($/) {
@@ -176,6 +177,7 @@ class Template::Mustache {

         my $actions = Template::Mustache::Actions.new;
         my @parsed = parse-template($initial-template);
+        note @parsed.perl; exit; # mj41 debug
         return format(@parsed, [%context]);

====================================================================================

====================================================================================
Switching perl6 to pre GLR (rakudo pre-glr tag)
Switching to moar-pre-glr
Updating shims
====================================================================================
Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "  \{\{string}}\n", to => 13, from => 12),), hash => EnumMap.new(:hunk([Match.new(ast => ["  ", {:type("var"), :val("string")}]<>, list => (Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "  \{\{string}}\n", to => 2, from => 0),), hash => EnumMap.new(:tag(Match.new(ast => {:type("var"), :val("string")}, list => (), hash => EnumMap.new(:name(Match.new(ast => "string", list => (), hash => EnumMap.new(:ident([Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "  \{\{string}}\n", to => 10, from => 4)])), orig => "  \{\{string}}\n", to => 10, from => 4))), orig => "  \{\{string}}\n", to => 12, from => 2))), orig => "  \{\{string}}\n", to => 12, from => 0)])), orig => "  \{\{string}}\n", to => 13, from => 0)
"  "
{:type("var"), :val("string")}
["  ", {:type("var"), :val("string")}, "\n"]<>
====================================================================================

====================================================================================
Switching perl6 to post GLR (rakudo nom branch)
Switching to moar-nom
Updating shims
====================================================================================
Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "  \{\{string}}\n", to => 13, from => 0)), hash => EnumMap.new(:hunk($[])), orig => "  \{\{string}}\n", to => 13, from => 0)
["  \{\{string}}\n"]
====================================================================================

lizmat commented 9 years ago

I find the moar-nom very confusing, perhaps call it moar-post-glr ?

Other than that, I have no feedback :-(

mj41 commented 9 years ago

np, updated a bit.

softmoth commented 9 years ago

Thanks for the report. This is fixed by 6dd93c2 and 003b2ec.

mj41 commented 9 years ago

Thx.