Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 7faf2b8

Progress but not working yet. Trunk is still broken.

  • Participants
  • Parent commits 90c7ed1

Comments (0)

Files changed (3)

File Text-Qantor/inc/Text/Qantor/Builder.pm

     );
 
     print join(" ", @cmd), "\n";
-    return system(@cmd);
+    if (system(@cmd))
+    {
+        die "Yapp Failed";
+    }
 }
 
 sub ACTION_code

File Text-Qantor/lib/Text/Qantor.pm

         $parser->YYData->{LINE_COUNT}++;
         if (!defined($parser->YYData->{LINE} = <$in_fh>))
         {
+            $parser->YYData->{STATE} = "EOF";
             return ['EOF', undef];
         }
         elsif ($parser->YYData->{LINE} =~ m{\A\s*\z})
     {
         my $state = $parser->YYData->{STATE};
 
-        if ($state eq "text")
+        if ($state eq "EOF")
+        {
+            return ('', undef);
+        }
+        elsif ($state eq "text")
         {
             if ($parser->YYData->{LINE} =~ m{\G\z}gmos)
             {

File Text-Qantor/qantor_grammar.yp

 # qantor_grammar.yp
 # 
 # Grammar for Qantor
+%left EOF TEXT
 %%
 
-input: text empty_line
+input: text EOF { $_[1] }
     ;
 
-text: para 
-    | text para { 
+text: raw_para
+    | text empty_line raw_para {
         my $l = $_[1];
-        $l->append($_[2]);
+        $l->append($_[3]);
         $l
         }
         ;
 
-para: para_text empty_line { 
+raw_para: para_text {
         my $p = Text::Qantor::Parser::Elem::Para->new(
                     { body => $_[1]->[0] },
                     );
                 )  } 
     ;
 
-single_empty_line: EMPTY_LINE 
+single_empty_line: EMPTY_LINE { print "\nTheMappaOo\n";}
     ;
 
-empty_line: single_empty_line
-    | empty_line single_empty_line 
-    | empty_line EOF
+empty_line: single_empty_line { print "\nFOO1\n"}
+    | empty_line single_empty_line  { print "\nFOO2\n"}
     ;
 
 para_text: plain_para_text
-    | macro_para_text
+      #| macro_para_text
     ;
 
 macro_start: MACRO_START