aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-21 17:20:32 +1000
committerDavid Walter Seikel2012-01-21 17:20:32 +1000
commit6629a6b405c3d1f9364ab44a8afc8e899cc3714a (patch)
tree7bc2a8b2a50a16d3e1b3966ace7e08dd25e1c62f /LuaSL/src/LuaSL_compile.c
parentAdd more LSL constants and functions. (diff)
downloadSledjHamr-6629a6b405c3d1f9364ab44a8afc8e899cc3714a.zip
SledjHamr-6629a6b405c3d1f9364ab44a8afc8e899cc3714a.tar.gz
SledjHamr-6629a6b405c3d1f9364ab44a8afc8e899cc3714a.tar.bz2
SledjHamr-6629a6b405c3d1f9364ab44a8afc8e899cc3714a.tar.xz
The default state is a different syntax from the other states.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_compile.c12
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