def parse_seq(tokens, options):
 result = []
 while (tokens.current() not in [None, ']', ')', '|']):
  atom = parse_atom(tokens, options)
  if (tokens.current() == '...'):
   atom = [OneOrMore(*atom)]
   tokens.move()
  result += atom
 return result

def parse_seq ( tokens , options ) : result = [ ] while ( tokens . current ( ) not in [ None , ']' , ')' , '|' ] ) : atom = parse_atom ( tokens , options ) if ( tokens . current ( ) == '...' ) : atom = [ OneOrMore ( * atom ) ] tokens . move ( ) result += atom return result
seq ::= * ; .