added typecasts for int and float
This commit is contained in:
parent
a429b546d0
commit
06d30ac263
4 changed files with 130 additions and 2 deletions
22
src/stl.rs
22
src/stl.rs
|
|
@ -228,6 +228,28 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
},
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"int".to_string(),
|
||||
Symbol {
|
||||
name: String::from("int"),
|
||||
args: Args::Lazy(1),
|
||||
conditional_branches: false,
|
||||
docs: math::INTCAST_DOCSTRING.to_string(),
|
||||
value: ValueType::Internal(Rc::new(math::intcast_callback)),
|
||||
},
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"float".to_string(),
|
||||
Symbol {
|
||||
name: String::from("float"),
|
||||
args: Args::Lazy(1),
|
||||
conditional_branches: false,
|
||||
docs: math::FLOATCAST_DOCSTRING.to_string(),
|
||||
value: ValueType::Internal(Rc::new(math::floatcast_callback)),
|
||||
},
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue