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
bf7255ff
Kaydet (Commit)
bf7255ff
authored
Haz 10, 2005
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Minor tweaks, to allow some (out-of-tree, until successful) tinkering
with C++.
üst
52a14c3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
bgenGenerator.py
Tools/bgen/bgen/bgenGenerator.py
+5
-5
bgenObjectDefinition.py
Tools/bgen/bgen/bgenObjectDefinition.py
+10
-6
No files found.
Tools/bgen/bgen/bgenGenerator.py
Dosyayı görüntüle @
bf7255ff
...
...
@@ -18,6 +18,7 @@ class BaseFunctionGenerator:
def
__init__
(
self
,
name
,
condition
=
None
):
if
DEBUG
:
print
"<--"
,
name
self
.
name
=
name
self
.
callname
=
name
self
.
prefix
=
name
self
.
objecttype
=
"PyObject"
# Type of _self argument to function
self
.
condition
=
condition
...
...
@@ -202,7 +203,7 @@ class FunctionGenerator(BaseFunctionGenerator):
def
callit
(
self
):
args
=
""
if
self
.
rv
:
s
=
"
%
s =
%
s("
%
(
self
.
rv
.
name
,
self
.
name
)
s
=
"
%
s =
%
s("
%
(
self
.
rv
.
name
,
self
.
call
name
)
else
:
s
=
"
%
s("
%
self
.
name
sep
=
",
\n
"
+
' '
*
len
(
s
)
...
...
@@ -214,9 +215,9 @@ class FunctionGenerator(BaseFunctionGenerator):
args
=
args
+
s
if
self
.
rv
:
Output
(
"
%
s =
%
s(
%
s);"
,
self
.
rv
.
name
,
self
.
name
,
args
)
self
.
rv
.
name
,
self
.
call
name
,
args
)
else
:
Output
(
"
%
s(
%
s);"
,
self
.
name
,
args
)
Output
(
"
%
s(
%
s);"
,
self
.
call
name
,
args
)
def
checkit
(
self
):
for
arg
in
self
.
argumentList
:
...
...
@@ -255,8 +256,7 @@ class MethodGenerator(FunctionGenerator):
self
.
itself
=
Variable
(
t0
,
"_self->ob_itself"
,
SelfMode
)
self
.
argumentList
.
append
(
self
.
itself
)
FunctionGenerator
.
parseArgumentList
(
self
,
args
)
def
_test
():
void
=
None
eggs
=
FunctionGenerator
(
void
,
"eggs"
,
...
...
Tools/bgen/bgen/bgenObjectDefinition.py
Dosyayı görüntüle @
bf7255ff
...
...
@@ -44,12 +44,8 @@ class ObjectDefinition(GeneratorGroup):
OutHeader2
(
"Object type "
+
self
.
name
)
sf
=
self
.
static
and
"static "
Output
(
"
%
sPyTypeObject
%
s;"
,
sf
,
self
.
typename
)
Output
()
Output
(
"#define
%
s_Check(x) ((x)->ob_type == &
%
s || PyObject_TypeCheck((x), &
%
s))"
,
self
.
prefix
,
self
.
typename
,
self
.
typename
)
Output
()
self
.
outputCheck
()
Output
(
"typedef struct
%
s {"
,
self
.
objecttype
)
IndentLevel
()
Output
(
"PyObject_HEAD"
)
...
...
@@ -84,6 +80,14 @@ class ObjectDefinition(GeneratorGroup):
OutHeader2
(
"End object type "
+
self
.
name
)
def
outputCheck
(
self
):
sf
=
self
.
static
and
"static "
Output
(
"
%
sPyTypeObject
%
s;"
,
sf
,
self
.
typename
)
Output
()
Output
(
"#define
%
s_Check(x) ((x)->ob_type == &
%
s || PyObject_TypeCheck((x), &
%
s))"
,
self
.
prefix
,
self
.
typename
,
self
.
typename
)
Output
()
def
outputMethodChain
(
self
):
Output
(
"
%
sPyMethodChain
%
s_chain = {
%
s_methods,
%
s };"
,
self
.
static
,
self
.
prefix
,
self
.
prefix
,
self
.
basechain
)
...
...
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