From c4acee1580c5a11442a69c314ba4bc0243baf273 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Jan 2012 14:32:54 +1000 Subject: Output function calls. --- LuaSL/src/LuaSL_compile.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content); static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content); static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content); +static void outputFunctionCallToken(FILE *file, outputMode mode, LSL_Leaf *content); static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content); static void outputIdentifierToken(FILE *file, outputMode mode, LSL_Leaf *content); static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *content); @@ -114,7 +115,7 @@ LSL_Token LSL_Tokens[] = {LSL_TYPE_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL}, // Then the rest of the syntax tokens. - {LSL_FUNCTION_CALL, ST_NONE, "funccall", LSL_NONE, NULL, NULL}, + {LSL_FUNCTION_CALL, ST_NONE, "funccall", LSL_NONE, outputFunctionCallToken, NULL}, {LSL_IDENTIFIER, ST_NONE, "identifier", LSL_NONE, outputIdentifierToken, NULL}, {LSL_LABEL, ST_NONE, "@", LSL_NONE, NULL, NULL}, @@ -1101,6 +1102,18 @@ static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content) } } +static void outputFunctionCallToken(FILE *file, outputMode mode, LSL_Leaf *content) +{ + if (content) + { + LSL_FunctionCall *call = content->value.functionCallValue; + LSL_Function *func = call->function; + fprintf(file, "%s(", func->name); + // TODO - print params here. + fprintf(file, ")"); + } +} + static void outputIntegerToken(FILE *file, outputMode mode, LSL_Leaf *content) { if (content) -- cgit v1.1