grass/src/builtin/mod.rs

24 lines
453 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-02-02 18:05:36 -05:00
mod list;
mod map;
mod math;
mod meta;
mod selector;
mod string;
2020-01-25 23:33:45 -05:00
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
};
}