File tree 4 files changed +14
-17
lines changed
4 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ extern "C" {
8
8
# error "this header requires Py_BUILD_CORE define"
9
9
#endif
10
10
11
- #include "pycore_ast.h" // struct _expr
12
11
#include "pycore_gc.h" // PyGC_Head
13
12
#include "pycore_global_strings.h" // struct _Py_global_strings
14
13
#include "pycore_hamt.h" // PyHamtNode_Bitmap
@@ -61,8 +60,6 @@ struct _Py_static_objects {
61
60
_PyGC_Head_UNUSED _hamt_bitmap_node_empty_gc_not_used ;
62
61
PyHamtNode_Bitmap hamt_bitmap_node_empty ;
63
62
_PyContextTokenMissing context_token_missing ;
64
-
65
- struct _expr parser_dummy_name ;
66
63
} singletons ;
67
64
};
68
65
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ extern "C" {
9
9
#endif
10
10
11
11
12
- #include "pycore_ast.h" // Name_kind
12
+ #include "pycore_ast.h" // struct _expr
13
13
#include "pycore_global_strings.h" // _Py_DECLARE_STR()
14
14
#include "pycore_pyarena.h" // PyArena
15
15
@@ -24,20 +24,21 @@ struct _parser_runtime_state {
24
24
#else
25
25
int _not_used ;
26
26
#endif
27
+ struct _expr dummy_name ;
27
28
};
28
29
29
-
30
30
_Py_DECLARE_STR (empty , "" )
31
-
32
- #define _Py_parser_dummy_name_INIT \
31
+ #define _parser_runtime_state_INIT \
33
32
{ \
34
- .kind = Name_kind, \
35
- .v.Name.id = &_Py_STR(empty), \
36
- .v.Name.ctx = Load, \
37
- .lineno = 1, \
38
- .col_offset = 0, \
39
- .end_lineno = 1, \
40
- .end_col_offset = 0, \
33
+ .dummy_name = { \
34
+ .kind = Name_kind, \
35
+ .v.Name.id = &_Py_STR(empty), \
36
+ .v.Name.ctx = Load, \
37
+ .lineno = 1, \
38
+ .col_offset = 0, \
39
+ .end_lineno = 1, \
40
+ .end_col_offset = 0, \
41
+ }, \
41
42
}
42
43
43
44
extern struct _mod * _PyParser_ASTFromString (
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ extern "C" {
33
33
until _PyInterpreterState_Enable() is called. */ \
34
34
.next_id = -1, \
35
35
}, \
36
+ .parser = _parser_runtime_state_INIT, \
36
37
.imports = { \
37
38
.lock = { \
38
39
.mutex = NULL, \
@@ -91,7 +92,6 @@ extern "C" {
91
92
.context_token_missing = { \
92
93
.ob_base = _PyObject_IMMORTAL_INIT(&_PyContextTokenMissing_Type), \
93
94
}, \
94
- .parser_dummy_name = _Py_parser_dummy_name_INIT, \
95
95
}, \
96
96
}, \
97
97
._main_interpreter = _PyInterpreterState_INIT, \
Original file line number Diff line number Diff line change 3
3
#include "pegen.h"
4
4
#include "string_parser.h"
5
5
#include "pycore_runtime.h" // _PyRuntime
6
- #include "pycore_global_objects.h" // _Py_SINGLETON()
7
6
8
7
void *
9
8
_PyPegen_dummy_name (Parser * p , ...)
10
9
{
11
- return & _Py_SINGLETON ( parser_dummy_name ) ;
10
+ return & _PyRuntime . parser . dummy_name ;
12
11
}
13
12
14
13
/* Creates a single-element asdl_seq* that contains a */
You can’t perform that action at this time.
0 commit comments