Add in an assert family of functions (#3132)

* Add in an `assert` family of functions

This will check values at runtime, allowing for users to ensure computed
values do not violate static constraints.

Signed-off-by: Paul R. Tagliamonte <paul@zoo.dev>
This commit is contained in:
Paul Tagliamonte
2024-07-26 15:14:51 -04:00
committed by GitHub
parent af842aeded
commit d13f7fd508
9 changed files with 132 additions and 1 deletions

View File

@ -1,6 +1,7 @@
//! Functions implemented for language execution.
pub mod args;
pub mod assert;
pub mod chamfer;
pub mod convert;
pub mod extrude;
@ -118,6 +119,11 @@ lazy_static! {
Box::new(crate::std::math::Ln),
Box::new(crate::std::math::ToDegrees),
Box::new(crate::std::math::ToRadians),
Box::new(crate::std::assert::Assert),
Box::new(crate::std::assert::AssertLessThan),
Box::new(crate::std::assert::AssertGreaterThan),
Box::new(crate::std::assert::AssertLessThanOrEq),
Box::new(crate::std::assert::AssertGreaterThanOrEq),
];
}