blob: 068331708bfbd0486da7461f0277924465794a10 [file] [log] [blame]
Guido van Rossuma3309961993-07-28 09:05:47 +00001#ifndef Py_ERRCODE_H
2#define Py_ERRCODE_H
3#ifdef __cplusplus
4extern "C" {
5#endif
6
Guido van Rossumf70e43a1991-02-19 12:39:46 +00007/***********************************************************
Guido van Rossumfd71b9e2000-06-30 23:50:40 +00008Copyright (c) 2000, BeOpen.com.
9Copyright (c) 1995-2000, Corporation for National Research Initiatives.
10Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
11All rights reserved.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000012
Guido van Rossumfd71b9e2000-06-30 23:50:40 +000013See the file "Misc/COPYRIGHT" for information on usage and
14redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
Guido van Rossumf70e43a1991-02-19 12:39:46 +000015******************************************************************/
16
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000017/* Error codes passed around between file input, tokenizer, parser and
Guido van Rossumb6775db1994-08-01 11:34:53 +000018 interpreter. This is necessary so we can turn them into Python
19 exceptions at a higher level. Note that some errors have a
20 slightly different meaning when passed from the tokenizer to the
21 parser than when passed from the parser to the interpreter; e.g.
22 the parser only returns E_EOF when it hits EOF immediately, and it
23 never returns E_OK. */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000024
25#define E_OK 10 /* No error */
Guido van Rossumb6775db1994-08-01 11:34:53 +000026#define E_EOF 11 /* End Of File */
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000027#define E_INTR 12 /* Interrupted */
28#define E_TOKEN 13 /* Bad token */
29#define E_SYNTAX 14 /* Syntax error */
30#define E_NOMEM 15 /* Ran out of memory */
31#define E_DONE 16 /* Parsing complete */
32#define E_ERROR 17 /* Execution error */
Fred Drake85f36392000-07-11 17:53:00 +000033#define E_TABSPACE 18 /* Invalid indentation detected */
34#define E_OVERFLOW 19 /* Node had too many children */
35#define E_TOODEEP 20 /* Too many indentation levels */
36#define E_DEDENT 21 /* No matching outer block for dedent */
Guido van Rossuma3309961993-07-28 09:05:47 +000037
38#ifdef __cplusplus
39}
40#endif
41#endif /* !Py_ERRCODE_H */