def parse_sequence(source, info):
 sequence = []
 applied = False
 while True:
  (characters, case_flags, element) = parse_literal_and_element(source, info)
  if (not element):
   append_literal(characters, case_flags, sequence)
   break
  if ((element is COMMENT) or (element is FLAGS)):
   append_literal(characters, case_flags, sequence)
  elif (type(element) is tuple):
   (ch, saved_pos) = element
   counts = parse_quantifier(source, info, ch)
   if counts:
    apply_quantifier(source, info, counts, characters, case_flags, ch, saved_pos, applied, sequence)
    applied = True
   else:
    constraints = parse_fuzzy(source, ch)
    if constraints:
     apply_constraint(source, info, constraints, characters, case_flags, saved_pos, applied, sequence)
     applied = True
    else:
     characters.append(ord(ch))
     append_literal(characters, case_flags, sequence)
     applied = False
  else:
   append_literal(characters, case_flags, sequence)
   sequence.append(element)
   applied = False
 return make_sequence(sequence)

def parse_sequence ( source , info ) : sequence = [ ] applied = False while True : ( characters , case_flags , element ) = parse_literal_and_element ( source , info ) if ( not element ) : append_literal ( characters , case_flags , sequence ) break if ( ( element is COMMENT ) or ( element is FLAGS ) ) : append_literal ( characters , case_flags , sequence ) elif ( type ( element ) is tuple ) : ( ch , saved_pos ) = element counts = parse_quantifier ( source , info , ch ) if counts : apply_quantifier ( source , info , counts , characters , case_flags , ch , saved_pos , applied , sequence ) applied = True else : constraints = parse_fuzzy ( source , ch ) if constraints : apply_constraint ( source , info , constraints , characters , case_flags , saved_pos , applied , sequence ) applied = True else : characters . append ( ord ( ch ) ) append_literal ( characters , case_flags , sequence ) applied = False else : append_literal ( characters , case_flags , sequence ) sequence . append ( element ) applied = False return make_sequence ( sequence )
parses a sequence .