diff options
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 2ae8dca..c06afc4 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -1092,6 +1092,8 @@ LSL_Leaf *addVariable(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identi | |||
1092 | identifier->right = assignment; | 1092 | identifier->right = assignment; |
1093 | if (assignment) | 1093 | if (assignment) |
1094 | assignment->right = expr; | 1094 | assignment->right = expr; |
1095 | else | ||
1096 | identifier->flags |= MF_NOASSIGN; | ||
1095 | if (type) | 1097 | if (type) |
1096 | { | 1098 | { |
1097 | if (compiler->currentBlock) | 1099 | if (compiler->currentBlock) |
@@ -2025,6 +2027,12 @@ static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content | |||
2025 | fprintf(file, ".%s", content->value.identifierValue->sub); | 2027 | fprintf(file, ".%s", content->value.identifierValue->sub); |
2026 | } | 2028 | } |
2027 | else | 2029 | else |
2030 | if ((LSL_VARIABLE == content->toKen->type) && (MF_NOASSIGN & content->flags)) | ||
2031 | { | ||
2032 | outputText(file, &(content->value.identifierValue->name), !(LSL_NOIGNORE & content->toKen->flags)); | ||
2033 | fprintf(file, " = nil"); | ||
2034 | } | ||
2035 | else | ||
2028 | outputText(file, &(content->value.identifierValue->name), !(LSL_NOIGNORE & content->toKen->flags)); | 2036 | outputText(file, &(content->value.identifierValue->name), !(LSL_NOIGNORE & content->toKen->flags)); |
2029 | } | 2037 | } |
2030 | } | 2038 | } |