Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
481ae50c
Commit
481ae50c
authored
Jul 31, 2012
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
construct fields in the right order (closes #15517)
Patch from Taihyun Hwang.
parent
0efcf99c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
Misc/ACKS
Misc/ACKS
+1
-1
Parser/asdl.py
Parser/asdl.py
+2
-8
No files found.
Misc/ACKS
View file @
481ae50c
...
@@ -476,6 +476,7 @@ Michael Hudson
...
@@ -476,6 +476,7 @@ Michael Hudson
Jim Hugunin
Jim Hugunin
Greg Humphreys
Greg Humphreys
Eric Huss
Eric Huss
Taihyun Hwang
Jeremy Hylton
Jeremy Hylton
Gerhard Häring
Gerhard Häring
Fredrik Håård
Fredrik Håård
...
@@ -1174,4 +1175,3 @@ Uwe Zessin
...
@@ -1174,4 +1175,3 @@ Uwe Zessin
Kai Zhu
Kai Zhu
Tarek Ziadé
Tarek Ziadé
Peter Åstrand
Peter Åstrand
Parser/asdl.py
View file @
481ae50c
...
@@ -156,15 +156,11 @@ class ASDLParser(spark.GenericParser, object):
...
@@ -156,15 +156,11 @@ class ASDLParser(spark.GenericParser, object):
if
id
.
value
!=
"attributes"
:
if
id
.
value
!=
"attributes"
:
raise
ASDLSyntaxError
(
id
.
lineno
,
raise
ASDLSyntaxError
(
id
.
lineno
,
msg
=
"expected attributes, found %s"
%
id
)
msg
=
"expected attributes, found %s"
%
id
)
if
attributes
:
attributes
.
reverse
()
return
Sum
(
sum
,
attributes
)
return
Sum
(
sum
,
attributes
)
def
p_product
(
self
,
info
):
def
p_product
(
self
,
info
):
" product ::= ( fields ) "
" product ::= ( fields ) "
_0
,
fields
,
_1
=
info
_0
,
fields
,
_1
=
info
# XXX can't I just construct things in the right order?
fields
.
reverse
()
return
Product
(
fields
)
return
Product
(
fields
)
def
p_sum_0
(
self
,
constructor
):
def
p_sum_0
(
self
,
constructor
):
...
@@ -188,8 +184,6 @@ class ASDLParser(spark.GenericParser, object):
...
@@ -188,8 +184,6 @@ class ASDLParser(spark.GenericParser, object):
def
p_constructor_1
(
self
,
info
):
def
p_constructor_1
(
self
,
info
):
" constructor ::= Id ( fields ) "
" constructor ::= Id ( fields ) "
id
,
_0
,
fields
,
_1
=
info
id
,
_0
,
fields
,
_1
=
info
# XXX can't I just construct things in the right order?
fields
.
reverse
()
return
Constructor
(
id
,
fields
)
return
Constructor
(
id
,
fields
)
def
p_fields_0
(
self
,
field
):
def
p_fields_0
(
self
,
field
):
...
@@ -197,8 +191,8 @@ class ASDLParser(spark.GenericParser, object):
...
@@ -197,8 +191,8 @@ class ASDLParser(spark.GenericParser, object):
return
[
field
[
0
]]
return
[
field
[
0
]]
def
p_fields_1
(
self
,
info
):
def
p_fields_1
(
self
,
info
):
" fields ::= field
, fields
"
" fields ::= field
s , field
"
field
,
_
,
fields
=
info
field
s
,
_
,
field
=
info
return
fields
+
[
field
]
return
fields
+
[
field
]
def
p_field_0
(
self
,
type_
):
def
p_field_0
(
self
,
type_
):
...
...
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