diff options
-rw-r--r-- | LuaSL/src/LuaSL_LSL_tree.h | 3 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h index 3e80f50..9f1aaee 100644 --- a/LuaSL/src/LuaSL_LSL_tree.h +++ b/LuaSL/src/LuaSL_LSL_tree.h | |||
@@ -149,7 +149,8 @@ typedef enum | |||
149 | typedef enum | 149 | typedef enum |
150 | { | 150 | { |
151 | MF_NONE = 0, | 151 | MF_NONE = 0, |
152 | MF_LOCAL = 1 | 152 | MF_LOCAL = 1, |
153 | MF_NOASSIGN = 2 | ||
153 | } miscFlags; | 154 | } miscFlags; |
154 | 155 | ||
155 | struct _allowedTypes | 156 | struct _allowedTypes |
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 | } |