|
BashSpark
|
Structure to help class command_math parse it's parameters.
More...
Classes | |
| struct | depth_guard |
| Manages depth of a math_parser instance during its lifetime. More... | |
| struct | expvar |
| Structure to hold variable information in sequence functions. More... | |
Public Member Functions | |
| math_parser (const std::span< const std::string > &vTokens) noexcept | |
| std::int64_t | do_toplevel (std::size_t &nPos, const expvar &nX) |
| Evaluate a full expression (top-level entry point). | |
| void | increase_depth () |
| Increases the current recursion/evaluation depth. Ensures that the depth does not exceed MAX_DEPTH. | |
| void | decrease_depth () |
| Decreases the current recursion/evaluation depth. Will not decrement below zero. | |
Static Public Attributes | |
| static constexpr std::size_t | MAX_DEPTH = 512 |
| Maximum depth of the shell parser. | |
| static std::map< std::string_view, math_operator > | OPERATORS |
| Map containing operator expressions and codes. | |
Structure to help class command_math parse it's parameters.
|
inlineexplicitnoexcept |
Contstructs a math_parser
| vTokens | Tokens to parse |
| std::int64_t bs::math_parser::do_toplevel | ( | std::size_t & | nPos, |
| const expvar & | nX | ||
| ) |
Evaluate a full expression (top-level entry point).
| nPos | Token positon |
| nX | Variable map |
|
inline |
Increases the current recursion/evaluation depth. Ensures that the depth does not exceed MAX_DEPTH.
| math_error | If increasing the depth would exceed MAX_DEPTH. |
|
static |
Map containing operator expressions and codes.