diff options
author | David Walter Seikel | 2012-01-21 22:34:46 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-21 22:34:46 +1000 |
commit | f136a1af33253a4149c4a3a366845727f36d6567 (patch) | |
tree | 91632ebd52ff1525056a8820fcdb547c0c43d940 | |
parent | Forgot a script to rename. (diff) | |
download | SledjHamr-f136a1af33253a4149c4a3a366845727f36d6567.zip SledjHamr-f136a1af33253a4149c4a3a366845727f36d6567.tar.gz SledjHamr-f136a1af33253a4149c4a3a366845727f36d6567.tar.bz2 SledjHamr-f136a1af33253a4149c4a3a366845727f36d6567.tar.xz |
Disable some of the output, and compile every script in the test sim.
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 13 | ||||
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 34 |
2 files changed, 35 insertions, 12 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index cb64038..18deda3 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -1015,9 +1015,9 @@ static LSL_Leaf *evaluateStatementToken(LSL_Leaf *content, LSL_Leaf *left, LSL_L | |||
1015 | { | 1015 | { |
1016 | switch (result->basicType) | 1016 | switch (result->basicType) |
1017 | { | 1017 | { |
1018 | case OT_float : printf("\nResult is the float %g.\n", result->value.floatValue); break; | 1018 | case OT_float : printf("Result is the float %g.\n", result->value.floatValue); break; |
1019 | case OT_integer : printf("\nResult is the integer %d.\n", result->value.integerValue); break; | 1019 | case OT_integer : printf("Result is the integer %d.\n", result->value.integerValue); break; |
1020 | default : printf("\nResult of an unknown type [%d] %d!\n", result->basicType, result->value.integerValue); break; | 1020 | default : /*printf("\nResult of an unknown type [%d] %d!\n", result->basicType, result->value.integerValue);*/ break; |
1021 | } | 1021 | } |
1022 | free(result); | 1022 | free(result); |
1023 | result = NULL; | 1023 | result = NULL; |
@@ -1184,10 +1184,10 @@ static void doneParsing(LuaSL_compiler *compiler) | |||
1184 | char outName[PATH_MAX]; | 1184 | char outName[PATH_MAX]; |
1185 | char luaName[PATH_MAX]; | 1185 | char luaName[PATH_MAX]; |
1186 | 1186 | ||
1187 | outputLeaf(stdout, OM_LSL, compiler->ast); | 1187 | // outputLeaf(stdout, OM_LSL, compiler->ast); |
1188 | printf("\n"); | 1188 | // printf("\n"); |
1189 | evaluateLeaf(compiler->ast, NULL, NULL); | 1189 | evaluateLeaf(compiler->ast, NULL, NULL); |
1190 | printf("\n"); | 1190 | // printf("\n"); |
1191 | 1191 | ||
1192 | strcpy(outName, compiler->fileName); | 1192 | strcpy(outName, compiler->fileName); |
1193 | strcat(outName, "2"); | 1193 | strcat(outName, "2"); |
@@ -1285,6 +1285,7 @@ Eina_Bool compileLSL(gameGlobals *game, char *script, boolean doConstants) | |||
1285 | PE("Error opening file %s.", compiler.fileName); | 1285 | PE("Error opening file %s.", compiler.fileName); |
1286 | return FALSE; | 1286 | return FALSE; |
1287 | } | 1287 | } |
1288 | printf("\n"); | ||
1288 | PI("Opened %s.", compiler.fileName); | 1289 | PI("Opened %s.", compiler.fileName); |
1289 | compiler.ast = NULL; | 1290 | compiler.ast = NULL; |
1290 | compiler.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); | 1291 | compiler.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); |
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index e0d2629..2fb8512 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -66,6 +66,25 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
66 | ecore_main_loop_quit(); | 66 | ecore_main_loop_quit(); |
67 | } | 67 | } |
68 | 68 | ||
69 | void dirList_cb(const char *name, const char *path, void *data) | ||
70 | { | ||
71 | gameGlobals *game = data; | ||
72 | char buf[PATH_MAX]; | ||
73 | char *ext = rindex(name, '.'); | ||
74 | |||
75 | if (ext) | ||
76 | { | ||
77 | if (0 == strcmp(ext, ".lsl")) | ||
78 | { | ||
79 | snprintf(buf, sizeof(buf), "%s/%s", path, name); | ||
80 | if (compileLSL(game, buf, FALSE)) | ||
81 | PI("Against all odds, the compile of %s worked! lol", buf); | ||
82 | else | ||
83 | PE("The compile of %s failed!", buf); | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | |||
69 | int | 88 | int |
70 | main(int argc, char **argv) | 89 | main(int argc, char **argv) |
71 | { | 90 | { |
@@ -160,14 +179,17 @@ main(int argc, char **argv) | |||
160 | ecore_evas_callback_delete_request_set(game.ee, _on_delete); | 179 | ecore_evas_callback_delete_request_set(game.ee, _on_delete); |
161 | edje_object_signal_callback_add(game.edje, "*", "game_*", _edje_signal_cb, &game); | 180 | edje_object_signal_callback_add(game.edje, "*", "game_*", _edje_signal_cb, &game); |
162 | 181 | ||
163 | // Setup for the compler. | 182 | // Setup for the compiler. |
164 | compilerSetup(&game); | 183 | compilerSetup(&game); |
184 | |||
185 | snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); | ||
186 | eina_file_dir_list(buf, EINA_TRUE, dirList_cb, &game); | ||
165 | // snprintf(buf, sizeof(buf), "%s/Test sim/objects/onefang's test bed/~run", PACKAGE_DATA_DIR); | 187 | // snprintf(buf, sizeof(buf), "%s/Test sim/objects/onefang's test bed/~run", PACKAGE_DATA_DIR); |
166 | snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); | 188 | // snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); |
167 | if (compileLSL(&game, buf, FALSE)) | 189 | // if (compileLSL(&game, buf, FALSE)) |
168 | PIm("Against all odds, the compile of %s worked! lol", buf); | 190 | // PIm("Against all odds, the compile of %s worked! lol", buf); |
169 | else | 191 | // else |
170 | PEm("The compile of %s failed!", buf); | 192 | // PEm("The compile of %s failed!", buf); |
171 | snprintf(buf, sizeof(buf), "%s/test.lsl", PACKAGE_DATA_DIR); | 193 | snprintf(buf, sizeof(buf), "%s/test.lsl", PACKAGE_DATA_DIR); |
172 | compileLSL(&game, buf, FALSE); | 194 | compileLSL(&game, buf, FALSE); |
173 | 195 | ||