summaryrefslogtreecommitdiff
path: root/src/map/magic-interpreter-parser.y
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-24 13:57:13 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-03-24 13:57:13 -0700
commita2306446c86b3333e69b082e41ae76ba71a42d9d (patch)
treeac032fc4566d2ae3091a0dc95329ac86d50b9a23 /src/map/magic-interpreter-parser.y
parentb6fa80d4c17994771cb796317c52cb8fb7a38a16 (diff)
downloadtmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.gz
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.bz2
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.xz
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.zip
Optimize common objects, and adjust other objects accordingly.
Major changes still need to be made to each of the servers.
Diffstat (limited to 'src/map/magic-interpreter-parser.y')
-rw-r--r--src/map/magic-interpreter-parser.y14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/magic-interpreter-parser.y b/src/map/magic-interpreter-parser.y
index 8484902..c5ee41d 100644
--- a/src/map/magic-interpreter-parser.y
+++ b/src/map/magic-interpreter-parser.y
@@ -224,13 +224,13 @@ semicolons : /* empty */
proc_formals_list : /* empty */
- { $$ = aCalloc(sizeof(proc_t), 1); }
+ { CREATE ($$, proc_t, 1); }
| proc_formals_list_ne
{ $$ = $1; }
;
proc_formals_list_ne : ID
- { $$ = aCalloc(sizeof(proc_t), 1);
+ { CREATE ($$, proc_t, 1);
$$->args_nr = 1;
$$->args = malloc(sizeof(int));
$$->args[0] = intern_id($1);
@@ -414,7 +414,7 @@ arg_list : /* empty */
arg_list_ne : expr
- { $$.args = aCalloc(sizeof(expr_t *), 1);
+ { CREATE($$.args, expr_t *, 1);
$$.args_nr = 1;
$$.args[0] = $1;
}
@@ -452,7 +452,7 @@ area : location
spelldef : spellbody_list
{ $$ = new_spell($1); }
| LET defs IN spellbody_list
- { $$ = new_spell($4);
+ { $$ = new_spell($4);
$$->letdefs_nr = $2.letdefs_nr;
$$->letdefs = $2.letdefs;
$$->spellguard = $4;
@@ -693,7 +693,7 @@ effect_list : /* empty */
| effect semicolons effect_list
{ $$ = set_effect_continuation($1, $3); }
;
-
+
%%
@@ -743,7 +743,7 @@ add_spell(spell_t *spell, int line_nr)
magic_conf.spells = realloc(magic_conf.spells, magic_conf.spells_nr * sizeof (spell_t*));
magic_conf.spells[index] = spell;
-
+
}
static void
@@ -867,7 +867,7 @@ spellguard_implication(spellguard_t *a, spellguard_t *b)
spellguard_implication(a->next, b);
else
a->next = b;
-
+
return retval;
}