@@ -412,7 +412,9 @@ def visit_Tuple(self, node):
412412 def visit_List (self , node ):
413413 node .returns_type = 'list'
414414 a = '[%s]' % ', ' .join (map (self .visit , node .elts ))
415- if self ._with_lua :
415+ if self ._with_ll :
416+ pass
417+ elif self ._with_lua :
416418 a = '__get__(list, "__call__")({}, {pointer:%s, length:%s})' % (a , len (node .elts ))
417419 return a
418420
@@ -1819,7 +1821,7 @@ def visit_Call(self, node):
18191821 # return '%s()' %name
18201822
18211823 ## special method calls ##
1822- if isinstance (node .func , ast .Attribute ) and node .func .attr in ('get' , 'keys' , 'values' , 'pop' , 'items' ):
1824+ if isinstance (node .func , ast .Attribute ) and node .func .attr in ('get' , 'keys' , 'values' , 'pop' , 'items' ) and not self . _with_lua :
18231825 anode = node .func
18241826 if anode .attr == 'get' :
18251827 if args :
@@ -1845,7 +1847,7 @@ def visit_Call(self, node):
18451847 else :
18461848 return '%s(%s)' % ( self .visit (node .func ), args )
18471849
1848- elif isinstance (node .func , ast .Attribute ) and isinstance (node .func .value , Name ) and node .func .value .id in self ._func_typedefs :
1850+ elif not self . _with_lua and not self . _with_dart and isinstance (node .func , ast .Attribute ) and isinstance (node .func .value , Name ) and node .func .value .id in self ._func_typedefs :
18491851 type = self ._func_typedefs [ node .func .value .id ]
18501852 if type == 'list' and node .func .attr == 'append' :
18511853 return '%s.push(%s)' % (node .func .value .id , self .visit (node .args [0 ]))
@@ -2454,7 +2456,10 @@ def visit_For(self, node):
24542456 if multi_target :
24552457 writer .write ('__mtarget__ = __next__()' )
24562458 for i ,elt in enumerate (multi_target ):
2457- writer .write ('%s = __mtarget__[%s]' % (elt ,i ))
2459+ if self ._with_lua :
2460+ writer .write ('%s = __mtarget__[...][%s]' % (elt ,i + 1 ))
2461+ else :
2462+ writer .write ('%s = __mtarget__[%s]' % (elt ,i ))
24582463 else :
24592464 writer .write ('%s = __next__()' % target .id )
24602465
0 commit comments