diff options
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 7744c60..6fc3ce1 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -135,6 +135,7 @@ LSL_Token LSL_Tokens[] = | |||
135 | {LSL_PARAMETER, ST_NONE, "parameter", LSL_NONE, outputIdentifierToken, NULL}, | 135 | {LSL_PARAMETER, ST_NONE, "parameter", LSL_NONE, outputIdentifierToken, NULL}, |
136 | {LSL_PARAMETER_LIST, ST_NONE, "plist", LSL_NONE, outputParameterListToken, NULL}, | 136 | {LSL_PARAMETER_LIST, ST_NONE, "plist", LSL_NONE, outputParameterListToken, NULL}, |
137 | {LSL_FUNCTION, ST_NONE, "function", LSL_NONE, outputFunctionToken, NULL}, | 137 | {LSL_FUNCTION, ST_NONE, "function", LSL_NONE, outputFunctionToken, NULL}, |
138 | {LSL_DEFAULT, ST_NONE, "default", LSL_NONE, outputStateToken, NULL}, | ||
138 | {LSL_STATE, ST_NONE, "state", LSL_NONE, outputStateToken, NULL}, | 139 | {LSL_STATE, ST_NONE, "state", LSL_NONE, outputStateToken, NULL}, |
139 | {LSL_SCRIPT, ST_NONE, "", LSL_NONE, NULL, NULL}, | 140 | {LSL_SCRIPT, ST_NONE, "", LSL_NONE, NULL, NULL}, |
140 | 141 | ||
@@ -1105,8 +1106,15 @@ static void outputStateToken(FILE *file, outputMode mode, LSL_Leaf *content) | |||
1105 | { | 1106 | { |
1106 | LSL_State *state = content->value.stateValue; | 1107 | LSL_State *state = content->value.stateValue; |
1107 | 1108 | ||
1108 | fprintf(file, "%s", state->name); | 1109 | if (state) |
1109 | outputLeaf(file, mode, state->block); | 1110 | { |
1111 | if (0 == strcmp(state->name, "default")) | ||
1112 | fprintf(file, "%s\n", state->name); | ||
1113 | else | ||
1114 | fprintf(file, "state %s\n", state->name); | ||
1115 | outputLeaf(file, mode, state->block); | ||
1116 | fprintf(file, "\n"); | ||
1117 | } | ||
1110 | } | 1118 | } |
1111 | } | 1119 | } |
1112 | 1120 | ||