Skip to content

Commit 5df0494

Browse files
committed
Fix #2
1 parent bfc9a01 commit 5df0494

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pseudo_python/ast_translator.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ def _translate_call(self, func, args, keywords, starargs=None, kwargs=None, loca
330330
initial_args = args[:]
331331
args = []
332332
if starargs: # python3.4
333-
initial_args.append(ast.Started(ast.starargs))
333+
initial_args.append(ast.Starred(starargs, None))
334334

335335
for arg in initial_args:
336-
if isinstance(arg, ast.Starred):
337-
many_arg = self._translate_node(arg)
336+
if isinstance(arg, ast.Starred):
337+
many_arg = self._translate_node(arg.value)
338338
if isinstance(many_arg['pseudo_type'], list) and many_arg['pseudo_type'][0] == 'Tuple':
339339
args += [{
340340
'type': 'index',
@@ -343,7 +343,7 @@ def _translate_call(self, func, args, keywords, starargs=None, kwargs=None, loca
343343
'pseudo_type': t
344344
}
345345
for j, t
346-
in enumerate(many_arg['pseudo_type'][1:])]
346+
in enumerate(many_arg['pseudo_type'][1:])]
347347

348348
else:
349349
raise translation_error("pseudo-python supports <call>(..*args) only for Tuple *args, because otherwise it doesn't know the exact arg count at compile time",
@@ -707,8 +707,8 @@ def _translate_binop(self, op, left, right, location):
707707
elements = right_node['elements']
708708
else:
709709
elements = [{
710-
'type': 'index',
711-
'sequence': right_node,
710+
'type': 'index',
711+
'sequence': right_node,
712712
'index': {
713713
'value': j,
714714
'pseudo_type': 'Int',
@@ -717,7 +717,7 @@ def _translate_binop(self, op, left, right, location):
717717
'pseudo_type': right_node['pseudo_type'][j + 1] if right_node['pseudo_type'][0] == 'Tuple' else right_node['pseudo_type'][1]
718718
}
719719
for j
720-
in range(count)]
720+
in range(count)]
721721
else:
722722
elements = [right_node]
723723

@@ -741,7 +741,7 @@ def _translate_binop(self, op, left, right, location):
741741
raise type_check_error('%s expects an int',
742742
location, self.lines[location[0]],
743743
wrong_type=elements[j]['pseudo_type'])
744-
words.append({'type': 'interpolation_placeholder', 'value': elements[j], 'pseudo_type': elements[j]['pseudo_type'], 'index': j})
744+
words.append({'type': 'interpolation_placeholder', 'value': elements[j], 'pseudo_type': elements[j]['pseudo_type'], 'index': j})
745745
words.append({'type': 'interpolation_literal', 'value': left_node['value'][v:], 'pseudo_type': 'String'})
746746

747747
return {
@@ -1303,7 +1303,7 @@ def _translate_subscript(self, value, slice, ctx, location):
13031303
'function': 'index',
13041304
'args': [z],
13051305
'pseudo_type': 'String'
1306-
}
1306+
}
13071307
result = {
13081308
'type': 'index',
13091309
'sequence': value_node,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='pseudo-python',
5-
version='0.2.8',
5+
version='0.2.10',
66
description='a python3 to pseudo compiler',
77
author='Alexander Ivanov',
88
author_email='alehander42@gmail.com',

0 commit comments

Comments
 (0)