Mercurial > cpython-lru_cache-weakref
annotate Python/getcompiler.c @ 16357:9f2ca855fa44 legacy-trunk
Enforce two illegal import statements that were outlawed in the
reference manual but not checked: Names bound by import statemants may
not occur in global statements in the same scope. The from ... import *
form may only occur in a module scope.
I guess these changes could break code, but the reference manual
warned about them.
Several other small changes
If a variable is declared global in the nearest enclosing scope of a
free variable, then treat it is a global in the nested scope too.
Get rid of com_mangle and symtable_mangle functions and call mangle
directly.
If errors occur during symtable table creation, return -1 from
symtable_build().
Do not increment st_errors in assignment to lambda, because exception
is not set.
Add extra argument to symtable_assign(); the argument, flag, is ORed
with DEF_LOCAL for each symtable_add_def() call.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Tue, 30 Jan 2001 01:24:43 +0000 |
| parents | 4306107b1395 |
| children |
| rev | line source |
|---|---|
| 3589 | 1 |
|
3621
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
2 /* Return the compiler identification, if possible. */ |
|
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
3 |
|
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
4 #include "Python.h" |
| 3589 | 5 |
| 6 #ifndef COMPILER | |
|
3621
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
7 |
| 2896 | 8 #ifdef __GNUC__ |
|
14410
4306107b1395
The GCC version is loooooooooong; put it on a new line.
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
9 #define COMPILER "\n[GCC " __VERSION__ "]" |
| 2896 | 10 #endif |
|
3621
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
11 |
| 3589 | 12 #endif /* !COMPILER */ |
| 2896 | 13 |
| 14 #ifndef COMPILER | |
|
3621
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
15 |
| 2896 | 16 #ifdef __cplusplus |
| 17 #define COMPILER "[C++]" | |
| 18 #else | |
| 19 #define COMPILER "[C]" | |
| 20 #endif | |
|
3621
f158edccc72c
grand renaming; added copyright to some files
Guido van Rossum <guido@python.org>
parents:
3589
diff
changeset
|
21 |
| 3589 | 22 #endif /* !COMPILER */ |
| 2896 | 23 |
|
5860
728a083242a2
Make it return a _const_ char*.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
24 const char * |
|
13658
f79434ee41fa
Mass ANSIfication of function definitions. Doesn't cover all 'extern'
Thomas Wouters <thomas@python.org>
parents:
13256
diff
changeset
|
25 Py_GetCompiler(void) |
| 2896 | 26 { |
| 27 return COMPILER; | |
| 28 } |
