aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL_compile.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/LuaSL/LuaSL_compile.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c
index 4764855..a2b2bca 100644
--- a/src/LuaSL/LuaSL_compile.c
+++ b/src/LuaSL/LuaSL_compile.c
@@ -501,7 +501,7 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
501 // someList = someList + notAList -> someList = _LSL.listAddList( someList, notAList) 501 // someList = someList + notAList -> someList = _LSL.listAddList( someList, notAList)
502 else if ((OT_list == lType) || (OT_list == rType)) 502 else if ((OT_list == lType) || (OT_list == rType))
503 { 503 {
504 504#if COMPILE_OUTPUT
505if ((left) && (right)) 505if ((left) && (right))
506 printf("LA LINE %d - %s %s %s\n", lval->line, left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen); 506 printf("LA LINE %d - %s %s %s\n", lval->line, left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen);
507else if (left) 507else if (left)
@@ -510,7 +510,7 @@ else if (right)
510 printf("LA LINE %d - NOLEFT %s %s\n", lval->line, lval->toKen->toKen, right->toKen->toKen); 510 printf("LA LINE %d - NOLEFT %s %s\n", lval->line, lval->toKen->toKen, right->toKen->toKen);
511else 511else
512 printf("LA LINE %d - NOLEFT %s NORIGHT\n", lval->line, lval->toKen->toKen); 512 printf("LA LINE %d - NOLEFT %s NORIGHT\n", lval->line, lval->toKen->toKen);
513 513#endif
514 lval->basicType = OT_list; 514 lval->basicType = OT_list;
515 lval->toKen = tokens[LSL_LIST_ADD_LIST - lowestToken]; 515 lval->toKen = tokens[LSL_LIST_ADD_LIST - lowestToken];
516 } 516 }
@@ -575,6 +575,7 @@ else
575 { 575 {
576 if (left->flags & MF_ASSIGNEXP) 576 if (left->flags & MF_ASSIGNEXP)
577 { 577 {
578#if COMPILE_OUTPUT
578if ((left) && (right)) 579if ((left) && (right))
579 printf("%s %s %s\n", left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen); 580 printf("%s %s %s\n", left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen);
580else if (left) 581else if (left)
@@ -584,6 +585,7 @@ else if (right)
584else 585else
585 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen); 586 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen);
586 printf("############################################################################## left\n"); 587 printf("############################################################################## left\n");
588#endif
587 left->flags |= MF_WRAPFUNC; 589 left->flags |= MF_WRAPFUNC;
588 if (LSL_PARENTHESIS_OPEN == left->toKen->type) 590 if (LSL_PARENTHESIS_OPEN == left->toKen->type)
589 left->value.parenthesis->flags |= MF_WRAPFUNC; 591 left->value.parenthesis->flags |= MF_WRAPFUNC;
@@ -609,6 +611,7 @@ else
609 { 611 {
610 if (right->flags & MF_ASSIGNEXP) 612 if (right->flags & MF_ASSIGNEXP)
611 { 613 {
614#if COMPILE_OUTPUT
612if ((left) && (right)) 615if ((left) && (right))
613 printf("%s %s %s\n", left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen); 616 printf("%s %s %s\n", left->toKen->toKen, lval->toKen->toKen, right->toKen->toKen);
614else if (left) 617else if (left)
@@ -618,6 +621,7 @@ else if (right)
618else 621else
619 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen); 622 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen);
620 printf("############################################################################## right\n"); 623 printf("############################################################################## right\n");
624#endif
621 right->flags |= MF_WRAPFUNC; 625 right->flags |= MF_WRAPFUNC;
622 } 626 }
623 } 627 }
@@ -643,8 +647,6 @@ else
643 rightType = allowed[right->basicType].name; 647 rightType = allowed[right->basicType].name;
644 } 648 }
645 649
646// compiler->compiler->bugCount++;
647// sendBack(compiler->compiler->client, compiler->compiler->SID, "compilerError(%d,%d,Invalid operation [%s(%s) %s %s(%s)])", lval->line, lval->column, leftType, leftToken, lval->toKen->toKen, rightType, rightToken);
648 finishMessage(compiler->compiler, addMessage(&(compiler->compiler->messages), sizeof(compileMessage), 650 finishMessage(compiler->compiler, addMessage(&(compiler->compiler->messages), sizeof(compileMessage),
649 "Invalid operation [%s(%s) %s %s(%s)]", leftType, leftToken, lval->toKen->toKen, rightType, rightToken), 651 "Invalid operation [%s(%s) %s %s(%s)]", leftType, leftToken, lval->toKen->toKen, rightType, rightToken),
650 1, lval->column, lval->line); 652 1, lval->column, lval->line);
@@ -1429,6 +1431,7 @@ static void outputLeaf(FILE *file, outputMode mode, LSL_Leaf *leaf)
1429 if (MF_WRAPFUNC & leaf->flags) 1431 if (MF_WRAPFUNC & leaf->flags)
1430 { 1432 {
1431// TODO - Leaving this here in case we trip over one. 1433// TODO - Leaving this here in case we trip over one.
1434#if COMPILE_OUTPUT
1432if ((leaf->left) && (leaf->right)) 1435if ((leaf->left) && (leaf->right))
1433 printf("%s %s %s\n", leaf->left->toKen->toKen, leaf->toKen->toKen, leaf->right->toKen->toKen); 1436 printf("%s %s %s\n", leaf->left->toKen->toKen, leaf->toKen->toKen, leaf->right->toKen->toKen);
1434else if (leaf->left) 1437else if (leaf->left)
@@ -1437,6 +1440,7 @@ else if (leaf->right)
1437 printf("NOLEFT %s %s\n", leaf->toKen->toKen, leaf->right->toKen->toKen); 1440 printf("NOLEFT %s %s\n", leaf->toKen->toKen, leaf->right->toKen->toKen);
1438else 1441else
1439 printf("NOLEFT %s NORIGHT\n", leaf->toKen->toKen); 1442 printf("NOLEFT %s NORIGHT\n", leaf->toKen->toKen);
1443#endif
1440 } 1444 }
1441 if ((LSL_ASSIGNMENT & leaf->toKen->flags) && (LSL_ASSIGNMENT_PLAIN != leaf->toKen->type)) 1445 if ((LSL_ASSIGNMENT & leaf->toKen->flags) && (LSL_ASSIGNMENT_PLAIN != leaf->toKen->type))
1442 { 1446 {
@@ -2315,7 +2319,6 @@ void compileLSL(LuaCompiler *compiler)
2315 } 2319 }
2316 else 2320 else
2317 { 2321 {
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);
2319 finishMessage(lcompiler->compiler, addMessage(&(lcompiler->compiler->messages), sizeof(compileMessage), 2322 finishMessage(lcompiler->compiler, addMessage(&(lcompiler->compiler->messages), sizeof(compileMessage),
2320 "NOT FOUND function %s called", call->call->value.stringValue), 2323 "NOT FOUND function %s called", call->call->value.stringValue),
2321 1, call->call->column, call->call->line); 2324 1, call->call->column, call->call->line);