def _parse_quoted_string(data, start):
 value = u''
 qc = data[start]
 pos = (start + 1)
 while (pos < len(data)):
  char = data[pos]
  if (char == u'\\'):
   if ((pos + 1) < len(data)):
    value += data[(pos + 1)]
    pos += 2
   else:
    raise ParsingError(u'Unexpected end of data while escaping ({0})'.format(_format_position(data, pos)))
  elif (((char == u"'") or (char == u'"')) and (char == qc)):
   return ((pos + 1), value)
  else:
   value += char
   pos += 1
 raise ParsingError(u'Unexpected end of unquoted string (started at {0})!'.format(_format_position(data, start)))

def _parse_quoted_string ( data , start ) : value = u'' qc = data [ start ] pos = ( start + 1 ) while ( pos < len ( data ) ) : char = data [ pos ] if ( char == u'\\' ) : if ( ( pos + 1 ) < len ( data ) ) : value += data [ ( pos + 1 ) ] pos += 2 else : raise ParsingError ( u'Unexpected end of data while escaping ({0})' . format ( _format_position ( data , pos ) ) ) elif ( ( ( char == u"'" ) or ( char == u'"' ) ) and ( char == qc ) ) : return ( ( pos + 1 ) , value ) else : value += char pos += 1 raise ParsingError ( u'Unexpected end of unquoted string (started at {0})!' . format ( _format_position ( data , start ) ) )
parse a quoted string starting at position start in data .