@@ -102,7 +102,7 @@ def find_main(self):
102
102
mtds = []
103
103
for c in self .clss :
104
104
m = utils .extract_nodes ([MethodDeclaration ], c )
105
- mtds .extend ([m for m in m if m .name == u'main' ])
105
+ mtds .extend ([md for md in m if md .name == u'main' ])
106
106
# do we care if main is static?
107
107
# mtds.extend(filter(lambda m: td.isStatic(m) and m.name == u'main', m))
108
108
lenn = len (mtds )
@@ -384,7 +384,7 @@ def gen_adt_constructor(mtd):
384
384
typ = self .tltr .trans_ty (t )
385
385
if isinstance (t , ReferenceType ) and t .arrayCount > 0 :
386
386
typ = "Array_" + typ
387
- 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 :
387
+ 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 :
388
388
typ = u'Object'
389
389
390
390
# if p.typee.name in p.symtab:
@@ -413,7 +413,7 @@ def gen_obj_constructor(mtd):
413
413
ptyps = []
414
414
ptyps_name = []
415
415
for t in mtd_param_typs :
416
- 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 :
416
+ 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 :
417
417
typ = u'Object'
418
418
else :
419
419
typ = self .tltr .trans_ty (t )
@@ -521,7 +521,7 @@ def gen_obj_constructor(mtd):
521
521
buf .write (self .to_func (m ) + os .linesep )
522
522
523
523
# add bang functions for non-pure methods
524
- for (m ,i ) in zip (adt_mtds , xrange (len (adt_mtds ))):
524
+ for (m ,i ) in list ( zip (adt_mtds , xrange (len (adt_mtds ) ))):
525
525
if not m .pure :
526
526
if not m .constructor :
527
527
mtd = cp .copy (m )
@@ -562,8 +562,8 @@ def gen_obj_constructor(mtd):
562
562
563
563
# updates n's symbol table to include parents symbol table items
564
564
def cpy_sym (n , * args ):
565
- if n .parentNode : n .symtab = dict (n .parentNode .symtab .items () +
566
- n .symtab .items ())
565
+ if n .parentNode : n .symtab = dict (list ( n .parentNode .symtab .items () ) +
566
+ list ( n .symtab .items () ))
567
567
568
568
# Iterates through ADT constructors
569
569
# Creates a dictionary of xforms using constructor names
@@ -780,14 +780,14 @@ def set_param_names(a, xf, adt_mtds, depth, xf_sym, name, xnames):
780
780
# add a symbol table items to xf
781
781
# this will give it access to the argument names of a
782
782
# then updates xf children with
783
- xf .symtab = dict (a .symtab .items () + xf .symtab .items ())
783
+ xf .symtab = dict (list ( a .symtab .items ()) + list ( xf .symtab .items () ))
784
784
for c in xf .childrenNodes :
785
785
utils .walk (cpy_sym , c )
786
786
787
787
# NOT SURE WHY THIS IS NEEDED
788
788
# without this it isn't able to resolve the string type of the
789
789
# function. not sure why...
790
- a .symtab = dict (xf .symtab .items () + a .symtab .items ())
790
+ a .symtab = dict (list ( xf .symtab .items ()) + list ( a .symtab .items () ))
791
791
for c in a .childrenNodes :
792
792
utils .walk (cpy_sym , c )
793
793
0 commit comments