diff options
author | David Walter Seikel | 2012-02-03 13:20:48 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-03 13:20:48 +1000 |
commit | ef0f7b7843110c329a2ff0906729d3e616d86b75 (patch) | |
tree | 0062ca7878707823161c42afb87e13891b738cd3 /LuaSL/src/LuaSL_compile.c | |
parent | Half arsed Lua crement implementation. (diff) | |
download | SledjHamr-ef0f7b7843110c329a2ff0906729d3e616d86b75.zip SledjHamr-ef0f7b7843110c329a2ff0906729d3e616d86b75.tar.gz SledjHamr-ef0f7b7843110c329a2ff0906729d3e616d86b75.tar.bz2 SledjHamr-ef0f7b7843110c329a2ff0906729d3e616d86b75.tar.xz |
Lua locals.
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 7457f0c..2ae8dca 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -1094,6 +1094,8 @@ LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identi | |||
1094 | assignment->right = expr; | 1094 | assignment->right = expr; |
1095 | if (type) | 1095 | if (type) |
1096 | { | 1096 | { |
1097 | if (compiler->currentBlock) | ||
1098 | type->flags |= MF_LOCAL; | ||
1097 | identifier->basicType = type->basicType; | 1099 | identifier->basicType = type->basicType; |
1098 | result->value.basicType = type->basicType; | 1100 | result->value.basicType = type->basicType; |
1099 | result->value.toKen = type->toKen; // This is the LSL_TYPE_* toKen instead of the LSL_* toKen. Not sure if that's a problem. | 1101 | result->value.toKen = type->toKen; // This is the LSL_TYPE_* toKen instead of the LSL_* toKen. Not sure if that's a problem. |
@@ -1523,7 +1525,11 @@ static void outputLeaf(FILE *file, outputMode mode, LSL_Leaf *leaf) | |||
1523 | if (OM_LUA == mode) | 1525 | if (OM_LUA == mode) |
1524 | { | 1526 | { |
1525 | if (LSL_TYPE & leaf->toKen->flags) | 1527 | if (LSL_TYPE & leaf->toKen->flags) |
1528 | { | ||
1529 | if (MF_LOCAL & leaf->flags) | ||
1530 | fprintf(file, " local "); | ||
1526 | fprintf(file, " --[[%s]] ", leaf->toKen->toKen); | 1531 | fprintf(file, " --[[%s]] ", leaf->toKen->toKen); |
1532 | } | ||
1527 | else if (LSL_CONCATENATE == leaf->toKen->type) | 1533 | else if (LSL_CONCATENATE == leaf->toKen->type) |
1528 | fprintf(file, " .. "); | 1534 | fprintf(file, " .. "); |
1529 | else | 1535 | else |