Expand description
Expressive, the whale language.
Re-exports§
pub use crate::error::EvalexprError;
pub use crate::error::EvalexprResult;
Modules§
- error
- The
error
module contains theError
enum that contains all error types used by this crate.
Macros§
- context_
map - This macro provides a convenient syntax for creating a static context.
- math_
consts_ context - Context with all Rust’s constants in
f64::consts
available by default. Alternatively, specifiy constants withmath_consts_context!(E, PI, TAU, ...)
Available constants can be found in thecore::f64::consts module
.
Structs§
- Function
- A user-defined function.
Functions can be used in expressions by storing them in a
Context
. - Node
- A node in the operator tree.
The operator tree is created by the crate-level
build_operator_tree
method. It can be evaluated for a given context with theNode::eval
method. - Variable
Map - A context that stores its mappings in hash maps.
Enums§
- Operator
- An enum that represents operators in the operator tree.
- Partial
Token - A partial token is an input character whose meaning depends on the characters around it.
- Value
- The value type used by the parser. Values can be of different subtypes that are the variants of this enum.
- Value
Type - The type of a
Value
.
Constants§
- EMPTY_
VALUE - The value of the empty type to be used in rust.
Traits§
- Context
- An immutable context.
- Context
With Mutable Functions - A context that allows to assign to function identifiers.
- Context
With Mutable Variables - A context that allows to assign to variables.
Functions§
- build_
operator_ tree - Build the operator tree for the given expression string.
- eval
- Evaluate the given expression string.
- eval_
boolean - Evaluate the given expression string into a boolean.
- eval_
boolean_ with_ context - Evaluate the given expression string into a boolean with the given context.
- eval_
boolean_ with_ context_ mut - Evaluate the given expression string into a boolean with the given mutable context.
- eval_
empty - Evaluate the given expression string into an empty value.
- eval_
empty_ with_ context - Evaluate the given expression string into an empty value with the given context.
- eval_
empty_ with_ context_ mut - Evaluate the given expression string into an empty value with the given mutable context.
- eval_
float - Evaluate the given expression string into a float.
- eval_
float_ with_ context - Evaluate the given expression string into a float with the given context.
- eval_
float_ with_ context_ mut - Evaluate the given expression string into a float with the given mutable context.
- eval_
int - Evaluate the given expression string into an integer.
- eval_
int_ with_ context - Evaluate the given expression string into an integer with the given context.
- eval_
int_ with_ context_ mut - Evaluate the given expression string into an integer with the given mutable context.
- eval_
number - Evaluate the given expression string into a float. If the result of the expression is an integer, it is silently converted into a float.
- eval_
number_ with_ context - Evaluate the given expression string into a float with the given context. If the result of the expression is an integer, it is silently converted into a float.
- eval_
number_ with_ context_ mut - Evaluate the given expression string into a float with the given mutable context. If the result of the expression is an integer, it is silently converted into a float.
- eval_
string - Evaluate the given expression string into a string.
- eval_
string_ with_ context - Evaluate the given expression string into a string with the given context.
- eval_
string_ with_ context_ mut - Evaluate the given expression string into a string with the given mutable context.
- eval_
tuple - Evaluate the given expression string into a tuple.
- eval_
tuple_ with_ context - Evaluate the given expression string into a tuple with the given context.
- eval_
tuple_ with_ context_ mut - Evaluate the given expression string into a tuple with the given mutable context.
- eval_
with_ context - Evaluate the given expression string with the given context.
- eval_
with_ context_ mut - Evaluate the given expression string with the given mutable context.