Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(94767)

Side by Side Diff: Include/symtable.h

Issue 11619: On Windows, don't encode filenames in the import machinery
Patch Set: Created 5 years, 12 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Include/pythonrun.h ('k') | Include/warnings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef Py_LIMITED_API 1 #ifndef Py_LIMITED_API
2 #ifndef Py_SYMTABLE_H 2 #ifndef Py_SYMTABLE_H
3 #define Py_SYMTABLE_H 3 #define Py_SYMTABLE_H
4 4
5 #ifdef __cplusplus 5 #ifdef __cplusplus
6 extern "C" { 6 extern "C" {
7 #endif 7 #endif
8 8
9 /* XXX(ncoghlan): This is a weird mix of public names and interpreter internal 9 /* XXX(ncoghlan): This is a weird mix of public names and interpreter internal
10 * names. 10 * names.
11 */ 11 */
12 12
13 typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } 13 typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
14 _Py_block_ty; 14 _Py_block_ty;
15 15
16 struct _symtable_entry; 16 struct _symtable_entry;
17 17
18 struct symtable { 18 struct symtable {
19 const char *st_filename; /* name of file being compiled, 19 PyObject *st_filename; /* name of file being compiled,
20 decoded from the filesystem encoding */ 20 decoded from the filesystem encoding */
21 struct _symtable_entry *st_cur; /* current symbol table entry */ 21 struct _symtable_entry *st_cur; /* current symbol table entry */
22 struct _symtable_entry *st_top; /* symbol table entry for module */ 22 struct _symtable_entry *st_top; /* symbol table entry for module */
23 PyObject *st_blocks; /* dict: map AST node addresses 23 PyObject *st_blocks; /* dict: map AST node addresses
24 * to symbol table entries */ 24 * to symbol table entries */
25 PyObject *st_stack; /* list: stack of namespace info */ 25 PyObject *st_stack; /* list: stack of namespace info */
26 PyObject *st_global; /* borrowed ref to st_top->ste_symbols */ 26 PyObject *st_global; /* borrowed ref to st_top->ste_symbols */
27 int st_nblocks; /* number of blocks used. kept for 27 int st_nblocks; /* number of blocks used. kept for
28 consistency with the corresponding 28 consistency with the corresponding
29 compiler structure */ 29 compiler structure */
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 PyAPI_DATA(PyTypeObject) PySTEntry_Type; 67 PyAPI_DATA(PyTypeObject) PySTEntry_Type;
68 68
69 #define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type) 69 #define PySTEntry_Check(op) (Py_TYPE(op) == &PySTEntry_Type)
70 70
71 PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); 71 PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *);
72 72
73 PyAPI_FUNC(struct symtable *) PySymtable_Build( 73 PyAPI_FUNC(struct symtable *) PySymtable_Build(
74 mod_ty mod, 74 mod_ty mod,
75 const char *filename, /* decoded from the filesystem encoding */ 75 const char *filename, /* decoded from the filesystem encoding */
76 PyFutureFeatures *future);
77 PyAPI_FUNC(struct symtable *) PySymtable_BuildObject(
78 mod_ty mod,
79 PyObject *filename,
76 PyFutureFeatures *future); 80 PyFutureFeatures *future);
77 PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); 81 PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *);
78 82
79 PyAPI_FUNC(void) PySymtable_Free(struct symtable *); 83 PyAPI_FUNC(void) PySymtable_Free(struct symtable *);
80 84
81 /* Flags for def-use information */ 85 /* Flags for def-use information */
82 86
83 #define DEF_GLOBAL 1 /* global stmt */ 87 #define DEF_GLOBAL 1 /* global stmt */
84 #define DEF_LOCAL 2 /* assignment in code block */ 88 #define DEF_LOCAL 2 /* assignment in code block */
85 #define DEF_PARAM 2<<1 /* formal parameter */ 89 #define DEF_PARAM 2<<1 /* formal parameter */
(...skipping 23 matching lines...) Expand all
109 #define OPT_TOPLEVEL 2 /* top-level names, including eval and exec */ 113 #define OPT_TOPLEVEL 2 /* top-level names, including eval and exec */
110 114
111 #define GENERATOR 1 115 #define GENERATOR 1
112 #define GENERATOR_EXPRESSION 2 116 #define GENERATOR_EXPRESSION 2
113 117
114 #ifdef __cplusplus 118 #ifdef __cplusplus
115 } 119 }
116 #endif 120 #endif
117 #endif /* !Py_SYMTABLE_H */ 121 #endif /* !Py_SYMTABLE_H */
118 #endif /* Py_LIMITED_API */ 122 #endif /* Py_LIMITED_API */
OLDNEW
« no previous file with comments | « Include/pythonrun.h ('k') | Include/warnings.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+