Fixed ternary operator.

This commit is contained in:
Bruce Hill 2017-10-05 15:00:01 -07:00
parent 7f9a08f3d6
commit 4ae64ef9e3

View File

@ -16,10 +16,10 @@ compile [%if_expr if %condition else %else_expr] to: ".."
#.. Note: this uses a function instead of (condition and if_expr or else_expr) #.. Note: this uses a function instead of (condition and if_expr or else_expr)
because that breaks if %if_expr is falsey. because that breaks if %if_expr is falsey.
|(function(nomsu, vars) |(function(nomsu, vars)
| if \(%condition) then; | if \(%condition as lua) then;
| return \(%if_expr); | return \(%if_expr as lua);
| else; | else;
| return \(%else_expr); | return \(%else_expr as lua);
| end; | end;
|end)(nomsu, vars) |end)(nomsu, vars)