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
14acf5f4
Kaydet (Commit)
14acf5f4
authored
Agu 05, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.
üst
cedef652
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
38 deletions
+44
-38
Grammar
Grammar/Grammar
+1
-1
test_grammar.py
Lib/test/test_grammar.py
+2
-0
NEWS
Misc/NEWS
+2
-0
parsermodule.c
Modules/parsermodule.c
+6
-3
ast.c
Python/ast.c
+32
-33
graminit.c
Python/graminit.c
+1
-1
No files found.
Grammar/Grammar
Dosyayı görüntüle @
14acf5f4
...
@@ -137,7 +137,7 @@ arglist: argument (',' argument)* [',']
...
@@ -137,7 +137,7 @@ arglist: argument (',' argument)* [',']
argument: ( test [comp_for] |
argument: ( test [comp_for] |
test '=' test |
test '=' test |
'**' test |
'**' test |
star_expr
)
'*' test
)
comp_iter: comp_for | comp_if
comp_iter: comp_for | comp_if
comp_for: 'for' exprlist 'in' or_test [comp_iter]
comp_for: 'for' exprlist 'in' or_test [comp_iter]
...
...
Lib/test/test_grammar.py
Dosyayı görüntüle @
14acf5f4
...
@@ -205,6 +205,8 @@ class GrammarTests(unittest.TestCase):
...
@@ -205,6 +205,8 @@ class GrammarTests(unittest.TestCase):
d01
()
d01
()
d01
(
1
)
d01
(
1
)
d01
(
*
(
1
,))
d01
(
*
(
1
,))
d01
(
*
[]
or
[
2
])
d01
(
*
()
or
(),
*
{}
and
(),
**
()
or
{})
d01
(
**
{
'a'
:
2
})
d01
(
**
{
'a'
:
2
})
d01
(
**
{
'a'
:
2
}
or
{})
d01
(
**
{
'a'
:
2
}
or
{})
def
d11
(
a
,
b
=
1
):
pass
def
d11
(
a
,
b
=
1
):
pass
...
...
Misc/NEWS
Dosyayı görüntüle @
14acf5f4
...
@@ -40,6 +40,8 @@ Library
...
@@ -40,6 +40,8 @@ Library
- Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
- Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
Patch by Gustavo J. A. M. Carneiro.
Patch by Gustavo J. A. M. Carneiro.
- Issue #24791: Fix grammar regression for call syntax: '
g
(*
a
or
b
)
'.
Documentation
Documentation
-------------
-------------
...
...
Modules/parsermodule.c
Dosyayı görüntüle @
14acf5f4
...
@@ -2859,8 +2859,8 @@ validate_arglist(node *tree)
...
@@ -2859,8 +2859,8 @@ validate_arglist(node *tree)
/* argument: ( test [comp_for] |
/* argument: ( test [comp_for] |
* test '=' test |
* test '=' test |
* '**'
expr
|
* '**'
test
|
*
star_expr
)
*
'*' test
)
*/
*/
static
int
static
int
validate_argument
(
node
*
tree
)
validate_argument
(
node
*
tree
)
...
@@ -2873,8 +2873,11 @@ validate_argument(node *tree)
...
@@ -2873,8 +2873,11 @@ validate_argument(node *tree)
if
(
TYPE
(
CHILD
(
tree
,
0
))
==
DOUBLESTAR
)
{
if
(
TYPE
(
CHILD
(
tree
,
0
))
==
DOUBLESTAR
)
{
res
=
validate_test
(
CHILD
(
tree
,
1
));
res
=
validate_test
(
CHILD
(
tree
,
1
));
}
}
else
if
(
TYPE
(
CHILD
(
tree
,
0
))
==
STAR
)
{
res
=
validate_test
(
CHILD
(
tree
,
1
));
}
else
if
(
nch
==
1
)
{
else
if
(
nch
==
1
)
{
res
=
validate_test
_or_star_expr
(
CHILD
(
tree
,
0
));
res
=
validate_test
(
CHILD
(
tree
,
0
));
}
}
else
if
(
nch
==
2
)
{
else
if
(
nch
==
2
)
{
res
=
(
validate_test
(
CHILD
(
tree
,
0
))
res
=
(
validate_test
(
CHILD
(
tree
,
0
))
...
...
Python/ast.c
Dosyayı görüntüle @
14acf5f4
...
@@ -2664,45 +2664,44 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
...
@@ -2664,45 +2664,44 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
expr_ty
e
;
expr_ty
e
;
node
*
chch
=
CHILD
(
ch
,
0
);
node
*
chch
=
CHILD
(
ch
,
0
);
if
(
NCH
(
ch
)
==
1
)
{
if
(
NCH
(
ch
)
==
1
)
{
if
(
TYPE
(
chch
)
==
star_expr
)
{
/* a positional argument */
/* an iterable argument unpacking */
if
(
nkeywords
)
{
expr_ty
starred
;
if
(
ndoublestars
)
{
if
(
ndoublestars
)
{
ast_error
(
c
,
chch
,
ast_error
(
c
,
chch
,
"
iterable argument unpacking
follows "
"
positional argument
follows "
"keyword argument unpacking"
);
"keyword argument unpacking"
);
return
NULL
;
}
}
e
=
ast_for_expr
(
c
,
CHILD
(
chch
,
1
));
else
{
if
(
!
e
)
ast_error
(
c
,
chch
,
return
NULL
;
"positional argument follows "
starred
=
Starred
(
e
,
Load
,
LINENO
(
chch
),
"keyword argument"
);
chch
->
n_col_offset
,
c
->
c_arena
);
if
(
!
starred
)
return
NULL
;
asdl_seq_SET
(
args
,
nargs
++
,
starred
);
}
else
{
/* a positional argument */
if
(
nkeywords
)
{
if
(
ndoublestars
)
{
ast_error
(
c
,
chch
,
"positional argument follows "
"keyword argument unpacking"
);
}
else
{
ast_error
(
c
,
chch
,
"positional argument follows "
"keyword argument"
);
}
return
NULL
;
}
}
e
=
ast_for_expr
(
c
,
chch
);
return
NULL
;
if
(
!
e
)
return
NULL
;
asdl_seq_SET
(
args
,
nargs
++
,
e
);
}
}
e
=
ast_for_expr
(
c
,
chch
);
if
(
!
e
)
return
NULL
;
asdl_seq_SET
(
args
,
nargs
++
,
e
);
}
else
if
(
TYPE
(
chch
)
==
STAR
)
{
/* an iterable argument unpacking */
expr_ty
starred
;
if
(
ndoublestars
)
{
ast_error
(
c
,
chch
,
"iterable argument unpacking follows "
"keyword argument unpacking"
);
return
NULL
;
}
e
=
ast_for_expr
(
c
,
CHILD
(
ch
,
1
));
if
(
!
e
)
return
NULL
;
starred
=
Starred
(
e
,
Load
,
LINENO
(
chch
),
chch
->
n_col_offset
,
c
->
c_arena
);
if
(
!
starred
)
return
NULL
;
asdl_seq_SET
(
args
,
nargs
++
,
starred
);
}
}
else
if
(
TYPE
(
chch
)
==
DOUBLESTAR
)
{
else
if
(
TYPE
(
chch
)
==
DOUBLESTAR
)
{
/* a keyword argument unpacking */
/* a keyword argument unpacking */
...
...
Python/graminit.c
Dosyayı görüntüle @
14acf5f4
...
@@ -1744,7 +1744,7 @@ static state states_77[3] = {
...
@@ -1744,7 +1744,7 @@ static state states_77[3] = {
static
arc
arcs_78_0
[
3
]
=
{
static
arc
arcs_78_0
[
3
]
=
{
{
26
,
1
},
{
26
,
1
},
{
34
,
2
},
{
34
,
2
},
{
50
,
3
},
{
33
,
2
},
};
};
static
arc
arcs_78_1
[
3
]
=
{
static
arc
arcs_78_1
[
3
]
=
{
{
164
,
3
},
{
164
,
3
},
...
...
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