@@ -104,7 +104,7 @@ def find_main(self):
104
104
mtds = []
105
105
for c in self .clss :
106
106
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' ])
108
108
# do we care if main is static?
109
109
# mtds.extend(filter(lambda m: td.isStatic(m) and m.name == u'main', m))
110
110
lenn = len (mtds )
@@ -417,7 +417,7 @@ def gen_adt_constructor(mtd):
417
417
typ = self .tltr .trans_ty (t )
418
418
if isinstance (t , ReferenceType ) and t .arrayCount > 0 :
419
419
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 :
421
421
typ = u'Object'
422
422
423
423
# if p.typee.name in p.symtab:
@@ -446,7 +446,7 @@ def gen_obj_constructor(mtd):
446
446
ptyps = []
447
447
ptyps_name = []
448
448
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 :
450
450
typ = u'Object'
451
451
else :
452
452
typ = self .tltr .trans_ty (t )
@@ -554,7 +554,7 @@ def gen_obj_constructor(mtd):
554
554
buf .write (self .to_func (m ) + os .linesep )
555
555
556
556
# 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 ) ))):
558
558
if not m .pure :
559
559
if not m .constructor :
560
560
mtd = cp .copy (m )
@@ -595,8 +595,8 @@ def gen_obj_constructor(mtd):
595
595
596
596
# updates n's symbol table to include parents symbol table items
597
597
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 () ))
600
600
601
601
# Iterates through ADT constructors
602
602
# 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):
813
813
# add a symbol table items to xf
814
814
# this will give it access to the argument names of a
815
815
# 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 () ))
817
817
for c in xf .childrenNodes :
818
818
utils .walk (cpy_sym , c )
819
819
820
820
# NOT SURE WHY THIS IS NEEDED
821
821
# without this it isn't able to resolve the string type of the
822
822
# 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 () ))
824
824
for c in a .childrenNodes :
825
825
utils .walk (cpy_sym , c )
826
826
0 commit comments