17db96d56Sopenharmony_ci#ifndef Py_ERRCODE_H
27db96d56Sopenharmony_ci#define Py_ERRCODE_H
37db96d56Sopenharmony_ci#ifdef __cplusplus
47db96d56Sopenharmony_ciextern "C" {
57db96d56Sopenharmony_ci#endif
67db96d56Sopenharmony_ci
77db96d56Sopenharmony_ci
87db96d56Sopenharmony_ci/* Error codes passed around between file input, tokenizer, parser and
97db96d56Sopenharmony_ci   interpreter.  This is necessary so we can turn them into Python
107db96d56Sopenharmony_ci   exceptions at a higher level.  Note that some errors have a
117db96d56Sopenharmony_ci   slightly different meaning when passed from the tokenizer to the
127db96d56Sopenharmony_ci   parser than when passed from the parser to the interpreter; e.g.
137db96d56Sopenharmony_ci   the parser only returns E_EOF when it hits EOF immediately, and it
147db96d56Sopenharmony_ci   never returns E_OK. */
157db96d56Sopenharmony_ci
167db96d56Sopenharmony_ci#define E_OK            10      /* No error */
177db96d56Sopenharmony_ci#define E_EOF           11      /* End Of File */
187db96d56Sopenharmony_ci#define E_INTR          12      /* Interrupted */
197db96d56Sopenharmony_ci#define E_TOKEN         13      /* Bad token */
207db96d56Sopenharmony_ci#define E_SYNTAX        14      /* Syntax error */
217db96d56Sopenharmony_ci#define E_NOMEM         15      /* Ran out of memory */
227db96d56Sopenharmony_ci#define E_DONE          16      /* Parsing complete */
237db96d56Sopenharmony_ci#define E_ERROR         17      /* Execution error */
247db96d56Sopenharmony_ci#define E_TABSPACE      18      /* Inconsistent mixing of tabs and spaces */
257db96d56Sopenharmony_ci#define E_OVERFLOW      19      /* Node had too many children */
267db96d56Sopenharmony_ci#define E_TOODEEP       20      /* Too many indentation levels */
277db96d56Sopenharmony_ci#define E_DEDENT        21      /* No matching outer block for dedent */
287db96d56Sopenharmony_ci#define E_DECODE        22      /* Error in decoding into Unicode */
297db96d56Sopenharmony_ci#define E_EOFS          23      /* EOF in triple-quoted string */
307db96d56Sopenharmony_ci#define E_EOLS          24      /* EOL in single-quoted string */
317db96d56Sopenharmony_ci#define E_LINECONT      25      /* Unexpected characters after a line continuation */
327db96d56Sopenharmony_ci#define E_BADSINGLE     27      /* Ill-formed single statement input */
337db96d56Sopenharmony_ci#define E_INTERACT_STOP 28      /* Interactive mode stopped tokenization */
347db96d56Sopenharmony_ci
357db96d56Sopenharmony_ci#ifdef __cplusplus
367db96d56Sopenharmony_ci}
377db96d56Sopenharmony_ci#endif
387db96d56Sopenharmony_ci#endif /* !Py_ERRCODE_H */
39