aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-08-14 08:59:39 +1000
committerDavid Walter Seikel2014-08-14 08:59:39 +1000
commit10228595e8c234db03bc860cbb93ae7232c6ccca (patch)
tree08552adc64486526eecc62a7d5e78b790f3e25da /src
parentOptimise message sending. (diff)
downloadSledjHamr-10228595e8c234db03bc860cbb93ae7232c6ccca.zip
SledjHamr-10228595e8c234db03bc860cbb93ae7232c6ccca.tar.gz
SledjHamr-10228595e8c234db03bc860cbb93ae7232c6ccca.tar.bz2
SledjHamr-10228595e8c234db03bc860cbb93ae7232c6ccca.tar.xz
Use the new message saving stuff in the parser as well.
Diffstat (limited to 'src')
-rw-r--r--src/LuaSL/LuaSL.h1
-rw-r--r--src/LuaSL/LuaSL_LSL_tree.h1
-rw-r--r--src/LuaSL/LuaSL_compile.c5
-rw-r--r--src/LuaSL/LuaSL_lemon_yaccer.y7
4 files changed, 9 insertions, 5 deletions
diff --git a/src/LuaSL/LuaSL.h b/src/LuaSL/LuaSL.h
index 54e7fa7..dba6550 100644
--- a/src/LuaSL/LuaSL.h
+++ b/src/LuaSL/LuaSL.h
@@ -11,6 +11,7 @@ typedef struct _gameGlobals gameGlobals; // Define this here, so LuaSL_threads.h
11 11
12#include "LumbrJack.h" 12#include "LumbrJack.h"
13#include "Runnr.h" 13#include "Runnr.h"
14#include "SledjHamr.h"
14 15
15 16
16struct _gameGlobals 17struct _gameGlobals
diff --git a/src/LuaSL/LuaSL_LSL_tree.h b/src/LuaSL/LuaSL_LSL_tree.h
index b08d1db..4192310 100644
--- a/src/LuaSL/LuaSL_LSL_tree.h
+++ b/src/LuaSL/LuaSL_LSL_tree.h
@@ -395,6 +395,7 @@ typedef struct
395#endif 395#endif
396 396
397 397
398void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line);
398 399
399boolean compilerSetup(gameGlobals *ourGlobals); 400boolean compilerSetup(gameGlobals *ourGlobals);
400void compileLSL(LuaCompiler *compiler); 401void compileLSL(LuaCompiler *compiler);
diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c
index b2ae841..4764855 100644
--- a/src/LuaSL/LuaSL_compile.c
+++ b/src/LuaSL/LuaSL_compile.c
@@ -1,6 +1,5 @@
1 1
2#include "LuaSL.h" 2#include "LuaSL.h"
3#include "SledjHamr.h"
4 3
5/* TODO - problem de jour 4/* TODO - problem de jour
6*/ 5*/
@@ -223,7 +222,7 @@ LSL_Script constants;
223int lowestToken = 999999; 222int lowestToken = 999999;
224 223
225 224
226static void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line) 225void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line)
227{ 226{
228 message->type = type; 227 message->type = type;
229 message->column = column; 228 message->column = column;
@@ -2318,7 +2317,7 @@ void compileLSL(LuaCompiler *compiler)
2318 { 2317 {
2319// sendBack(lcompiler->compiler->client, lcompiler->compiler->SID, "compilerError(%d,%d,NOT FOUND function %s called)", call->call->line, call->call->column, call->call->value.stringValue); 2318// sendBack(lcompiler->compiler->client, lcompiler->compiler->SID, "compilerError(%d,%d,NOT FOUND function %s called)", call->call->line, call->call->column, call->call->value.stringValue);
2320 finishMessage(lcompiler->compiler, addMessage(&(lcompiler->compiler->messages), sizeof(compileMessage), 2319 finishMessage(lcompiler->compiler, addMessage(&(lcompiler->compiler->messages), sizeof(compileMessage),
2321 "NOT FOUND function %s called)", call->call->value.stringValue), 2320 "NOT FOUND function %s called", call->call->value.stringValue),
2322 1, call->call->column, call->call->line); 2321 1, call->call->column, call->call->line);
2323 } 2322 }
2324 } 2323 }
diff --git a/src/LuaSL/LuaSL_lemon_yaccer.y b/src/LuaSL/LuaSL_lemon_yaccer.y
index 2a23e84..08fdccc 100644
--- a/src/LuaSL/LuaSL_lemon_yaccer.y
+++ b/src/LuaSL/LuaSL_lemon_yaccer.y
@@ -241,8 +241,11 @@ expr(A) ::= LSL_STRING(B). { B->basicType = OT_string; A = B; }
241 241
242%syntax_error 242%syntax_error
243{ 243{
244 compiler->compiler->bugCount++; 244// compiler->compiler->bugCount++;
245 PE("Syntax error @ line %d, column %d!", yyminor.yy0->line, yyminor.yy0->column); 245// PE("Syntax error @ line %d, column %d!", yyminor.yy0->line, yyminor.yy0->column);
246 finishMessage(compiler->compiler, addMessage(&(compiler->compiler->messages), sizeof(compileMessage),
247 "Syntax error."),
248 1, yyminor.yy0->column, yyminor.yy0->line);
246} 249}
247 250
248 251