Enum Primary Copy item path Source pub enum Primary {
Literal(Literal ),
Paren(Paren ),
Block(Block ),
If(If ),
Loop(Loop ),
While(While ),
Break(Break ),
Continue(Continue ),
Call(Call ),
}Expand description Represents a primary expression in CalcScript.
Primary expressions are the simplest expressions, and are the building blocks of more complex
expressions. Primary expressions are also self-contained. This means that primary expressions
within a larger expression can be replaced with equivalent, but different kinds of primary
expressions, and the larger expression will still be valid.
A parenthesized expression, such as (1 + 2).
A blocked expression, such as {1 + 2}.
An if expression, such as if x > 0 then x else -x.
A loop expression, as in loop { ... }.
A while loop expression, as in while x > 0 then { ... }.
A break expression, used to exit a loop, optionally with a value.
A continue expression, used to skip the rest of a loop iteration.
A function call, such as abs(-1).
Returns the span of the primary expression.
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Converts to this type from the input type.
Parses a value from the given stream of tokens, advancing the stream past the consumed
tokens if parsing is successful.
Read more Parses a value from the given stream of tokens, advancing the stream past the consumed
tokens if parsing is successful.
Read more Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.