Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2d0876e

Browse files
Move it to _PyRuntime.parser.
1 parent432fa46 commit2d0876e

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

‎Include/internal/pycore_global_objects.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11-
#include"pycore_ast.h"// struct _expr
1211
#include"pycore_gc.h"// PyGC_Head
1312
#include"pycore_global_strings.h"// struct _Py_global_strings
1413
#include"pycore_hamt.h"// PyHamtNode_Bitmap
@@ -61,8 +60,6 @@ struct _Py_static_objects {
6160
_PyGC_Head_UNUSED_hamt_bitmap_node_empty_gc_not_used;
6261
PyHamtNode_Bitmaphamt_bitmap_node_empty;
6362
_PyContextTokenMissingcontext_token_missing;
64-
65-
struct_exprparser_dummy_name;
6663
}singletons;
6764
};
6865

‎Include/internal/pycore_parser.h‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern "C" {
99
#endif
1010

1111

12-
#include"pycore_ast.h"//Name_kind
12+
#include"pycore_ast.h"//struct _expr
1313
#include"pycore_global_strings.h"// _Py_DECLARE_STR()
1414
#include"pycore_pyarena.h"// PyArena
1515

@@ -24,20 +24,21 @@ struct _parser_runtime_state {
2424
#else
2525
int_not_used;
2626
#endif
27+
struct_exprdummy_name;
2728
};
2829

29-
3030
_Py_DECLARE_STR(empty,"")
31-
32-
#define_Py_parser_dummy_name_INIT \
31+
#define_parser_runtime_state_INIT \
3332
{ \
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+
}, \
4142
}
4243

4344
externstruct_mod*_PyParser_ASTFromString(

‎Include/internal/pycore_runtime_init.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern "C" {
3333
until _PyInterpreterState_Enable() is called. */ \
3434
.next_id = -1, \
3535
}, \
36+
.parser = _parser_runtime_state_INIT, \
3637
.imports = { \
3738
.lock = { \
3839
.mutex = NULL, \
@@ -91,7 +92,6 @@ extern "C" {
9192
.context_token_missing = { \
9293
.ob_base = _PyObject_IMMORTAL_INIT(&_PyContextTokenMissing_Type), \
9394
}, \
94-
.parser_dummy_name = _Py_parser_dummy_name_INIT, \
9595
}, \
9696
}, \
9797
._main_interpreter = _PyInterpreterState_INIT, \

‎Parser/action_helpers.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
#include"pegen.h"
44
#include"string_parser.h"
55
#include"pycore_runtime.h"// _PyRuntime
6-
#include"pycore_global_objects.h"// _Py_SINGLETON()
76

87
void*
98
_PyPegen_dummy_name(Parser*p, ...)
109
{
11-
return&_Py_SINGLETON(parser_dummy_name);
10+
return&_PyRuntime.parser.dummy_name;
1211
}
1312

1413
/* Creates a single-element asdl_seq* that contains a */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp