summaryrefslogtreecommitdiff
path: root/checks/089.stacks
diff options
context:
space:
mode:
Diffstat (limited to 'checks/089.stacks')
-rw-r--r--checks/089.stacks26
1 files changed, 26 insertions, 0 deletions
diff --git a/checks/089.stacks b/checks/089.stacks
new file mode 100644
index 0000000..f90ab29
--- /dev/null
+++ b/checks/089.stacks
@@ -0,0 +1,26 @@
+dnl @ ../doc/m4.texi:3533: Origin of test
+dnl @ expected status: 0
+dnl @ extra options:
+dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
+dnl @ Foundation, Inc.
+dnl @ This file is free software; the Free Software Foundation
+dnl @ gives unlimited permission to copy and/or distribute it
+dnl @ with or without modifications, as long as this notice
+dnl @ is preserved.
+undivert(`stack.m4')dnl
+dnl @result{}divert(`-1')
+dnl @result{}# stack_foreach(macro, action)
+dnl @result{}# Invoke ACTION with a single argument of each definition
+dnl @result{}# from the definition stack of MACRO, starting with the oldest.
+dnl @result{}define(`stack_foreach',
+dnl @result{}`_stack_reverse(`$1', `tmp-$1')'dnl
+dnl @result{}`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')')
+dnl @result{}# stack_foreach_lifo(macro, action)
+dnl @result{}# Invoke ACTION with a single argument of each definition
+dnl @result{}# from the definition stack of MACRO, starting with the newest.
+dnl @result{}define(`stack_foreach_lifo',
+dnl @result{}`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl
+dnl @result{}`_stack_reverse(`tmp-$1', `$1')')
+dnl @result{}define(`_stack_reverse',
+dnl @result{}`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')')
+dnl @result{}divert`'dnl