diff options
Diffstat (limited to 'doc/examples/wraplifo.m4')
-rw-r--r-- | doc/examples/wraplifo.m4 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/examples/wraplifo.m4 b/doc/examples/wraplifo.m4 new file mode 100644 index 00000000..bdbf3fb6 --- /dev/null +++ b/doc/examples/wraplifo.m4 @@ -0,0 +1,10 @@ +dnl Redefine m4wrap to have LIFO semantics. +define(`_m4wrap_level', `0')dnl +define(`_m4wrap', defn(`m4wrap'))dnl +define(`m4wrap', +`ifdef(`m4wrap'_m4wrap_level, + `define(`m4wrap'_m4wrap_level, + `$1'defn(`m4wrap'_m4wrap_level))', + `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl +m4wrap'_m4wrap_level)dnl +define(`m4wrap'_m4wrap_level, `$1')')')dnl |