feat: Migrate SAL to Cargo workspace
Some checks failed
Rhai Tests / Run Rhai Tests (push) Has been cancelled
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled

- Migrate individual modules to independent crates
- Refactor dependencies for improved modularity
- Update build system and testing infrastructure
- Update documentation to reflect new structure
This commit is contained in:
Mahmoud-Emad
2025-06-24 12:39:18 +03:00
parent 8012a66250
commit e125bb6511
54 changed files with 1196 additions and 1582 deletions

View File

@@ -22,10 +22,7 @@ impl SalError {
impl From<SalError> for Box<EvalAltResult> {
fn from(err: SalError) -> Self {
let err_msg = err.to_string();
Box::new(EvalAltResult::ErrorRuntime(
err_msg.into(),
Position::NONE,
))
Box::new(EvalAltResult::ErrorRuntime(err_msg.into(), Position::NONE))
}
}
@@ -45,7 +42,6 @@ impl<T, E: std::error::Error> ToRhaiError<T> for Result<T, E> {
}
}
/// Register all the SalError variants with the Rhai engine
///
/// # Arguments
@@ -56,7 +52,8 @@ impl<T, E: std::error::Error> ToRhaiError<T> for Result<T, E> {
///
/// * `Result<(), Box<EvalAltResult>>` - Ok if registration was successful, Err otherwise
pub fn register_error_types(engine: &mut Engine) -> Result<(), Box<EvalAltResult>> {
engine.register_type_with_name::<SalError>("SalError")
engine
.register_type_with_name::<SalError>("SalError")
.register_fn("to_string", |err: &mut SalError| err.to_string());
Ok(())
}
}