py: Check explicitly for memory allocation failure in parser.

Previously, a failed malloc/realloc would throw an exception, which was
not caught.  I think it's better to keep the parser free from NLR
(exception throwing), hence this patch.
This commit is contained in:
Damien George
2014-04-10 14:27:31 +00:00
parent ffa9bddfc4
commit 58ba4c3b4c
6 changed files with 86 additions and 16 deletions

View File

@@ -67,6 +67,7 @@ typedef enum {
} mp_parse_input_kind_t;
typedef enum {
MP_PARSE_ERROR_MEMORY,
MP_PARSE_ERROR_UNEXPECTED_INDENT,
MP_PARSE_ERROR_UNMATCHED_UNINDENT,
MP_PARSE_ERROR_INVALID_SYNTAX,