Skip to main content

mln_expression/
lib.rs

1//! Style expressions: their types and values, parsing, and evaluation.
2//!
3//! A parsed expression is an [`Expr`], a closed tree whose nodes the parser
4//! has type-checked, so that it evaluates typed (see [`expression`]). The
5//! expression forms (`let`, `match`, `interpolate` and the others that parse
6//! their own arguments) are a closed set of nodes; every other operator is a
7//! function, which parsing resolves by name against a [`Functions`] value
8//! (see [`functions`]). Each kind of node has its own module. `type`,
9//! `match`, `let` and `in` are Rust keywords, so those modules are `type_`,
10//! `match_`, `let_` and `in_`.
11
12mod assertion;
13mod at;
14mod boolean_operator;
15pub mod case;
16mod check_subtype;
17mod coalesce;
18mod coercion;
19mod collator;
20mod collator_expression;
21mod comparison;
22pub mod compound_expression;
23mod distance;
24pub mod dsl;
25pub mod expression;
26mod feature_property_keys;
27mod find_zoom_curve;
28pub mod format_expression;
29pub mod format_section_override;
30pub mod formatted;
31pub mod functions;
32pub mod image;
33pub mod image_expression;
34mod in_;
35mod index_of;
36mod interpolate;
37mod interpolator;
38pub mod is_expression;
39mod length;
40mod let_;
41mod literal;
42mod locale;
43pub mod match_;
44mod number_format;
45pub mod parsing_context;
46pub mod range;
47mod semiliteral;
48mod slice;
49mod step;
50mod stops;
51pub mod type_;
52mod utf8_op_helpers;
53mod util;
54pub mod value;
55mod within;
56
57pub use expression::{Dependency, EvaluationContext, EvaluationError, EvaluationResult, Expr};
58pub use feature_property_keys::feature_property_keys;
59pub use find_zoom_curve::{ZoomCurvePtr, find_zoom_curve_checked};
60pub use formatted::{Formatted, FormattedSection};
61pub use functions::Functions;
62pub use image::Image;
63pub use interpolate::Interpolate;
64pub use interpolator::Interpolator;
65pub use is_expression::is_expression;
66// For the test runners, whose expectations assume a default locale.
67#[doc(hidden)]
68pub use locale::set_default_locale;
69pub use parsing_context::{ParseResult, ParsingContext, TypeAnnotationOption};
70pub use step::Step;
71pub use stops::Stops;
72pub use type_::Type;
73pub use value::{Value, ValueConverter, from_expression_value};
74
75#[cfg(test)]
76mod tests;