Permalink
Browse files

construct fields in the right order (closes #15517)

Patch from Taihyun Hwang.
  • Loading branch information...
benjaminp committed Aug 1, 2012
1 parent 83c8fdc commit 5d0353738fa9747cabd4785d8cfa80ca6374d5cb
Showing with 3 additions and 9 deletions.
  1. +1 −1 Misc/ACKS
  2. +2 −8 Parser/asdl.py
View
@@ -476,6 +476,7 @@ Michael Hudson
Jim Hugunin
Greg Humphreys
Eric Huss
Taihyun Hwang
Jeremy Hylton
Gerhard Häring
Fredrik Håård
@@ -1174,4 +1175,3 @@ Uwe Zessin
Kai Zhu
Tarek Ziadé
Peter Åstrand
View
@@ -156,15 +156,11 @@ def p_type_2(self, info):
if id.value != "attributes":
raise ASDLSyntaxError(id.lineno,
msg="expected attributes, found %s" % id)
if attributes:
attributes.reverse()
return Sum(sum, attributes)
def p_product(self, info):
" product ::= ( fields ) "
_0, fields, _1 = info
# XXX can't I just construct things in the right order?
fields.reverse()
return Product(fields)
def p_sum_0(self, constructor):
@@ -188,17 +184,15 @@ def p_constructor_0(self, id):
def p_constructor_1(self, info):
" constructor ::= Id ( fields ) "
id, _0, fields, _1 = info
# XXX can't I just construct things in the right order?
fields.reverse()
return Constructor(id, fields)
def p_fields_0(self, field):
" fields ::= field "
return [field[0]]
def p_fields_1(self, info):
" fields ::= field , fields "
field, _, fields = info
" fields ::= fields , field "
fields, _, field = info
return fields + [field]
def p_field_0(self, type_):

0 comments on commit 5d03537

Please sign in to comment.