mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Fix for no_module() example.
This commit is contained in:
parent
12cc40a56f
commit
762eb88d3d
2 changed files with 6 additions and 5 deletions
|
@ -552,14 +552,15 @@ function segs(r) =
|
||||||
// module foo() {
|
// module foo() {
|
||||||
// no_children($children);
|
// no_children($children);
|
||||||
// }
|
// }
|
||||||
// foo();
|
|
||||||
module no_children(count) {
|
module no_children(count) {
|
||||||
assert($children==0, "Module no_children() does not support child modules");
|
assert($children==0, "Module no_children() does not support child modules");
|
||||||
assert(count==0, str("Module ",parent_module(1),"() does not support child modules"));
|
echo(parents=$parent_modules);
|
||||||
|
if ($parent_modules>0) {
|
||||||
|
assert(count==0, str("Module ",parent_module(1),"() does not support child modules"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Function: no_function()
|
// Function: no_function()
|
||||||
// Usage:
|
// Usage:
|
||||||
// dummy = no_function(name)
|
// dummy = no_function(name)
|
||||||
|
@ -577,7 +578,7 @@ function no_function(name) =
|
||||||
// Description:
|
// Description:
|
||||||
// Asserts that the called module exists only as a function.
|
// Asserts that the called module exists only as a function.
|
||||||
// Example:
|
// Example:
|
||||||
// no_module();
|
// function foo() = no_module();
|
||||||
module no_module() {
|
module no_module() {
|
||||||
assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function"));
|
assert(false, str("You called ",parent_module(1),"() as a module but it is available only as a function"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,547];
|
BOSL_VERSION = [2,0,548];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue