def parse_property(source, info, positive, in_set):
 saved_pos = source.pos
 ch = source.get()
 if (ch == '{'):
  negate = source.match('^')
  (prop_name, name) = parse_property_name(source)
  if source.match('}'):
   prop = lookup_property(prop_name, name, (positive != negate), source)
   return make_property(info, prop, in_set)
 elif (ch and (ch in 'CLMNPSZ')):
  prop = lookup_property(None, ch, positive, source)
  return make_property(info, prop, in_set)
 source.pos = saved_pos
 ch = ('p' if positive else 'P')
 return make_character(info, ord(ch), in_set)

def parse_property ( source , info , positive , in_set ) : saved_pos = source . pos ch = source . get ( ) if ( ch == '{' ) : negate = source . match ( '^' ) ( prop_name , name ) = parse_property_name ( source ) if source . match ( '}' ) : prop = lookup_property ( prop_name , name , ( positive != negate ) , source ) return make_property ( info , prop , in_set ) elif ( ch and ( ch in 'CLMNPSZ' ) ) : prop = lookup_property ( None , ch , positive , source ) return make_property ( info , prop , in_set ) source . pos = saved_pos ch = ( 'p' if positive else 'P' ) return make_character ( info , ord ( ch ) , in_set )
parses a unicode property .