 
 M: redefined-rule summary
   name>> "Rule '" "' defined more than once" surround ;
-M: ebnf-rule (transform) ( ast -- parser )
+
+M: ebnf-rule (transform) ( ast -- parser )
   dup elements>>
   (transform) [
     swap symbol>> dup get parser? [ redefined-rule ] [ set ] if

          [
            over ebnf-var? [
              " " % # " over nth :> " %
              name>> %            ] [
              2drop
            ] if
          ] each-index
          " " %
          %           " nip ]" %          ] "" make    ] if
  ] if ;

M: ebnf-var build-locals ( code ast -- code )

  2dup
  [
    "(" [ 'choice' sp ] delay ")" syntax-pack
    swap 2seq
    [ first ] rot compose action ,
    "{" [ 'choice' sp ] delay "}" syntax-pack
    swap 2seq
    [ first <ebnf-whitespace> ] rot compose action ,
  ] choice* ;

: 'group' ( -- parser )
  #! A grouping with no suffix. Used for precedence.
  [ ] [
    "~" token sp ensure-not ,
