grass/src/builtin/mod.rs

18 lines
388 B
Rust
Raw Normal View History

2020-01-25 20:58:30 -05:00
use lazy_static::lazy_static;
use std::collections::BTreeMap;
2020-01-25 23:33:45 -05:00
use crate::args::CallArgs;
2020-01-25 20:58:30 -05:00
use crate::value::Value;
2020-01-25 23:33:45 -05:00
mod color;
2020-01-26 15:28:39 -05:00
pub(crate) type Builtin = Box<dyn Fn(&CallArgs) -> Option<Value> + Send + Sync>;
2020-01-25 20:58:30 -05:00
lazy_static! {
2020-01-25 23:33:45 -05:00
pub(crate) static ref GLOBAL_FUNCTIONS: BTreeMap<String, Builtin> = {
let mut m = BTreeMap::new();
color::register(&mut m);
2020-01-25 20:58:30 -05:00
m
};
}