mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 13:50:23 +01:00
Added no_function and no_module
This commit is contained in:
parent
0cff52023f
commit
1ce198bcff
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"));
|
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
|
// Section: Testing Helpers
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user