aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 21:16:37 +1000
committerDavid Walter Seikel2012-01-17 21:16:37 +1000
commit2bc8fe5303bbdef220d38761656fdaa397499f76 (patch)
tree48b82e3f5b0e975cd3d7e2e7ff46bb56f6294bb2
parentMove some comments to be more useful. (diff)
downloadSledjHamr-2bc8fe5303bbdef220d38761656fdaa397499f76.zip
SledjHamr-2bc8fe5303bbdef220d38761656fdaa397499f76.tar.gz
SledjHamr-2bc8fe5303bbdef220d38761656fdaa397499f76.tar.bz2
SledjHamr-2bc8fe5303bbdef220d38761656fdaa397499f76.tar.xz
Fix up negate, and bool_not integer.
-rw-r--r--LuaSL/src/LuaSL_compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index e1875c6..11860ad 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -131,8 +131,8 @@ allowedTypes allowed[] =
131 {OT_nothing, "nothing", (ST_NONE)}, // 131 {OT_nothing, "nothing", (ST_NONE)}, //
132 132
133 {OT_bool, "boolean", (ST_BOOL_NOT)}, // bool ! 133 {OT_bool, "boolean", (ST_BOOL_NOT)}, // bool !
134 {OT_integer, "integer", (ST_BIT_NOT | ST_NEGATE)}, // int - ~ 134 {OT_integer, "integer", (ST_BOOL_NOT | ST_BIT_NOT | ST_NEGATE)}, // int ! - ~
135 {OT_float, "float", (ST_NONE)}, // float - 135 {OT_float, "float", (ST_BOOL_NOT)}, // float ! -
136 {OT_key, "key", (ST_NONE)}, // 136 {OT_key, "key", (ST_NONE)}, //
137 {OT_list, "list", (ST_NONE)}, // 137 {OT_list, "list", (ST_NONE)}, //
138 {OT_rotation, "rotation", (ST_NONE)}, // 138 {OT_rotation, "rotation", (ST_NONE)}, //
@@ -260,6 +260,10 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
260 lval->left = left; 260 lval->left = left;
261 lval->right = right; 261 lval->right = right;
262 262
263 // Convert subtract to negate if needed.
264 if ((NULL == left) && (LSL_SUBTRACT == lval->token->type))
265 lval->token = tokens[LSL_NEGATION - lowestToken];
266
263 // Try to figure out what type of operation this is. 267 // Try to figure out what type of operation this is.
264 if (NULL == left) 268 if (NULL == left)
265 lType = OT_nothing; 269 lType = OT_nothing;