Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
7580149b
Kaydet (Commit)
7580149b
authored
Nis 14, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1355883: Build Python-ast.c and Python-ast.h
independently. Fixes #1355883.
üst
969ef750
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
35 deletions
+40
-35
Makefile.pre.in
Makefile.pre.in
+10
-5
asdl_c.py
Parser/asdl_c.py
+30
-30
No files found.
Makefile.pre.in
Dosyayı görüntüle @
7580149b
...
...
@@ -219,13 +219,15 @@ PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
##########################################################################
# AST
AST_H
=
$(srcdir)
/Include/Python-ast.h
AST_C
=
$(srcdir)
/Python/Python-ast.c
AST_H_DIR
=
$(srcdir)
/Include
AST_H
=
$(AST_H_DIR)
/Python-ast.h
AST_C_DIR
=
$(srcdir)
/Python
AST_C
=
$(AST_C_DIR)
/Python-ast.c
AST_ASDL
=
$(srcdir)
/Parser/Python.asdl
ASDLGEN_FILES
=
$(srcdir)
/Parser/asdl.py
$(srcdir)
/Parser/asdl_c.py
# XXX Note that a build now requires Python exist before the build starts
ASDLGEN
=
$(srcdir)
/Parser/asdl_c.py
-h
$(srcdir)
/Include
-c
$(srcdir)
/Python
ASDLGEN
=
$(srcdir)
/Parser/asdl_c.py
##########################################################################
# Python
...
...
@@ -465,9 +467,12 @@ Parser/metagrammar.o: $(srcdir)/Parser/metagrammar.c
Parser/tokenizer_pgen.o
:
$(srcdir)/Parser/tokenizer.c
$(AST_H)
$(AST_C)
:
$(AST_ASDL) $(ASDLGEN_FILES)
$(ASDLGEN)
$(AST_ASDL)
$(AST_H)
:
$(AST_ASDL) $(ASDLGEN_FILES)
$(ASDLGEN)
-h
$(AST_H_DIR)
$(AST_ASDL)
$(AST_C)
:
$(AST_ASDL) $(ASDLGEN_FILES)
$(ASDLGEN)
-c
$(AST_C_DIR)
$(AST_ASDL)
Python/compile.o Python/symtable.o
:
$(GRAMMAR_H) $(AST_H)
Python/getplatform.o
:
$(srcdir)/Python/getplatform.c
...
...
Parser/asdl_c.py
Dosyayı görüntüle @
7580149b
...
...
@@ -726,39 +726,35 @@ def main(srcfile):
sys
.
exit
(
1
)
if
INC_DIR
:
p
=
"
%
s/
%
s-ast.h"
%
(
INC_DIR
,
mod
.
name
)
else
:
p
=
"
%
s-ast.h"
%
mod
.
name
f
=
open
(
p
,
"wb"
)
print
>>
f
,
auto_gen_msg
print
>>
f
,
'#include "asdl.h"
\n
'
c
=
ChainOfVisitors
(
TypeDefVisitor
(
f
),
StructVisitor
(
f
),
PrototypeVisitor
(
f
),
)
c
.
visit
(
mod
)
print
>>
f
,
"PyObject* PyAST_mod2obj(mod_ty t);"
f
.
close
()
f
=
open
(
p
,
"wb"
)
print
>>
f
,
auto_gen_msg
print
>>
f
,
'#include "asdl.h"
\n
'
c
=
ChainOfVisitors
(
TypeDefVisitor
(
f
),
StructVisitor
(
f
),
PrototypeVisitor
(
f
),
)
c
.
visit
(
mod
)
print
>>
f
,
"PyObject* PyAST_mod2obj(mod_ty t);"
f
.
close
()
if
SRC_DIR
:
p
=
os
.
path
.
join
(
SRC_DIR
,
str
(
mod
.
name
)
+
"-ast.c"
)
else
:
p
=
"
%
s-ast.c"
%
mod
.
name
f
=
open
(
p
,
"wb"
)
print
>>
f
,
auto_gen_msg
print
>>
f
,
'#include "Python.h"'
print
>>
f
,
'#include "
%
s-ast.h"'
%
mod
.
name
print
>>
f
print
>>
f
,
"static PyTypeObject* AST_type;"
v
=
ChainOfVisitors
(
PyTypesDeclareVisitor
(
f
),
PyTypesVisitor
(
f
),
FunctionVisitor
(
f
),
ObjVisitor
(
f
),
ASTModuleVisitor
(
f
),
PartingShots
(
f
),
)
v
.
visit
(
mod
)
f
.
close
()
f
=
open
(
p
,
"wb"
)
print
>>
f
,
auto_gen_msg
print
>>
f
,
'#include "Python.h"'
print
>>
f
,
'#include "
%
s-ast.h"'
%
mod
.
name
print
>>
f
print
>>
f
,
"static PyTypeObject* AST_type;"
v
=
ChainOfVisitors
(
PyTypesDeclareVisitor
(
f
),
PyTypesVisitor
(
f
),
FunctionVisitor
(
f
),
ObjVisitor
(
f
),
ASTModuleVisitor
(
f
),
PartingShots
(
f
),
)
v
.
visit
(
mod
)
f
.
close
()
if
__name__
==
"__main__"
:
import
sys
...
...
@@ -767,6 +763,9 @@ if __name__ == "__main__":
INC_DIR
=
''
SRC_DIR
=
''
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
"h:c:"
)
if
len
(
opts
)
!=
1
:
print
"Must specify exactly one output file"
sys
.
exit
(
1
)
for
o
,
v
in
opts
:
if
o
==
'-h'
:
INC_DIR
=
v
...
...
@@ -774,4 +773,5 @@ if __name__ == "__main__":
SRC_DIR
=
v
if
len
(
args
)
!=
1
:
print
"Must specify single input file"
sys
.
exit
(
1
)
main
(
args
[
0
])
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment