def parse_flag_set(source):
 flags = 0
 try:
  while True:
   saved_pos = source.pos
   ch = source.get()
   if (ch == 'V'):
    ch += source.get()
   flags |= REGEX_FLAGS[ch]
 except KeyError:
  source.pos = saved_pos
 return flags

def parse_flag_set ( source ) : flags = 0 try : while True : saved_pos = source . pos ch = source . get ( ) if ( ch == 'V' ) : ch += source . get ( ) flags |= REGEX_FLAGS [ ch ] except KeyError : source . pos = saved_pos return flags
parses a set of inline flags .