Module parsing

Module parsing 

Source
Expand description

Mathematical expression and numeric string tokenization, analysis, and parsing.

Structs§

MathDetection
Result of identifying a mathematical expression, relation, or numeral format.
ParsedInput
Metadata regarding a parsed numeric input string.
ParsedNumber
Represents a parsed numerical value with formatting metadata and optional units.

Enums§

MathToken
Token representation in a mathematical expression.
NumberValue
The semantic value of a parsed number or mathematical constant.

Functions§

analyze_input
Backward-compatible wrapper analyzing layout of a numeric string.
detect_math_format
Detects whether s represents a mathematical expression (arithmetic, symbolic) or relation (equation, inequality, approximation, system).
detect_numeric_format
Detects whether s represents a numeric or base numeral format (Integer, Float, HexadecimalNumeral, BinaryNumeral, or OctalNumeral).
evaluate_expression
Evaluates a math expression string with standard operator precedence.
format_scaled
Formats a scaled [Integer] back into a string in the given base, respecting decimal places, integer width, and fractional width.
parse_expr
Parses an expression with addition and subtraction.
parse_number
Backward-compatible wrapper parsing a numeric string to f64.
parse_power
Parses exponentiation operations (right-associative).
parse_primary
Parses primary tokens (numbers or parenthesized expressions).
parse_scaled
Backward-compatible wrapper parsing a scaled number.
parse_term
Parses a term with multiplication, division, integer division, and modulo.
parse_unary
Parses unary operators (+ or -).
tokenize_expression
Tokenizes a mathematical expression string into a sequence of MathTokens.
unicode_vulgar_fraction
Returns the numerator and denominator for Unicode vulgar fraction characters.