     [ <ebnf-ignore> ] "~" syntax grouped ;
 
 : ignore-repeat0-parser ( -- parser )
-    [ <ebnf-ignore-repeat0> ] "*~" syntax grouped ;
+    [ <ebnf-repeat0> <ebnf-ignore> ] "*~" syntax grouped ;
 
 : ignore-repeat1-parser ( -- parser )
-    [ <ebnf-ignore-repeat1> ] "+~" syntax grouped ;
+    [ <ebnf-repeat1> <ebnf-ignore> ] "+~" syntax grouped ;
 
 : optional-parser ( -- parser )
     [ <ebnf-optional> ] "?" syntax grouped ;

C: <ebnf-semantic> ebnf-semantic
C: <ebnf> ebnf

MIXIN: ebnf-ignored

INSTANCE: ebnf-ignore ebnf-ignored
INSTANCE: ebnf-ignore-repeat0 ebnf-ignored
INSTANCE: ebnf-ignore-repeat1 ebnf-ignored

: filter-hidden ( seq -- seq )
    ! Remove elements that produce no AST from sequence
    [ ebnf-ensure-not? ] reject [ ebnf-ensure? ] reject
    [ ebnf-ignored? ] reject ;

: syntax ( string -- parser )
    ! Parses the string, ignoring white space, and


M: ebnf-ignore (transform)
    transform-group [ drop ignore ] action ;

M: ebnf-repeat0 (transform)
    transform-group repeat0 ;
