1 // Error codes passed around between file input, tokenizer, parser and 2 // interpreter. This is necessary so we can turn them into Python 3 // exceptions at a higher level. Note that some errors have a 4 // slightly different meaning when passed from the tokenizer to the 5 // parser than when passed from the parser to the interpreter; e.g. 6 // the parser only returns E_EOF when it hits EOF immediately, and it 7 // never returns E_OK. 8 // 9 // The public PyRun_InteractiveOneObjectEx() function can return E_EOF, 10 // same as its variants: 11 // 12 // * PyRun_InteractiveOneObject() 13 // * PyRun_InteractiveOneFlags() 14 // * PyRun_InteractiveOne() 15 16 #ifndef Py_ERRCODE_H 17 #define Py_ERRCODE_H 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #define E_OK 10 /* No error */ 23 #define E_EOF 11 /* End Of File */ 24 #define E_INTR 12 /* Interrupted */ 25 #define E_TOKEN 13 /* Bad token */ 26 #define E_SYNTAX 14 /* Syntax error */ 27 #define E_NOMEM 15 /* Ran out of memory */ 28 #define E_DONE 16 /* Parsing complete */ 29 #define E_ERROR 17 /* Execution error */ 30 #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ 31 #define E_OVERFLOW 19 /* Node had too many children */ 32 #define E_TOODEEP 20 /* Too many indentation levels */ 33 #define E_DEDENT 21 /* No matching outer block for dedent */ 34 #define E_DECODE 22 /* Error in decoding into Unicode */ 35 #define E_EOFS 23 /* EOF in triple-quoted string */ 36 #define E_EOLS 24 /* EOL in single-quoted string */ 37 #define E_LINECONT 25 /* Unexpected characters after a line continuation */ 38 #define E_BADSINGLE 27 /* Ill-formed single statement input */ 39 #define E_INTERACT_STOP 28 /* Interactive mode stopped tokenization */ 40 #define E_COLUMNOVERFLOW 29 /* Column offset overflow */ 41 42 #ifdef __cplusplus 43 } 44 #endif 45 #endif /* !Py_ERRCODE_H */ 46