BadFactor

com.phasmidsoftware.number.expression.parse.ExpressionParser.BadFactor
case class BadFactor(x: Expression) extends Factor

Represents a "bad factor" in an expression.

This class is used to indicate an invalid or erroneous factor within an expression. A "bad factor" effectively serves as a placeholder for scenarios where parsing or constructing a valid factor is not possible. It extends the Factor class, providing specific behavior for error handling and formatted display of the associated expression.

Value parameters

x

the associated expression that led to the creation of this "bad factor".

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def value: Try[Expression]

Computes the value of the factor but always results in a failure. The resulting failure contains a ParseException with a message composed of a newline followed by the formatted expression representation of the factor.

Computes the value of the factor but always results in a failure. The resulting failure contains a ParseException with a message composed of a newline followed by the formatted expression representation of the factor.

Attributes

Returns

a Try[Expression], which will always be a Failure containing a ParseException.

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product