adapap / OWScript

Python-like scripting language which transpiles into Overwatch Workshop script rulesets.
MIT License
37 stars 2 forks source link

Binary operations with function parameters cause unintended recursion #7

Closed adapap closed 5 years ago

adapap commented 5 years ago

Creating a binary expression such as with +, *, or ^ as an argument passed into a function results in a recursive lookup, creating a chain of expressions in the output. Example

%funcb(a)
    funca(a + Up)
%funca(a)
    Msg(Everyone, a)
//funcb(<1,2,3>)

The value of a is evaluated to a + Up in funca rather than <1, 2, 3> + Up. This results in a chain of Add(..., 1) expressions.