Added typeof(), is_str(), is_type(). Moved no_children() to errors.scad.

This commit is contained in:
Revar Desmera
2019-10-30 19:52:53 -07:00
parent dded2eefa6
commit fa572fc398
2 changed files with 65 additions and 19 deletions

View File

@@ -40,6 +40,19 @@ function assert_in_list(argname, val, l, idx=undef) =
) assert(FAILED, msg);
// Module: no_children()
// Usage:
// no_children($children);
// Description:
// Assert that the calling module does not support children. Prints an error message to this effect and fails if children are present,
// as indicated by its argument.
// Arguments:
// $children = number of children the module has.
module no_children(count) {
assert(count==0, str("Module ",parent_module(1),"() does not support child modules"));
}
// Function&Module: echo_error()
// Usage:
// echo_error(msg, [pfx]);