def _parse(self, text, i):
m = self.start_dict_re.match(text, i)<EOL>if m:<EOL><INDENT>parsed = m.group(<NUM_LIT:0>)<EOL>i += len(parsed)<EOL>return self._parse_dict(text, i)<EOL><DEDENT>m = self.start_list_re.match(text, i)<EOL>if m:<EOL><INDENT>parsed = m.group(<NUM_LIT:0>)<EOL>i += len(parsed)<EOL>return self._parse_list(text, i)<EOL><DEDENT>m = self.value_re.match(text, i)<EOL>if m:<EOL><INDENT>parsed = m.group(<NUM_LIT:0>)<EOL>i += len(parsed)<EOL>if hasattr(self.current_type, "<STR_LIT>"):<EOL><INDENT>reader = self.current_type()<EOL>value = reader.read(m.group(<NUM_LIT:1>))<EOL>return value, i<EOL><DEDENT>value = self._trim_value(m.group(<NUM_LIT:1>))<EOL>if self.current_type in (None, dict, OrderedDict):<EOL><INDENT>self.current_type = self._guess_current_type(parsed, value)<EOL><DEDENT>if self.current_type == bool:<EOL><INDENT>value = bool(int(value))  <EOL>return value, i<EOL><DEDENT>value = self.current_type(value)<EOL>return value, i<EOL><DEDENT>m = self.hex_re.match(text, i)<EOL>if m:<EOL><INDENT>from glyphsLib.types import BinaryData<EOL>parsed, value = m.group(<NUM_LIT:0>), m.group(<NUM_LIT:1>)<EOL>decoded = BinaryData.fromHex(value)<EOL>i += len(parsed)<EOL>return decoded, i<EOL><DEDENT>else:<EOL><INDENT>self._fail("<STR_LIT>", text, i)<EOL><DEDENT>
Recursive function to parse a single dictionary, list, or value.