mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Added no_function and no_module
This commit is contained in:
parent
0cff52023f
commit
1ce198bcff
1 changed files with 20 additions and 0 deletions
20
common.scad
20
common.scad
|
@ -446,6 +446,26 @@ module no_children(count) {
|
|||
assert(count==0, str("Module ",parent_module(1),"() does not support child modules"));
|
||||
}
|
||||
|
||||
// Function: no_function()
|
||||
// Usage:
|
||||
// dummy = no_function(name)
|
||||
// Description:
|
||||
// Asserts that the function, "name", only exists as a module.
|
||||
// Example:
|
||||
//
|
||||
function no_function(name) =
|
||||
assert(false,str("You called ",name,"() as a function, but it is available only as a module"));
|
||||
|
||||
|
||||
// Module: no_module()
|
||||
// Usage:
|
||||
// no_module();
|
||||
// Description:
|
||||
// Asserts that the called module exists only as a function.
|
||||
module no_module() {
|
||||
assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function"));
|
||||
}
|
||||
|
||||
|
||||
// Section: Testing Helpers
|
||||
|
||||
|
|
Loading…
Reference in a new issue