| | |
| | | |
| | | |
| | | import string |
| | | from collections import OrderedDict |
| | | from typing import Dict, List, Union |
| | |
| | | if self.char == ":": |
| | | self.parse_char(":") |
| | | self.parse_ws() |
| | | self.parse_char("\"") |
| | | self.parse_char('"') |
| | | value_string = self.parse_string_value() |
| | | self.parse_char("\"") |
| | | self.parse_char('"') |
| | | return value_string |
| | | elif self.char == "{": |
| | | d = OrderedDict() |
| | |
| | | # assert self.char not in string.whitespace and self.char != EOS |
| | | assert self.char != EOS |
| | | l = [] |
| | | while self.char != "\"" or self.text[self.index + 1] != " ": |
| | | while self.char != '"' or self.text[self.index + 1] != " ": |
| | | l.append(self.char) |
| | | if not self.read(): |
| | | raise ValueError() |