@@ -104,7 +104,7 @@ def find_main(self):
104104 mtds = []
105105 for c in self .clss :
106106 m = utils .extract_nodes ([MethodDeclaration ], c )
107- mtds .extend ([m for m in m if m .name == u'main' ])
107+ mtds .extend ([md for md in m if md .name == u'main' ])
108108 # do we care if main is static?
109109 # mtds.extend(filter(lambda m: td.isStatic(m) and m.name == u'main', m))
110110 lenn = len (mtds )
@@ -417,7 +417,7 @@ def gen_adt_constructor(mtd):
417417 typ = self .tltr .trans_ty (t )
418418 if isinstance (t , ReferenceType ) and t .arrayCount > 0 :
419419 typ = "Array_" + typ
420- if isinstance (t , ReferenceType ) and isinstance (t .typee , ClassOrInterfaceType ) and str (t .typee ) in [c .name for c in self .ax_clss ] and not self .is_ax_cls :
420+ if isinstance (t , ReferenceType ) and isinstance (t .typee , ClassOrInterfaceType ) and str (t .typee ) in [axc .name for axc in self .ax_clss ] and not self .is_ax_cls :
421421 typ = u'Object'
422422
423423 # if p.typee.name in p.symtab:
@@ -446,7 +446,7 @@ def gen_obj_constructor(mtd):
446446 ptyps = []
447447 ptyps_name = []
448448 for t in mtd_param_typs :
449- if isinstance (t , ReferenceType ) and isinstance (t .typee , ClassOrInterfaceType ) and str (t .typee ) in [c .name for c in self .ax_clss ] and not self .is_ax_cls :
449+ if isinstance (t , ReferenceType ) and isinstance (t .typee , ClassOrInterfaceType ) and str (t .typee ) in [axc .name for axc in self .ax_clss ] and not self .is_ax_cls :
450450 typ = u'Object'
451451 else :
452452 typ = self .tltr .trans_ty (t )
@@ -554,7 +554,7 @@ def gen_obj_constructor(mtd):
554554 buf .write (self .to_func (m ) + os .linesep )
555555
556556 # add bang functions for non-pure methods
557- for (m ,i ) in zip (adt_mtds , xrange (len (adt_mtds ))):
557+ for (m ,i ) in list ( zip (adt_mtds , xrange (len (adt_mtds ) ))):
558558 if not m .pure :
559559 if not m .constructor :
560560 mtd = cp .copy (m )
@@ -595,8 +595,8 @@ def gen_obj_constructor(mtd):
595595
596596 # updates n's symbol table to include parents symbol table items
597597 def cpy_sym (n , * args ):
598- if n .parentNode : n .symtab = dict (n .parentNode .symtab .items () +
599- n .symtab .items ())
598+ if n .parentNode : n .symtab = dict (list ( n .parentNode .symtab .items () ) +
599+ list ( n .symtab .items () ))
600600
601601 # Iterates through ADT constructors
602602 # Creates a dictionary of xforms using constructor names
@@ -813,14 +813,14 @@ def set_param_names(a, xf, adt_mtds, depth, xf_sym, name, xnames):
813813 # add a symbol table items to xf
814814 # this will give it access to the argument names of a
815815 # then updates xf children with
816- xf .symtab = dict (a .symtab .items () + xf .symtab .items ())
816+ xf .symtab = dict (list ( a .symtab .items ()) + list ( xf .symtab .items () ))
817817 for c in xf .childrenNodes :
818818 utils .walk (cpy_sym , c )
819819
820820 # NOT SURE WHY THIS IS NEEDED
821821 # without this it isn't able to resolve the string type of the
822822 # function. not sure why...
823- a .symtab = dict (xf .symtab .items () + a .symtab .items ())
823+ a .symtab = dict (list ( xf .symtab .items ()) + list ( a .symtab .items () ))
824824 for c in a .childrenNodes :
825825 utils .walk (cpy_sym , c )
826826
0 commit comments