2020-03-10 21:19:23 -04:00
|
|
|
use once_cell::sync::Lazy;
|
2020-03-03 19:51:02 -05:00
|
|
|
use std::collections::HashMap;
|
2020-01-25 20:58:30 -05:00
|
|
|
|
2020-01-25 23:33:45 -05:00
|
|
|
use crate::args::CallArgs;
|
2020-02-16 10:14:17 -05:00
|
|
|
use crate::error::SassResult;
|
2020-03-17 20:13:53 -04:00
|
|
|
use crate::scope::Scope;
|
2020-01-25 20:58:30 -05:00
|
|
|
use crate::value::Value;
|
|
|
|
|
2020-02-03 07:11:35 -05:00
|
|
|
#[macro_use]
|
|
|
|
mod macros;
|
2020-02-02 22:33:04 -05:00
|
|
|
|
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-04-02 13:45:14 -04:00
|
|
|
pub(crate) type Builtin = Box<dyn Fn(CallArgs, &Scope) -> SassResult<Value> + Send + Sync>;
|
2020-01-25 20:58:30 -05:00
|
|
|
|
2020-03-10 21:19:23 -04:00
|
|
|
pub(crate) static GLOBAL_FUNCTIONS: Lazy<HashMap<String, Builtin>> = Lazy::new(|| {
|
|
|
|
let mut m = HashMap::new();
|
|
|
|
color::register(&mut m);
|
|
|
|
list::register(&mut m);
|
2020-03-30 15:43:15 -04:00
|
|
|
map::register(&mut m);
|
2020-03-10 21:19:23 -04:00
|
|
|
math::register(&mut m);
|
|
|
|
meta::register(&mut m);
|
|
|
|
string::register(&mut m);
|
|
|
|
m
|
|
|
|
});
|