@@ -156,15 +156,11 @@ def p_type_2(self, info):
156156 if id .value != "attributes" :
157157 raise ASDLSyntaxError (id .lineno ,
158158 msg = "expected attributes, found %s" % id )
159- if attributes :
160- attributes .reverse ()
161159 return Sum (sum , attributes )
162160
163161 def p_product (self , info ):
164162 " product ::= ( fields ) "
165163 _0 , fields , _1 = info
166- # XXX can't I just construct things in the right order?
167- fields .reverse ()
168164 return Product (fields )
169165
170166 def p_sum_0 (self , constructor ):
@@ -188,17 +184,15 @@ def p_constructor_0(self, id):
188184 def p_constructor_1 (self , info ):
189185 " constructor ::= Id ( fields ) "
190186 id , _0 , fields , _1 = info
191- # XXX can't I just construct things in the right order?
192- fields .reverse ()
193187 return Constructor (id , fields )
194188
195189 def p_fields_0 (self , field ):
196190 " fields ::= field "
197191 return [field [0 ]]
198192
199193 def p_fields_1 (self , info ):
200- " fields ::= field , fields "
201- field , _ , fields = info
194+ " fields ::= fields , field "
195+ fields , _ , field = info
202196 return fields + [field ]
203197
204198 def p_field_0 (self , type_ ):
0 commit comments