shithub: mc

Download patch

ref: 16dbaa9af38342979bf91bf5f5e3f4e3d418919c
parent: c67ad93956c9d6e646894d882671f21285a264d4
author: Ori Bernstein <[email protected]>
date: Tue Jul 10 16:29:20 EDT 2012

Fix grammar conflicts.

    We now handle endlns properly in sequence literals.

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -521,6 +521,8 @@
 
 seqlit  : Tosqbrac seqbody Tcsqbrac
             {$$ = mkseq($1->line, $2.nl, $2.nn);}
+        | Tosqbrac Tcsqbrac
+            {$$ = mkseq($1->line, NULL, 0);}
         ;
 
 seqbody : seqelt
@@ -534,9 +536,11 @@
             {die("Unimplemented struct member init");}
         | Thash atomicexpr Tasn expr
             {die("Unimplmented array member init");}
-        | expr {$$ = $1;}
-        | Tendln seqelt {$$ = $2;}
-        | seqelt Tendln {$$ = $1;}
+        | endlns expr endlns{$$ = $2;}
+        ;
+
+endlns  : /* none */
+        | endlns Tendln
         ;
 
 stmt    : decl