diff options
Diffstat (limited to '')
-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 |