aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 14:19:11 +1000
committerDavid Walter Seikel2012-01-17 14:19:11 +1000
commitcc4246d0d99b0e77e714638187347a5bc05e68f7 (patch)
treeb054f0604e044b28bbc5787dad9f711ae78b293f /LuaSL
parentOnly need one of each in the value union. (diff)
downloadSledjHamr-cc4246d0d99b0e77e714638187347a5bc05e68f7.zip
SledjHamr-cc4246d0d99b0e77e714638187347a5bc05e68f7.tar.gz
SledjHamr-cc4246d0d99b0e77e714638187347a5bc05e68f7.tar.bz2
SledjHamr-cc4246d0d99b0e77e714638187347a5bc05e68f7.tar.xz
And now we can combine two functions, since they are identical.
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_compile.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 3a9a6c4..9ebda0f 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -10,12 +10,11 @@ static LSL_Leaf *evaluateStatementToken(LSL_Leaf *content, LSL_Leaf *left, LSL_L
10static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content); 10static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content);
11static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content); 11static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content);
12static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content); 12static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content);
13static void outputParameterToken(FILE *file, outputMode mode, LSL_Leaf *content); 13static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content);
14static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content); 14static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content);
15static void outputParenthesisToken(FILE *file, outputMode mode, LSL_Leaf *content); 15static void outputParenthesisToken(FILE *file, outputMode mode, LSL_Leaf *content);
16static void outputStateToken(FILE *file, outputMode mode, LSL_Leaf *content); 16static void outputStateToken(FILE *file, outputMode mode, LSL_Leaf *content);
17static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content); 17static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content);
18static void outputVariableToken(FILE *file, outputMode mode, LSL_Leaf *content);
19 18
20LSL_Token LSL_Tokens[] = 19LSL_Token LSL_Tokens[] =
21{ 20{
@@ -98,7 +97,7 @@ LSL_Token LSL_Tokens[] =
98 {LSL_TYPE_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL}, 97 {LSL_TYPE_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL},
99 98
100 // Then the rest of the syntax tokens. 99 // Then the rest of the syntax tokens.
101 {LSL_IDENTIFIER, ST_NONE, "identifier", LSL_NONE, outputVariableToken, NULL}, 100 {LSL_IDENTIFIER, ST_NONE, "identifier", LSL_NONE, outputIdentifierToken, NULL},
102 101
103 {LSL_LABEL, ST_NONE, "@", LSL_NONE, NULL, NULL}, 102 {LSL_LABEL, ST_NONE, "@", LSL_NONE, NULL, NULL},
104 103
@@ -115,7 +114,7 @@ LSL_Token LSL_Tokens[] =
115 114
116 {LSL_BLOCK_CLOSE, ST_NONE, "}", LSL_NONE, NULL, NULL}, 115 {LSL_BLOCK_CLOSE, ST_NONE, "}", LSL_NONE, NULL, NULL},
117 {LSL_BLOCK_OPEN, ST_NONE, "{", LSL_NONE, NULL, NULL}, 116 {LSL_BLOCK_OPEN, ST_NONE, "{", LSL_NONE, NULL, NULL},
118 {LSL_PARAMETER, ST_NONE, "parameter", LSL_NONE, outputParameterToken, NULL}, 117 {LSL_PARAMETER, ST_NONE, "parameter", LSL_NONE, outputIdentifierToken, NULL},
119 {LSL_PARAMETER_LIST, ST_NONE, "plist", LSL_NONE, outputParameterListToken, NULL}, 118 {LSL_PARAMETER_LIST, ST_NONE, "plist", LSL_NONE, outputParameterListToken, NULL},
120 {LSL_FUNCTION, ST_NONE, "function", LSL_NONE, outputFunctionToken, NULL}, 119 {LSL_FUNCTION, ST_NONE, "function", LSL_NONE, outputFunctionToken, NULL},
121 {LSL_STATE, ST_NONE, "state", LSL_NONE, outputStateToken, NULL}, 120 {LSL_STATE, ST_NONE, "state", LSL_NONE, outputStateToken, NULL},
@@ -819,7 +818,7 @@ static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content)
819 fprintf(file, "%d", content->value.integerValue); 818 fprintf(file, "%d", content->value.integerValue);
820} 819}
821 820
822static void outputParameterToken(FILE *file, outputMode mode, LSL_Leaf *content) 821static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content)
823{ 822{
824 if (content) 823 if (content)
825 fprintf(file, "%s", content->value.identifierValue->name); 824 fprintf(file, "%s", content->value.identifierValue->name);
@@ -863,12 +862,6 @@ static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content)
863 } 862 }
864} 863}
865 864
866static void outputVariableToken(FILE *file, outputMode mode, LSL_Leaf *content)
867{
868 if (content)
869 fprintf(file, "%s", content->value.identifierValue->name);
870}
871
872static void doneParsing(LuaSL_compiler *compiler) 865static void doneParsing(LuaSL_compiler *compiler)
873{ 866{
874 gameGlobals *game = compiler->game; 867 gameGlobals *game = compiler->game;