Skip to content

Commit 1558601

Browse files
author
hartsantler
committed
glsl backend: fixed local variable typedefs, fixed function calls.
1 parent 0fd7010 commit 1558601

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

pythonjs/python_to_pythonjs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@ def visit_Call(self, node):
19961996
else:
19971997
raise SyntaxError( self.format_error(node) )
19981998

1999-
elif self._with_ll or name == 'inline':
1999+
elif self._with_ll or name == 'inline' or self._with_glsl:
20002000
args = [self.visit(arg) for arg in node.args]
20012001
if node.keywords:
20022002
args.extend( [self.visit(x.value) for x in node.keywords] )

pythonjs/pythonjs.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ def visit_FunctionDef(self, node):
174174
self._function_stack.pop()
175175
return buffer
176176

177+
def _visit_call_helper_var_glsl(self, node):
178+
lines = []
179+
for key in node.keywords:
180+
lines.append( '%s %s' %(key.value.id, key.arg))
181+
182+
return ';'.join(lines)
183+
184+
177185
def _visit_function(self, node):
178186
glsl = False
179187
args_typedefs = {}
@@ -356,7 +364,10 @@ def visit_Call(self, node):
356364
return self._visit_call_helper_JSObject( node )
357365

358366
elif name == 'var':
359-
return self._visit_call_helper_var( node )
367+
if self._glsl:
368+
return self._visit_call_helper_var_glsl( node )
369+
else:
370+
return self._visit_call_helper_var( node )
360371

361372
elif name == 'JSArray':
362373
return self._visit_call_helper_JSArray( node )

0 commit comments

Comments
 (0)