From 7069d3f43c8e9c1c4493fd8efcf6e4cebca82e02 Mon Sep 17 00:00:00 2001
From: Martin Nilsson <mani@lysator.liu.se>
Date: Wed, 7 Nov 2001 22:27:56 +0100
Subject: [PATCH] autodoc

Rev: lib/modules/Program.pmod:1.4
---
 lib/modules/Program.pmod | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/lib/modules/Program.pmod b/lib/modules/Program.pmod
index 4aff476089..5cc604c2f9 100644
--- a/lib/modules/Program.pmod
+++ b/lib/modules/Program.pmod
@@ -5,6 +5,8 @@ constant inherits = __builtin.program_inherits;
 constant implements = __builtin.program_implements;
 constant defined = __builtin.program_defined;
 
+//! @fixme
+//!   Document this function.
 array(program) all_inherits(program p)
 {
   array(program) ret = inherit_list(p);
@@ -12,7 +14,32 @@ array(program) all_inherits(program p)
   return ret;
 }
 
-array(program) inherit_tree(program p)
+//! Recursively builds a inheritance tree by
+//! fetching programs inheritance lists.
+//!
+//! @returns
+//!  Returns an array with programs or arrays
+//!  as elements.
+//!
+//! @example
+//!  > class a{}
+//!  > class b{}
+//!  > class c{ inherit a; }
+//!  > class d{ inherit b; inherit c; }
+//!  > Program.inherit_tree(d);
+//!  Result: ({ /* 3 elements */
+//!              d,
+//!              ({ /* 1 element */
+//!                  program
+//!              }),
+//!              ({ /* 2 elements */
+//!                  c,
+//!                  ({ /* 1 element */
+//!                      program
+//!                  })
+//!              })
+//!          })
+array inherit_tree(program p)
 {
   return ({ p })+
     Array.map(inherit_list(p),inherit_tree);
-- 
GitLab