diff options
author | David Walter Seikel | 2012-02-03 13:44:57 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-03 13:44:57 +1000 |
commit | 8025dd7110e12a0c450c49b3a03597a1dcea0da0 (patch) | |
tree | 0defbe65b523954ef03bbba1898550fd654bed5e /LuaSL | |
parent | Don't put extra comma at end of function parameter list, Lua don't lik them t... (diff) | |
download | SledjHamr-8025dd7110e12a0c450c49b3a03597a1dcea0da0.zip SledjHamr-8025dd7110e12a0c450c49b3a03597a1dcea0da0.tar.gz SledjHamr-8025dd7110e12a0c450c49b3a03597a1dcea0da0.tar.bz2 SledjHamr-8025dd7110e12a0c450c49b3a03597a1dcea0da0.tar.xz |
Actually Lua compile the result.
Diffstat (limited to 'LuaSL')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 90f001e..48803af 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -2155,6 +2155,7 @@ static boolean doneParsing(LuaSL_compiler *compiler) | |||
2155 | char buffer[PATH_MAX]; | 2155 | char buffer[PATH_MAX]; |
2156 | char outName[PATH_MAX]; | 2156 | char outName[PATH_MAX]; |
2157 | char luaName[PATH_MAX]; | 2157 | char luaName[PATH_MAX]; |
2158 | int count; | ||
2158 | 2159 | ||
2159 | // outputLeaf(stdout, OM_LSL, compiler->ast); | 2160 | // outputLeaf(stdout, OM_LSL, compiler->ast); |
2160 | // printf("\n"); | 2161 | // printf("\n"); |
@@ -2169,7 +2170,6 @@ static boolean doneParsing(LuaSL_compiler *compiler) | |||
2169 | if (out) | 2170 | if (out) |
2170 | { | 2171 | { |
2171 | char diffName[PATH_MAX]; | 2172 | char diffName[PATH_MAX]; |
2172 | // int count; | ||
2173 | 2173 | ||
2174 | strcpy(diffName, compiler->fileName); | 2174 | strcpy(diffName, compiler->fileName); |
2175 | strcat(diffName, ".diff"); | 2175 | strcat(diffName, ".diff"); |
@@ -2198,6 +2198,13 @@ static boolean doneParsing(LuaSL_compiler *compiler) | |||
2198 | fprintf(out, "--// Generated code goes here.\n\n"); | 2198 | fprintf(out, "--// Generated code goes here.\n\n"); |
2199 | outputLeaf(out, OM_LUA, compiler->ast); | 2199 | outputLeaf(out, OM_LUA, compiler->ast); |
2200 | fclose(out); | 2200 | fclose(out); |
2201 | sprintf(buffer, "luac \"%s\"", luaName); | ||
2202 | count = system(buffer); | ||
2203 | if (0 != count) | ||
2204 | { | ||
2205 | compiler->script.bugCount++; | ||
2206 | PE("Lua compile stage failed for %s!", compiler->fileName); | ||
2207 | } | ||
2201 | } | 2208 | } |
2202 | else | 2209 | else |
2203 | PC("Unable to open file %s for writing!", luaName); | 2210 | PC("Unable to open file %s for writing!", luaName); |