Skip to content
Snippets Groups Projects
Commit 7069d3f4 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

autodoc

Rev: lib/modules/Program.pmod:1.4
parent addbcc73
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,8 @@ constant inherits = __builtin.program_inherits; ...@@ -5,6 +5,8 @@ constant inherits = __builtin.program_inherits;
constant implements = __builtin.program_implements; constant implements = __builtin.program_implements;
constant defined = __builtin.program_defined; constant defined = __builtin.program_defined;
//! @fixme
//! Document this function.
array(program) all_inherits(program p) array(program) all_inherits(program p)
{ {
array(program) ret = inherit_list(p); array(program) ret = inherit_list(p);
...@@ -12,7 +14,32 @@ array(program) all_inherits(program p) ...@@ -12,7 +14,32 @@ array(program) all_inherits(program p)
return ret; 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 })+ return ({ p })+
Array.map(inherit_list(p),inherit_tree); Array.map(inherit_list(p),inherit_tree);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment