Structs
Enums
Traits
- A trait that, when implemented for a type T, implements a method that, given a string, outputs a matching element of T if applicable. Also, whitespace and strings starting with whitespace can never be a match, as starting whitespace is always ignored by the parser.
Functions
- As expected, read a formula from a string. Return error if the string is malformed.
- Recursively build a tree from a slice of symbols.
- In a slice of logical symbols, find the lowest precedence operator, i.e. the main operator that’s not in parentheses. Also basically validates the slice of symbols. Parentheses are treated as black boxes, so if the whole formula is wrapped in parentheses it may be valid but this method will return an error!
strip_parenthesesfirst. - A utility for stripping outer parentheses from a slice of symbols if applicable. This also catches unbalanced parentheses in a slice.