]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43244: Rename pycore_ast.h to pycore_ast_state.h (GH-24907)
authorVictor Stinner <vstinner@python.org>
Wed, 17 Mar 2021 22:11:03 +0000 (23:11 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Mar 2021 22:11:03 +0000 (23:11 +0100)
Include/internal/pycore_ast_state.h [moved from Include/internal/pycore_ast.h with 98% similarity]
Include/internal/pycore_interp.h
Makefile.pre.in
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
PCbuild/regen.vcxproj
Parser/asdl_c.py
Python/Python-ast.c

similarity index 98%
rename from Include/internal/pycore_ast.h
rename to Include/internal/pycore_ast_state.h
index 2d0c5fb97a7788cb0aeb597982d81173526d1e26..c5ae224217792031345262584037e7a5753abf9f 100644 (file)
@@ -1,7 +1,7 @@
 // File automatically generated by Parser/asdl_c.py.
 
-#ifndef Py_INTERNAL_AST_H
-#define Py_INTERNAL_AST_H
+#ifndef Py_INTERNAL_AST_STATE_H
+#define Py_INTERNAL_AST_STATE_H
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -240,5 +240,5 @@ struct ast_state {
 #ifdef __cplusplus
 }
 #endif
-#endif /* !Py_INTERNAL_AST_H */
+#endif /* !Py_INTERNAL_AST_STATE_H */
 
index ea770daedd8a1562609e199b79658621913595ed..1e4b3ff71eed49ccc1f60027b59a3797409206dc 100644 (file)
@@ -9,7 +9,7 @@ extern "C" {
 #endif
 
 #include "pycore_atomic.h"        // _Py_atomic_address
-#include "pycore_ast.h"           // struct ast_state
+#include "pycore_ast_state.h"     // struct ast_state
 #include "pycore_gil.h"           // struct _gil_runtime_state
 #include "pycore_gc.h"            // struct _gc_runtime_state
 #include "pycore_warnings.h"      // struct _warnings_runtime_state
index 50bd75c63a44dc4972e913251d54775d1ad6331d..ee93ab6ca150eab301e83c7a6386d443e6498fe4 100644 (file)
@@ -854,11 +854,11 @@ regen-ast:
        $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
                $(srcdir)/Parser/Python.asdl \
                -H $(srcdir)/Include/Python-ast.h.new \
-               -I $(srcdir)/Include/internal/pycore_ast.h.new \
+               -I $(srcdir)/Include/internal/pycore_ast_state.h.new \
                -C $(srcdir)/Python/Python-ast.c.new
 
        $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new
-       $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new
+       $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new
        $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new
 
 .PHONY: regen-opcode
@@ -1135,6 +1135,7 @@ PYTHON_HEADERS= \
                \
                $(srcdir)/Include/internal/pycore_abstract.h \
                $(srcdir)/Include/internal/pycore_accu.h \
+               $(srcdir)/Include/internal/pycore_ast_state.h \
                $(srcdir)/Include/internal/pycore_atomic.h \
                $(srcdir)/Include/internal/pycore_atomic_funcs.h \
                $(srcdir)/Include/internal/pycore_bitutils.h \
index 92355a886d91a753abb019db96c79988b22fc996..655c831ed5ff6ee5b3944a4cfbf5c8ab3e3c109a 100644 (file)
     <ClInclude Include="..\Include\import.h" />
     <ClInclude Include="..\Include\internal\pycore_abstract.h" />
     <ClInclude Include="..\Include\internal\pycore_accu.h" />
+    <ClInclude Include="..\Include\internal\pycore_ast_state.h" />
     <ClInclude Include="..\Include\internal\pycore_atomic.h" />
     <ClInclude Include="..\Include\internal\pycore_atomic_funcs.h" />
     <ClInclude Include="..\Include\internal\pycore_bitutils.h" />
index d0b69dbc5b64fd142278afc3a29fc4caafd52366..fba4af536fec9065bfe35726b91e5640e3d8d144 100644 (file)
     <ClInclude Include="..\Include\internal\pycore_accu.h">
       <Filter>Include\internal</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\internal\pycore_ast_state.h">
+      <Filter>Include\internal</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\internal\pycore_atomic.h">
       <Filter>Include\internal</Filter>
     </ClInclude>
index 936f5fd24646a5969d091643ae26db10a3a5c3f2..166468a93bfc3cc489654eb39ef792da67dc332a 100644 (file)
     </None>
     <None Include="..\Include\opcode.h">
     </None>
-    <None Include="..\Include\internal\pycore_ast.h">
+    <None Include="..\Include\internal\pycore_ast_state.h">
     </None>
     <None Include="..\Include\Python-ast.h">
     </None>
     <Warning Text="Pegen updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedParse)' != ''" />
   </Target>
   <Target Name="_RegenAST_H" AfterTargets="_RegenGrammar">
-    <!-- Regenerate Include/Python-ast.h, Python/Python-ast.c and Include/internal/pycore_ast.h using Parser/asdl_c.py -h -->
-    <Exec Command="&quot;$(PythonExe)&quot; &quot;$(PySourcePath)Parser\asdl_c.py&quot; &quot;$(PySourcePath)Parser\Python.asdl&quot; -H &quot;$(IntDir)Python-ast.h&quot; -C &quot;$(IntDir)Python-ast.c&quot; -I &quot;$(IntDir)pycore_ast.h&quot;" />
+    <!-- Regenerate Include/Python-ast.h, Python/Python-ast.c and Include/internal/pycore_ast_state.h using Parser/asdl_c.py -h -->
+    <Exec Command="&quot;$(PythonExe)&quot; &quot;$(PySourcePath)Parser\asdl_c.py&quot; &quot;$(PySourcePath)Parser\Python.asdl&quot; -H &quot;$(IntDir)Python-ast.h&quot; -C &quot;$(IntDir)Python-ast.c&quot; -I &quot;$(IntDir)pycore_ast_state.h&quot;" />
     <Copy SourceFiles="$(IntDir)Python-ast.h" DestinationFiles="$(PySourcePath)Include\Python-ast.h">
       <Output TaskParameter="CopiedFiles" ItemName="_UpdatedH" />
     </Copy>
     <Copy SourceFiles="$(IntDir)Python-ast.c" DestinationFiles="$(PySourcePath)Python\Python-ast.c">
       <Output TaskParameter="CopiedFiles" ItemName="_UpdatedC" />
     </Copy>
-    <Copy SourceFiles="$(IntDir)pycore_ast.h" DestinationFiles="$(PySourcePath)Include\internal\pycore_ast.h">
+    <Copy SourceFiles="$(IntDir)pycore_ast_state.h" DestinationFiles="$(PySourcePath)Include\internal\pycore_ast_state.h">
       <Output TaskParameter="CopiedFiles" ItemName="_UpdatedInternalH" />
     </Copy>
     <Warning Text="ASDL is updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' != '' and '@(_UpdatedC)' != '' and @(_UpdatedInternalH)'" />
       <Clean Include="$(IntDir)opcode.h" />
       <Clean Include="$(IntDir)Python-ast.c" />
       <Clean Include="$(IntDir)Python-ast.h" />
-      <Clean Include="$(IntDir)pycore_ast.h" />
+      <Clean Include="$(IntDir)pycore_ast_state.h" />
     </ItemGroup>
   </Target>
 </Project>
index 8c167bc79c779bf97eca45464c4794d6292ff0a0..e96f1f3504567c86361bd87fad9273abdfb367be 100755 (executable)
@@ -1429,7 +1429,7 @@ def generate_module_def(mod, f, internal_h):
 
     print(textwrap.dedent(f"""
         #ifdef Py_BUILD_CORE
-        #  include "pycore_ast.h"           // struct ast_state
+        #  include "pycore_ast_state.h"     // struct ast_state
         #  include "pycore_interp.h"        // _PyInterpreterState.ast
         #  include "pycore_pystate.h"       // _PyInterpreterState_GET()
         #else
@@ -1522,8 +1522,8 @@ def write_header(mod, f):
 
 def write_internal_h_header(mod, f):
     print(textwrap.dedent("""
-        #ifndef Py_INTERNAL_AST_H
-        #define Py_INTERNAL_AST_H
+        #ifndef Py_INTERNAL_AST_STATE_H
+        #define Py_INTERNAL_AST_STATE_H
         #ifdef __cplusplus
         extern "C" {
         #endif
@@ -1540,7 +1540,7 @@ def write_internal_h_footer(mod, f):
         #ifdef __cplusplus
         }
         #endif
-        #endif /* !Py_INTERNAL_AST_H */
+        #endif /* !Py_INTERNAL_AST_STATE_H */
     """), file=f)
 
 
index 439da8f2512ef22cb585c0ffd59f8c3514978eca..59acce7968407ab96d4582c1d082df1dea844e88 100644 (file)
@@ -6,7 +6,7 @@
 #include "Python.h"
 
 #ifdef Py_BUILD_CORE
-#  include "pycore_ast.h"           // struct ast_state
+#  include "pycore_ast_state.h"     // struct ast_state
 #  include "pycore_interp.h"        // _PyInterpreterState.ast
 #  include "pycore_pystate.h"       // _PyInterpreterState_GET()
 #else