summaryrefslogtreecommitdiff
path: root/processor/main.m4
diff options
context:
space:
mode:
Diffstat (limited to 'processor/main.m4')
-rw-r--r--processor/main.m419
1 files changed, 17 insertions, 2 deletions
diff --git a/processor/main.m4 b/processor/main.m4
index 7077c5c..d4fa0c1 100644
--- a/processor/main.m4
+++ b/processor/main.m4
@@ -164,12 +164,27 @@ dnl {{{ COPYPOINTER
define(`COPYPOINTER', `COPY(`$1')')
dnl }}}
dnl {{{ SETNULL_EX
-define(`SETNULL_EX', `IFCOPY(`$1 = NULL;')')
+define(`SETNULL_EX', `
+ IFDASM(`
+ ifelse(`$2', `[]', `
+ add_next_index_null(DST());
+ ', `
+ add_assoc_null_ex(DST(), XCACHE_STRS("ifelse(`$2', `', `$1', `$2')"));
+ ')
+ ')
+ IFCOPY(`$1 = NULL;')
+')
define(`SETNULL', `SETNULL_EX(`DST(`$1')')DONE(`$1')')
dnl }}}
dnl {{{ COPYNULL_EX(1:dst, 2:elm-name)
define(`COPYNULL_EX', `
- IFDASM(`add_assoc_null_ex(DST(), XCACHE_STRS("$2"));')
+ IFDASM(`
+ ifelse(`$2', `[]', `
+ add_next_index_null(DST());
+ ', `
+ add_assoc_null_ex(DST(), XCACHE_STRS("ifelse(`$2', `', `$1', `$2')"));
+ ')
+ ')
IFNOTMEMCPY(`IFCOPY(`$1 = NULL;')')
assert(patsubst($1, DST(), SRC()) == NULL);
')