Lines Matching refs:pystr
84 ascii_escape_unicode(PyObject *pystr);
86 ascii_escape_str(PyObject *pystr);
88 py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr);
91 scan_once_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr);
93 scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr);
194 ascii_escape_unicode(PyObject *pystr) in ascii_escape_unicode() argument
207 input_chars = PyUnicode_GET_SIZE(pystr); in ascii_escape_unicode()
208 input_unicode = PyUnicode_AS_UNICODE(pystr); in ascii_escape_unicode()
264 ascii_escape_str(PyObject *pystr) in ascii_escape_str() argument
277 input_chars = PyString_GET_SIZE(pystr); in ascii_escape_str()
278 input_str = PyString_AS_STRING(pystr); in ascii_escape_str()
433 scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict, Py_ssize_t *next_end_pt… in scanstring_str() argument
445 Py_ssize_t len = PyString_GET_SIZE(pystr); in scanstring_str()
448 char *buf = PyString_AS_STRING(pystr); in scanstring_str()
467 raise_errmsg("Invalid control character at", pystr, next); in scanstring_str()
472 raise_errmsg("Unterminated string starting at", pystr, begin); in scanstring_str()
498 raise_errmsg("Unterminated string starting at", pystr, begin); in scanstring_str()
517 raise_errmsg("Invalid \\escape", pystr, end - 2); in scanstring_str()
526 raise_errmsg("Invalid \\uXXXX escape", pystr, next - 1); in scanstring_str()
544 raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); in scanstring_str()
570 raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); in scanstring_str()
607 scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr) in scanstring_unicode() argument
618 Py_ssize_t len = PyUnicode_GET_SIZE(pystr); in scanstring_unicode()
621 const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr); in scanstring_unicode()
640 raise_errmsg("Invalid control character at", pystr, next); in scanstring_unicode()
645 raise_errmsg("Unterminated string starting at", pystr, begin); in scanstring_unicode()
666 raise_errmsg("Unterminated string starting at", pystr, begin); in scanstring_unicode()
685 raise_errmsg("Invalid \\escape", pystr, end - 2); in scanstring_unicode()
694 raise_errmsg("Invalid \\uXXXX escape", pystr, next - 1); in scanstring_unicode()
712 raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); in scanstring_unicode()
737 raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); in scanstring_unicode()
788 PyObject *pystr; in py_scanstring() local
794 …if (!PyArg_ParseTuple(args, "OO&|zi:scanstring", &pystr, _convertPyInt_AsSsize_t, &end, &encoding,… in py_scanstring()
800 if (PyString_Check(pystr)) { in py_scanstring()
801 rval = scanstring_str(pystr, end, encoding, strict, &next_end); in py_scanstring()
803 else if (PyUnicode_Check(pystr)) { in py_scanstring()
804 rval = scanstring_unicode(pystr, end, strict, &next_end); in py_scanstring()
809 Py_TYPE(pystr)->tp_name); in py_scanstring()
822 py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr) in py_encode_basestring_ascii() argument
826 if (PyString_Check(pystr)) { in py_encode_basestring_ascii()
827 return ascii_escape_str(pystr); in py_encode_basestring_ascii()
829 else if (PyUnicode_Check(pystr)) { in py_encode_basestring_ascii()
830 return ascii_escape_unicode(pystr); in py_encode_basestring_ascii()
835 Py_TYPE(pystr)->tp_name); in py_encode_basestring_ascii()
882 _parse_object_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { in _parse_object_str() argument
890 char *str = PyString_AS_STRING(pystr); in _parse_object_str()
891 Py_ssize_t end_idx = PyString_GET_SIZE(pystr) - 1; in _parse_object_str()
916 raise_errmsg("Expecting property name", pystr, idx); in _parse_object_str()
919 key = scanstring_str(pystr, idx + 1, encoding, strict, &next_idx); in _parse_object_str()
927 raise_errmsg("Expecting : delimiter", pystr, idx); in _parse_object_str()
934 val = scan_once_str(s, pystr, idx, &next_idx); in _parse_object_str()
959 raise_errmsg("Expecting , delimiter", pystr, idx); in _parse_object_str()
970 raise_errmsg("Expecting object", pystr, end_idx); in _parse_object_str()
1009 _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr… in _parse_object_unicode() argument
1017 Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); in _parse_object_unicode()
1018 Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; in _parse_object_unicode()
1042 raise_errmsg("Expecting property name enclosed in double quotes", pystr, idx); in _parse_object_unicode()
1045 key = scanstring_unicode(pystr, idx + 1, strict, &next_idx); in _parse_object_unicode()
1053 raise_errmsg("Expecting ':' delimiter", pystr, idx); in _parse_object_unicode()
1060 val = scan_once_unicode(s, pystr, idx, &next_idx); in _parse_object_unicode()
1085 raise_errmsg("Expecting ',' delimiter", pystr, idx); in _parse_object_unicode()
1097 raise_errmsg("Expecting object", pystr, end_idx); in _parse_object_unicode()
1136 _parse_array_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { in _parse_array_str() argument
1144 char *str = PyString_AS_STRING(pystr); in _parse_array_str()
1145 Py_ssize_t end_idx = PyString_GET_SIZE(pystr) - 1; in _parse_array_str()
1160 val = scan_once_str(s, pystr, idx, &next_idx); in _parse_array_str()
1179 raise_errmsg("Expecting , delimiter", pystr, idx); in _parse_array_str()
1191 raise_errmsg("Expecting object", pystr, end_idx); in _parse_array_str()
1203 _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr)… in _parse_array_unicode() argument
1211 Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); in _parse_array_unicode()
1212 Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; in _parse_array_unicode()
1227 val = scan_once_unicode(s, pystr, idx, &next_idx); in _parse_array_unicode()
1246 raise_errmsg("Expecting ',' delimiter", pystr, idx); in _parse_array_unicode()
1258 raise_errmsg("Expecting object", pystr, end_idx); in _parse_array_unicode()
1296 _match_number_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr) { in _match_number_str() argument
1306 char *str = PyString_AS_STRING(pystr); in _match_number_str()
1307 Py_ssize_t end_idx = PyString_GET_SIZE(pystr) - 1; in _match_number_str()
1398 _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_p… in _match_number_unicode() argument
1408 Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); in _match_number_unicode()
1409 Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; in _match_number_unicode()
1489 scan_once_str(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) in scan_once_str() argument
1500 char *str = PyString_AS_STRING(pystr); in scan_once_str()
1501 Py_ssize_t length = PyString_GET_SIZE(pystr); in scan_once_str()
1516 return scanstring_str(pystr, idx + 1, in scan_once_str()
1523 res = _parse_object_str(s, pystr, idx + 1, next_idx_ptr); in scan_once_str()
1531 res = _parse_array_str(s, pystr, idx + 1, next_idx_ptr); in scan_once_str()
1578 return _match_number_str(s, pystr, idx, next_idx_ptr); in scan_once_str()
1582 scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) in scan_once_unicode() argument
1593 Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); in scan_once_unicode()
1594 Py_ssize_t length = PyUnicode_GET_SIZE(pystr); in scan_once_unicode()
1609 return scanstring_unicode(pystr, idx + 1, strict, next_idx_ptr); in scan_once_unicode()
1615 res = _parse_object_unicode(s, pystr, idx + 1, next_idx_ptr); in scan_once_unicode()
1623 res = _parse_array_unicode(s, pystr, idx + 1, next_idx_ptr); in scan_once_unicode()
1670 return _match_number_unicode(s, pystr, idx, next_idx_ptr); in scan_once_unicode()
1677 PyObject *pystr; in scanner_call() local
1685 …if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:scan_once", kwlist, &pystr, _convertPyInt_AsSsiz… in scanner_call()
1688 if (PyString_Check(pystr)) { in scanner_call()
1689 rval = scan_once_str(s, pystr, idx, &next_idx); in scanner_call()
1691 else if (PyUnicode_Check(pystr)) { in scanner_call()
1692 rval = scan_once_unicode(s, pystr, idx, &next_idx); in scanner_call()
1697 Py_TYPE(pystr)->tp_name); in scanner_call()