ExpressionParser

com.phasmidsoftware.number.parse.ExpressionParser

The ExpressionParser object provides utilities for parsing and processing LaTeX-like mathematical expressions, leveraging string interpolation. These utilities enable creation, simplification, and evaluation of mathematical expressions represented as Expression objects.

TODO instead of throwing exceptions we should return a ParseError object.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def parse(string: String): Expression

Parses a LaTeX-like mathematical expression from the provided string and returns an Expression object.

Parses a LaTeX-like mathematical expression from the provided string and returns an Expression object.

Value parameters

string

the input string containing the LaTeX-like expression to be parsed.

Attributes

Returns

an Expression object parsed from the input string, or a Noop on failure. Throws a LaTeXParserException if the input is not fully consumed.

Extensions

Extensions

extension (inline sc: StringContext)
inline def fuzzymath(args: Any*): Eager

Like math, but applies fuzzy evaluation.

Like math, but applies fuzzy evaluation.

Attributes

inline def lazymath(args: Any*): Expression
inline def math(args: Any*): Eager

Parses and materializes a LaTeX-like expression into an Eager value.

Parses and materializes a LaTeX-like expression into an Eager value.

Attributes

inline def mathOpt(args: Any*): Option[Eager]

Like math, but returns None if evaluation fails.

Like math, but returns None if evaluation fails.

Attributes

inline def puremath(args: Any*): Expression

Parses a LaTeX-like math expression from the provided parts and arguments, constructing an Expression object.

Parses a LaTeX-like math expression from the provided parts and arguments, constructing an Expression object.

Attributes