diff options
author | David Walter Seikel | 2012-01-22 14:32:54 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-22 14:32:54 +1000 |
commit | c4acee1580c5a11442a69c314ba4bc0243baf273 (patch) | |
tree | ccdb078a84654d39912706421c7245147b930e49 /LuaSL | |
parent | Disable the diff itself, until I think I'm ready for it. (diff) | |
download | SledjHamr-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.c | 15 |
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 | |||
10 | static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content); | 10 | static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content); |
11 | static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content); | 11 | static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content); |
12 | static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content); | 12 | static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content); |
13 | static void outputFunctionCallToken(FILE *file, outputMode mode, LSL_Leaf *content); | ||
13 | static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content); | 14 | static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content); |
14 | static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content); | 15 | static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content); |
15 | static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content); | 16 | static 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 | ||
1105 | static 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 | |||
1104 | static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content) | 1117 | static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content) |
1105 | { | 1118 | { |
1106 | if (content) | 1119 | if (content) |