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
f9efabb6
Kaydet (Commit)
f9efabb6
authored
Tem 23, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
3k-warn about parser's "ast" aliases.
üst
c6ad7940
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
parser.rst
Doc/library/parser.rst
+1
-0
NEWS
Misc/NEWS
+2
-0
parsermodule.c
Modules/parsermodule.c
+37
-5
No files found.
Doc/library/parser.rst
Dosyayı görüntüle @
f9efabb6
...
@@ -34,6 +34,7 @@ the code forming the application. It is also faster.
...
@@ -34,6 +34,7 @@ the code forming the application. It is also faster.
replaced by "ast"; this is a legacy from the time when there was no other
replaced by "ast"; this is a legacy from the time when there was no other
AST and has nothing to do with the AST found in Python 2.5. This is also the
AST and has nothing to do with the AST found in Python 2.5. This is also the
reason for the functions' keyword arguments being called *ast*, not *st*.
reason for the functions' keyword arguments being called *ast*, not *st*.
The "ast" functions will be removed in Python 3.0.
There are a few things to note about this module which are important to making
There are a few things to note about this module which are important to making
use of the data structures created. This is not a tutorial on editing the parse
use of the data structures created. This is not a tutorial on editing the parse
...
...
Misc/NEWS
Dosyayı görüntüle @
f9efabb6
...
@@ -26,6 +26,8 @@ Core and Builtins
...
@@ -26,6 +26,8 @@ Core and Builtins
Library
Library
-------
-------
- Deprecate the "ast" parser function aliases.
- Issue #3120: On 64-bit Windows the subprocess module was truncating handles.
- Issue #3120: On 64-bit Windows the subprocess module was truncating handles.
- Issue #3303: Fix a crash in locale.strcoll() when calling it with
- Issue #3303: Fix a crash in locale.strcoll() when calling it with
...
...
Modules/parsermodule.c
Dosyayı görüntüle @
f9efabb6
...
@@ -324,6 +324,14 @@ parser_st2tuple(PyST_Object *self, PyObject *args, PyObject *kw)
...
@@ -324,6 +324,14 @@ parser_st2tuple(PyST_Object *self, PyObject *args, PyObject *kw)
return
(
res
);
return
(
res
);
}
}
static
PyObject
*
parser_ast2tuple
(
PyST_Object
*
self
,
PyObject
*
args
,
PyObject
*
kw
)
{
if
(
PyErr_WarnPy3k
(
"ast2tuple is removed in 3.x; use st2tuple"
,
1
)
<
0
)
return
NULL
;
return
parser_st2tuple
(
self
,
args
,
kw
);
}
/* parser_st2list(PyObject* self, PyObject* args, PyObject* kw)
/* parser_st2list(PyObject* self, PyObject* args, PyObject* kw)
*
*
...
@@ -367,6 +375,14 @@ parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw)
...
@@ -367,6 +375,14 @@ parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw)
return
(
res
);
return
(
res
);
}
}
static
PyObject
*
parser_ast2list
(
PyST_Object
*
self
,
PyObject
*
args
,
PyObject
*
kw
)
{
if
(
PyErr_WarnPy3k
(
"ast2list is removed in 3.x; use st2list"
,
1
)
<
0
)
return
NULL
;
return
parser_st2list
(
self
,
args
,
kw
);
}
/* parser_compilest(PyObject* self, PyObject* args)
/* parser_compilest(PyObject* self, PyObject* args)
*
*
...
@@ -396,6 +412,14 @@ parser_compilest(PyST_Object *self, PyObject *args, PyObject *kw)
...
@@ -396,6 +412,14 @@ parser_compilest(PyST_Object *self, PyObject *args, PyObject *kw)
return
(
res
);
return
(
res
);
}
}
static
PyObject
*
parser_compileast
(
PyST_Object
*
self
,
PyObject
*
args
,
PyObject
*
kw
)
{
if
(
PyErr_WarnPy3k
(
"compileast is removed in 3.x; use compilest"
,
1
)
<
0
)
return
NULL
;
return
parser_compilest
(
self
,
args
,
kw
);
}
/* PyObject* parser_isexpr(PyObject* self, PyObject* args)
/* PyObject* parser_isexpr(PyObject* self, PyObject* args)
* PyObject* parser_issuite(PyObject* self, PyObject* args)
* PyObject* parser_issuite(PyObject* self, PyObject* args)
...
@@ -634,6 +658,14 @@ parser_tuple2st(PyST_Object *self, PyObject *args, PyObject *kw)
...
@@ -634,6 +658,14 @@ parser_tuple2st(PyST_Object *self, PyObject *args, PyObject *kw)
return
st
;
return
st
;
}
}
static
PyObject
*
parser_tuple2ast
(
PyST_Object
*
self
,
PyObject
*
args
,
PyObject
*
kw
)
{
if
(
PyErr_WarnPy3k
(
"tuple2ast is removed in 3.x; use tuple2st"
,
1
)
<
0
)
return
NULL
;
return
parser_tuple2st
(
self
,
args
,
kw
);
}
/* node* build_node_children()
/* node* build_node_children()
*
*
...
@@ -3203,11 +3235,11 @@ parser__pickler(PyObject *self, PyObject *args)
...
@@ -3203,11 +3235,11 @@ parser__pickler(PyObject *self, PyObject *args)
* inheritance.
* inheritance.
*/
*/
static
PyMethodDef
parser_functions
[]
=
{
static
PyMethodDef
parser_functions
[]
=
{
{
"ast2tuple"
,
(
PyCFunction
)
parser_
st2tuple
,
PUBLIC_METHOD_TYPE
,
{
"ast2tuple"
,
(
PyCFunction
)
parser_
ast2tuple
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates a tuple-tree representation of an ST."
)},
PyDoc_STR
(
"Creates a tuple-tree representation of an ST."
)},
{
"ast2list"
,
(
PyCFunction
)
parser_
st2list
,
PUBLIC_METHOD_TYPE
,
{
"ast2list"
,
(
PyCFunction
)
parser_
ast2list
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates a list-tree representation of an ST."
)},
PyDoc_STR
(
"Creates a list-tree representation of an ST."
)},
{
"compileast"
,
(
PyCFunction
)
parser_compile
st
,
PUBLIC_METHOD_TYPE
,
{
"compileast"
,
(
PyCFunction
)
parser_compile
ast
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Compiles an ST object into a code object."
)},
PyDoc_STR
(
"Compiles an ST object into a code object."
)},
{
"compilest"
,
(
PyCFunction
)
parser_compilest
,
PUBLIC_METHOD_TYPE
,
{
"compilest"
,
(
PyCFunction
)
parser_compilest
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Compiles an ST object into a code object."
)},
PyDoc_STR
(
"Compiles an ST object into a code object."
)},
...
@@ -3219,7 +3251,7 @@ static PyMethodDef parser_functions[] = {
...
@@ -3219,7 +3251,7 @@ static PyMethodDef parser_functions[] = {
PyDoc_STR
(
"Determines if an ST object was created from a suite."
)},
PyDoc_STR
(
"Determines if an ST object was created from a suite."
)},
{
"suite"
,
(
PyCFunction
)
parser_suite
,
PUBLIC_METHOD_TYPE
,
{
"suite"
,
(
PyCFunction
)
parser_suite
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates an ST object from a suite."
)},
PyDoc_STR
(
"Creates an ST object from a suite."
)},
{
"sequence2ast"
,
(
PyCFunction
)
parser_tuple2
st
,
PUBLIC_METHOD_TYPE
,
{
"sequence2ast"
,
(
PyCFunction
)
parser_tuple2
ast
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
{
"sequence2st"
,
(
PyCFunction
)
parser_tuple2st
,
PUBLIC_METHOD_TYPE
,
{
"sequence2st"
,
(
PyCFunction
)
parser_tuple2st
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
...
@@ -3227,7 +3259,7 @@ static PyMethodDef parser_functions[] = {
...
@@ -3227,7 +3259,7 @@ static PyMethodDef parser_functions[] = {
PyDoc_STR
(
"Creates a tuple-tree representation of an ST."
)},
PyDoc_STR
(
"Creates a tuple-tree representation of an ST."
)},
{
"st2list"
,
(
PyCFunction
)
parser_st2list
,
PUBLIC_METHOD_TYPE
,
{
"st2list"
,
(
PyCFunction
)
parser_st2list
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates a list-tree representation of an ST."
)},
PyDoc_STR
(
"Creates a list-tree representation of an ST."
)},
{
"tuple2ast"
,
(
PyCFunction
)
parser_tuple2
st
,
PUBLIC_METHOD_TYPE
,
{
"tuple2ast"
,
(
PyCFunction
)
parser_tuple2
ast
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
{
"tuple2st"
,
(
PyCFunction
)
parser_tuple2st
,
PUBLIC_METHOD_TYPE
,
{
"tuple2st"
,
(
PyCFunction
)
parser_tuple2st
,
PUBLIC_METHOD_TYPE
,
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
PyDoc_STR
(
"Creates an ST object from a tree representation."
)},
...
...
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