Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 1 | #ifndef Py_ERRCODE_H |
| 2 | #define Py_ERRCODE_H |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 7 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 8 | /* Error codes passed around between file input, tokenizer, parser and |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 9 | interpreter. This is necessary so we can turn them into Python |
| 10 | exceptions at a higher level. Note that some errors have a |
| 11 | slightly different meaning when passed from the tokenizer to the |
| 12 | parser than when passed from the parser to the interpreter; e.g. |
| 13 | the parser only returns E_EOF when it hits EOF immediately, and it |
| 14 | never returns E_OK. */ |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 15 | |
| 16 | #define E_OK 10 /* No error */ |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 17 | #define E_EOF 11 /* End Of File */ |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 18 | #define E_INTR 12 /* Interrupted */ |
| 19 | #define E_TOKEN 13 /* Bad token */ |
| 20 | #define E_SYNTAX 14 /* Syntax error */ |
| 21 | #define E_NOMEM 15 /* Ran out of memory */ |
| 22 | #define E_DONE 16 /* Parsing complete */ |
| 23 | #define E_ERROR 17 /* Execution error */ |
Fred Drake | 4d4daed | 2000-07-11 19:49:15 +0000 | [diff] [blame] | 24 | #define E_TABSPACE 18 /* Inconsistent mixing of tabs and spaces */ |
Fred Drake | 85f3639 | 2000-07-11 17:53:00 +0000 | [diff] [blame] | 25 | #define E_OVERFLOW 19 /* Node had too many children */ |
| 26 | #define E_TOODEEP 20 /* Too many indentation levels */ |
| 27 | #define E_DEDENT 21 /* No matching outer block for dedent */ |
Martin v. Löwis | 00f1e3f | 2002-08-04 17:29:52 +0000 | [diff] [blame] | 28 | #define E_DECODE 22 /* Error in decoding into Unicode */ |
Skip Montanaro | 118ec70 | 2002-08-15 01:20:16 +0000 | [diff] [blame] | 29 | #define E_EOFS 23 /* EOF in triple-quoted string */ |
| 30 | #define E_EOLS 24 /* EOL in single-quoted string */ |
Martin v. Löwis | 4bf108d | 2005-03-03 11:45:45 +0000 | [diff] [blame] | 31 | #define E_LINECONT 25 /* Unexpected characters after a line continuation */ |
Martin v. Löwis | 4738340 | 2007-08-15 07:32:56 +0000 | [diff] [blame] | 32 | #define E_IDENTIFIER 26 /* Invalid characters in identifier */ |
Meador Inge | fa21bf0 | 2012-01-19 01:08:41 -0600 | [diff] [blame] | 33 | #define E_BADSINGLE 27 /* Ill-formed single statement input */ |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 34 | |
| 35 | #ifdef __cplusplus |
| 36 | } |
| 37 | #endif |
| 38 | #endif /* !Py_ERRCODE_H */ |