#[non_exhaustive]pub enum LangErr {
Show 19 variants
InvalidQuit,
InvalidStore,
DivByZero(usize),
ExpIsNotIntOrOneHalf(usize),
ExpDivByZero(usize),
ModZero(usize),
ModIsNotInt(usize),
NotNonNegIntFact(usize),
InvalidDec(usize),
NotEnoughPrevResults(usize),
InvalidAbs(usize),
InvalidPar(usize),
InvalidRound(usize),
MissingTerm(usize),
SqrtDoesNotExist(usize),
TrailingSyms(usize),
InvalidRand(usize),
RandInvalidArgs(usize),
RandNoInts(usize),
}
Expand description
Error due to a language violation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidQuit
The input began with a q
but had non-whitespace
that followed it.
InvalidStore
The input began with an s
but had non-whitespace
that followed it.
DivByZero(usize)
A sub-expression in the input would have led to a division by zero.
ExpIsNotIntOrOneHalf(usize)
A sub-expression in the input would have led to a rational number that was not 0 or 1 to be raised to a non-integer power that is not (+/-) 1/2.
ExpDivByZero(usize)
A sub-expression in the input would have led to 0 being raised to a negative power which itself would have led to a division by zero.
ModZero(usize)
A sub-expression in the input would have led to a number modulo 0.
ModIsNotInt(usize)
A sub-expression in the input would have led to the mod of two expressions with at least one not being an integer.
NotNonNegIntFact(usize)
A sub-expression in the input would have led to a non-integer factorial or a negative integer factorial.
InvalidDec(usize)
The input contained a non-empty sequence of digits followed
by .
which was not followed by a non-empty sequence of digits.
NotEnoughPrevResults(usize)
A recall expression was used to recall the i-th most-recent stored result, but there are fewer than i stored where i ∈ {1, 2, 3, 4, 5, 6, 7, 8}.
InvalidAbs(usize)
The input did not contain a closing |
.
InvalidPar(usize)
The input did not contain a closing )
.
InvalidRound(usize)
The input contained an invalid round expression.
MissingTerm(usize)
A sub-expression in the input had a missing terminal expression where a terminal expression is a decimal literal expression, recall expression, absolute value expression, parenthetical expression, or round expression.
SqrtDoesNotExist(usize)
The expression that was passed to the square root does not have a solution in the field of rational numbers.
TrailingSyms(usize)
The input started with a valid expression but was immediately followed by symbols that could not be chained with the preceding expression.
InvalidRand(usize)
rand
only.The input contained an invalid random expression.
RandInvalidArgs(usize)
rand
only.Error when the second argument is less than first in the rand function.
RandNoInts(usize)
rand
only.Error when there are no 64-bit integers in the interval passed to the random function.