aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-31 15:44:13 +1000
committerDavid Walter Seikel2012-01-31 15:44:13 +1000
commit8fb26357f9fed5decc48aa5a7868688a3dd449fd (patch)
treea0f1227c600702983b26ce50f93b27a885f6b4ec /LuaSL/src/LuaSL_compile.c
parentFix a bunch of statement ignorables. (diff)
downloadSledjHamr-8fb26357f9fed5decc48aa5a7868688a3dd449fd.zip
SledjHamr-8fb26357f9fed5decc48aa5a7868688a3dd449fd.tar.gz
SledjHamr-8fb26357f9fed5decc48aa5a7868688a3dd449fd.tar.bz2
SledjHamr-8fb26357f9fed5decc48aa5a7868688a3dd449fd.tar.xz
Output string tokens.
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r--LuaSL/src/LuaSL_compile.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 00f41da..c01529a 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -17,6 +17,7 @@ static void outputParameterListToken(FILE *file, outputMode mode, LSL_Leaf *cont
17static void outputParenthesisToken(FILE *file, outputMode mode, LSL_Leaf *content); 17static void outputParenthesisToken(FILE *file, outputMode mode, LSL_Leaf *content);
18static void outputStateToken(FILE *file, outputMode mode, LSL_Leaf *content); 18static void outputStateToken(FILE *file, outputMode mode, LSL_Leaf *content);
19static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content); 19static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content);
20static void outputStringToken(FILE *file, outputMode mode, LSL_Leaf *content);
20 21
21LSL_Token LSL_Tokens[] = 22LSL_Token LSL_Tokens[] =
22{ 23{
@@ -99,10 +100,10 @@ LSL_Token LSL_Tokens[] =
99 // Types. 100 // Types.
100 {LSL_FLOAT, ST_NONE, "float", LSL_NONE, outputFloatToken, evaluateFloatToken}, 101 {LSL_FLOAT, ST_NONE, "float", LSL_NONE, outputFloatToken, evaluateFloatToken},
101 {LSL_INTEGER, ST_NONE, "integer", LSL_NONE, outputIntegerToken, evaluateIntegerToken}, 102 {LSL_INTEGER, ST_NONE, "integer", LSL_NONE, outputIntegerToken, evaluateIntegerToken},
102 {LSL_KEY, ST_NONE, "key", LSL_NONE, NULL, NULL}, 103 {LSL_KEY, ST_NONE, "key", LSL_NONE, outputStringToken, NULL},
103 {LSL_LIST, ST_NONE, "list", LSL_NONE, NULL, NULL}, 104 {LSL_LIST, ST_NONE, "list", LSL_NONE, NULL, NULL},
104 {LSL_ROTATION, ST_NONE, "rotation", LSL_NONE, NULL, NULL}, 105 {LSL_ROTATION, ST_NONE, "rotation", LSL_NONE, NULL, NULL},
105 {LSL_STRING, ST_NONE, "string", LSL_NONE, NULL, NULL}, 106 {LSL_STRING, ST_NONE, "string", LSL_NONE, outputStringToken, NULL},
106 {LSL_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL}, 107 {LSL_VECTOR, ST_NONE, "vector", LSL_NONE, NULL, NULL},
107 108
108 // Types names. 109 // Types names.
@@ -1460,6 +1461,12 @@ static void outputText(FILE *file, LSL_Text *text, boolean ignore)
1460 } 1461 }
1461} 1462}
1462 1463
1464static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content)
1465{
1466 if (content)
1467 outputRawBlock(file, mode, content->value.blockValue);
1468}
1469
1463static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content) 1470static void outputFloatToken(FILE *file, outputMode mode, LSL_Leaf *content)
1464{ 1471{
1465 if (content) 1472 if (content)
@@ -1560,10 +1567,10 @@ static void outputStatementToken(FILE *file, outputMode mode, LSL_Leaf *content)
1560 outputRawStatement(file, mode, content->value.statementValue); 1567 outputRawStatement(file, mode, content->value.statementValue);
1561} 1568}
1562 1569
1563static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content) 1570static void outputStringToken(FILE *file, outputMode mode, LSL_Leaf *content)
1564{ 1571{
1565 if (content) 1572 if (content)
1566 outputRawBlock(file, mode, content->value.blockValue); 1573 fprintf(file, "%s", content->value.stringValue); // The quotes are part of the string value already.
1567} 1574}
1568 1575
1569static boolean doneParsing(LuaSL_compiler *compiler) 1576static boolean doneParsing(LuaSL_compiler *compiler)