From 10228595e8c234db03bc860cbb93ae7232c6ccca Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 14 Aug 2014 08:59:39 +1000 Subject: Use the new message saving stuff in the parser as well. --- src/LuaSL/LuaSL.h | 1 + src/LuaSL/LuaSL_LSL_tree.h | 1 + src/LuaSL/LuaSL_compile.c | 5 ++--- src/LuaSL/LuaSL_lemon_yaccer.y | 7 +++++-- 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 #include "LumbrJack.h" #include "Runnr.h" +#include "SledjHamr.h" struct _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 #endif +void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line); boolean compilerSetup(gameGlobals *ourGlobals); void 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 @@ #include "LuaSL.h" -#include "SledjHamr.h" /* TODO - problem de jour */ @@ -223,7 +222,7 @@ LSL_Script constants; int lowestToken = 999999; -static void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line) +void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line) { message->type = type; message->column = column; @@ -2318,7 +2317,7 @@ void compileLSL(LuaCompiler *compiler) { // 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); finishMessage(lcompiler->compiler, addMessage(&(lcompiler->compiler->messages), sizeof(compileMessage), - "NOT FOUND function %s called)", call->call->value.stringValue), + "NOT FOUND function %s called", call->call->value.stringValue), 1, call->call->column, call->call->line); } } 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; } %syntax_error { - compiler->compiler->bugCount++; - PE("Syntax error @ line %d, column %d!", yyminor.yy0->line, yyminor.yy0->column); +// compiler->compiler->bugCount++; +// PE("Syntax error @ line %d, column %d!", yyminor.yy0->line, yyminor.yy0->column); + finishMessage(compiler->compiler, addMessage(&(compiler->compiler->messages), sizeof(compileMessage), + "Syntax error."), + 1, yyminor.yy0->column, yyminor.yy0->line); } -- cgit v1.1