           [
             over ebnf-var? [
               " " % # " over nth :> " %
-              name>> %            ] [
+              name>> %
+            ] [
               2drop
             ] if
           ] each-index
           " " %
-          %           " nip ]" %          ] "" make    ] if
+          %
+          " nip ]" %   
+       ] "" make
+    ] if
   ] if ;
 
 M: ebnf-var build-locals ( code ast -- code )

: ebnf-transform ( ast -- parser quot )
  [ parser>> (transform) ]
  [ code>> insert-escapes ]
  [ parser>> ] tri build-locals   [ string-lines parse-lines ] call( string -- quot ) ;
M: ebnf-action (transform) ( ast -- parser )
  ebnf-transform check-action-effect action ;

M: ebnf-semantic (transform) ( ast -- parser )


M: redefined-rule summary
  name>> "Rule '" "' defined more than once" surround ;

M: ebnf-rule (transform) ( ast -- parser )
  dup elements>>
  (transform) [
    swap symbol>> dup get parser? [ redefined-rule ] [ set ] if
