diff options
author | David Walter Seikel | 2012-01-17 20:01:25 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-17 20:01:25 +1000 |
commit | 8dfddd6c2775bd8e9838f5a95a25767e1c86a626 (patch) | |
tree | 788e2825a2697786e43f3020a05a4f32acfb4076 /LuaSL/src/LuaSL_compile.c | |
parent | Add function parameters to the search list. (diff) | |
download | SledjHamr-8dfddd6c2775bd8e9838f5a95a25767e1c86a626.zip SledjHamr-8dfddd6c2775bd8e9838f5a95a25767e1c86a626.tar.gz SledjHamr-8dfddd6c2775bd8e9838f5a95a25767e1c86a626.tar.bz2 SledjHamr-8dfddd6c2775bd8e9838f5a95a25767e1c86a626.tar.xz |
Make sure all leaf's are created unbroken.
Still getting broken ones, so something is actively breaking them.
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 4e089c7..56fd4f5 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -578,7 +578,7 @@ static LSL_Leaf *evaluateLeaf(LSL_Leaf *leaf, LSL_Leaf *left, LSL_Leaf *right) | |||
578 | result = leaf->token->evaluate(leaf, lresult, rresult); | 578 | result = leaf->token->evaluate(leaf, lresult, rresult); |
579 | else | 579 | else |
580 | { | 580 | { |
581 | result = calloc(1, sizeof(LSL_Leaf)); | 581 | result = newLeaf(LSL_UNKNOWN, NULL, NULL); |
582 | if (rresult && result) | 582 | if (rresult && result) |
583 | memcpy(result, rresult, sizeof(LSL_Leaf)); | 583 | memcpy(result, rresult, sizeof(LSL_Leaf)); |
584 | } | 584 | } |
@@ -594,7 +594,7 @@ static LSL_Leaf *evaluateLeaf(LSL_Leaf *leaf, LSL_Leaf *left, LSL_Leaf *right) | |||
594 | 594 | ||
595 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) | 595 | static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) |
596 | { | 596 | { |
597 | LSL_Leaf *result = malloc(sizeof(LSL_Leaf)); | 597 | LSL_Leaf *result = newLeaf(LSL_FLOAT, NULL, NULL); |
598 | 598 | ||
599 | if (content && result) | 599 | if (content && result) |
600 | { | 600 | { |
@@ -609,7 +609,7 @@ static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf | |||
609 | 609 | ||
610 | static LSL_Leaf *evaluateIntegerToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) | 610 | static LSL_Leaf *evaluateIntegerToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) |
611 | { | 611 | { |
612 | LSL_Leaf *result = malloc(sizeof(LSL_Leaf)); | 612 | LSL_Leaf *result = newLeaf(LSL_INTEGER, NULL, NULL); |
613 | 613 | ||
614 | if (content && result) | 614 | if (content && result) |
615 | { | 615 | { |
@@ -690,7 +690,7 @@ A vectorFloat results in a vector value. | |||
690 | 690 | ||
691 | static LSL_Leaf *evaluateOperationToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) | 691 | static LSL_Leaf *evaluateOperationToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right) |
692 | { | 692 | { |
693 | LSL_Leaf *result = calloc(1, sizeof(LSL_Leaf)); | 693 | LSL_Leaf *result = newLeaf(LSL_UNKNOWN, NULL, NULL); |
694 | 694 | ||
695 | if (content && result) | 695 | if (content && result) |
696 | { | 696 | { |
@@ -1035,7 +1035,7 @@ Eina_Bool compileLSL(gameGlobals *game, char *script) | |||
1035 | } | 1035 | } |
1036 | PI("Opened %s.", compiler.fileName); | 1036 | PI("Opened %s.", compiler.fileName); |
1037 | compiler.ast = NULL; | 1037 | compiler.ast = NULL; |
1038 | compiler.lval = calloc(1, sizeof(LSL_Leaf)); | 1038 | compiler.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); |
1039 | // Text editors usually start counting at 1, even programmers editors. | 1039 | // Text editors usually start counting at 1, even programmers editors. |
1040 | compiler.column = 1; | 1040 | compiler.column = 1; |
1041 | compiler.line = 1; | 1041 | compiler.line = 1; |
@@ -1053,7 +1053,7 @@ Eina_Bool compileLSL(gameGlobals *game, char *script) | |||
1053 | Parse(pParser, yv, compiler.lval, &compiler); | 1053 | Parse(pParser, yv, compiler.lval, &compiler); |
1054 | if (LSL_SCRIPT == yv) | 1054 | if (LSL_SCRIPT == yv) |
1055 | break; | 1055 | break; |
1056 | compiler.lval = calloc(1, sizeof(LSL_Leaf)); | 1056 | compiler.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); |
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | yylex_destroy(compiler.scanner); | 1059 | yylex_destroy(compiler.scanner); |
@@ -1101,7 +1101,7 @@ static int nextFile(LuaSL_yyparseParam *param) | |||
1101 | PE("Opened %s.", param->fileName); | 1101 | PE("Opened %s.", param->fileName); |
1102 | burnLeaf(param->ast); | 1102 | burnLeaf(param->ast); |
1103 | param->ast = NULL; | 1103 | param->ast = NULL; |
1104 | param->lval = calloc(1, sizeof(LSL_Leaf)); | 1104 | param->lval = newLeaf(LSL_UNKNOWN, NULL, NULL); |
1105 | // Text editors usually start counting at 1, even programmers editors. | 1105 | // Text editors usually start counting at 1, even programmers editors. |
1106 | param->column = 1; | 1106 | param->column = 1; |
1107 | param->line = 1; | 1107 | param->line = 1; |
@@ -1191,7 +1191,7 @@ int main(int argc, char **argv) | |||
1191 | Parse(pParser, yv, param.lval, ¶m); | 1191 | Parse(pParser, yv, param.lval, ¶m); |
1192 | if (LSL_SCRIPT == yv) | 1192 | if (LSL_SCRIPT == yv) |
1193 | break; | 1193 | break; |
1194 | param.lval = calloc(1, sizeof(LSL_Leaf)); | 1194 | param.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | yylex_destroy(param.scanner); | 1197 | yylex_destroy(param.scanner); |