aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-22 14:32:54 +1000
committerDavid Walter Seikel2012-01-22 14:32:54 +1000
commitc4acee1580c5a11442a69c314ba4bc0243baf273 (patch)
treeccdb078a84654d39912706421c7245147b930e49 /LuaSL
parentDisable the diff itself, until I think I'm ready for it. (diff)
downloadSledjHamr-c4acee1580c5a11442a69c314ba4bc0243baf273.zip
SledjHamr-c4acee1580c5a11442a69c314ba4bc0243baf273.tar.gz
SledjHamr-c4acee1580c5a11442a69c314ba4bc0243baf273.tar.bz2
SledjHamr-c4acee1580c5a11442a69c314ba4bc0243baf273.tar.xz
Output function calls.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_compile.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index d78a5bc..c4af1b6 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -10,6 +10,7 @@ static LSL_Leaf *evaluateStatementToken(LSL_Leaf *content, LSL_Leaf *left, LSL_L
10static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content); 10static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content);
11static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content); 11static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content);
12static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content); 12static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content);
13static void outputFunctionCallToken(FILE *file, outputMode mode, LSL_Leaf *content);
13static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content); 14static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content);
14static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content); 15static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content);
15static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content); 16static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content);
@@ -114,7 +115,7 @@ LSL_Token LSL_Tokens[] =
114 {LSL_TYPE_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL}, 115 {LSL_TYPE_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL},
115 116
116 // Then the rest of the syntax tokens. 117 // Then the rest of the syntax tokens.
117 {LSL_FUNCTION_CALL, ST_NONE, "funccall", LSL_NONE, NULL, NULL}, 118 {LSL_FUNCTION_CALL, ST_NONE, "funccall", LSL_NONE, outputFunctionCallToken, NULL},
118 {LSL_IDENTIFIER, ST_NONE, "identifier", LSL_NONE, outputIdentifierToken, NULL}, 119 {LSL_IDENTIFIER, ST_NONE, "identifier", LSL_NONE, outputIdentifierToken, NULL},
119 120
120 {LSL_LABEL, ST_NONE, "@", LSL_NONE, NULL, NULL}, 121 {LSL_LABEL, ST_NONE, "@", LSL_NONE, NULL, NULL},
@@ -1101,6 +1102,18 @@ static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content)
1101 } 1102 }
1102} 1103}
1103 1104
1105static void outputFunctionCallToken(FILE *file, outputMode mode, LSL_Leaf *content)
1106{
1107 if (content)
1108 {
1109 LSL_FunctionCall *call = content->value.functionCallValue;
1110 LSL_Function *func = call->function;
1111 fprintf(file, "%s(", func->name);
1112 // TODO - print params here.
1113 fprintf(file, ")");
1114 }
1115}
1116
1104static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content) 1117static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content)
1105{ 1118{
1106 if (content) 1119 if (content)