finished inc and dec, and tests

This commit is contained in:
Ava Hahn 2023-03-07 22:16:57 -08:00
parent c74d6f5ddf
commit 8bf4b3c368
Signed by untrusted user who does not match committer: affine
GPG key ID: 3A4645B8CF806069
4 changed files with 304 additions and 17 deletions

View file

@ -349,6 +349,28 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
},
);
syms.insert(
"inc".to_string(),
Symbol {
name: String::from("inc"),
args: Args::Lazy(1),
conditional_branches: true,
docs: math::INC_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(math::inc_callback)),
},
);
syms.insert(
"dec".to_string(),
Symbol {
name: String::from("dec"),
args: Args::Lazy(1),
conditional_branches: true,
docs: math::DEC_DOCSTRING.to_string(),
value: ValueType::Internal(Rc::new(math::dec_callback)),
},
);
Ok(())
}