Struct full_moon::ast::NumericFor
source · [−]pub struct NumericFor { /* private fields */ }
Expand description
A numeric for loop, such as for index = 1, 10 do end
Implementations
sourceimpl NumericFor
impl NumericFor
sourcepub fn new(
index_variable: TokenReference,
start: Expression,
end: Expression
) -> Self
pub fn new(
index_variable: TokenReference,
start: Expression,
end: Expression
) -> Self
Creates a new NumericFor from the given index variable, start, and end expressions
sourcepub fn for_token(&self) -> &TokenReference
pub fn for_token(&self) -> &TokenReference
The for
token
sourcepub fn index_variable(&self) -> &TokenReference
pub fn index_variable(&self) -> &TokenReference
The index identity, index
in the initial example
sourcepub fn equal_token(&self) -> &TokenReference
pub fn equal_token(&self) -> &TokenReference
The =
token
sourcepub fn start(&self) -> &Expression
pub fn start(&self) -> &Expression
The starting point, 1
in the initial example
sourcepub fn start_end_comma(&self) -> &TokenReference
pub fn start_end_comma(&self) -> &TokenReference
The comma in between the starting point and end point for _ = 1, 10 do ^
sourcepub fn end(&self) -> &Expression
pub fn end(&self) -> &Expression
The ending point, 10
in the initial example
sourcepub fn end_step_comma(&self) -> Option<&TokenReference>
pub fn end_step_comma(&self) -> Option<&TokenReference>
The comma in between the ending point and limit, if one exists for _ = 0, 10, 2 do ^
sourcepub fn step(&self) -> Option<&Expression>
pub fn step(&self) -> Option<&Expression>
The step if one exists, 2
in for index = 0, 10, 2 do end
sourcepub fn do_token(&self) -> &TokenReference
pub fn do_token(&self) -> &TokenReference
The do
token
sourcepub fn end_token(&self) -> &TokenReference
pub fn end_token(&self) -> &TokenReference
The end
token
sourcepub fn type_specifier(&self) -> Option<&TypeSpecifier>
pub fn type_specifier(&self) -> Option<&TypeSpecifier>
The type specifiers of the index variable
for i: number = 1, 10 do
returns:
Some(TypeSpecifier(number))
Only available when the “roblox” feature flag is enabled.
sourcepub fn with_for_token(self, for_token: TokenReference) -> Self
pub fn with_for_token(self, for_token: TokenReference) -> Self
Returns a new NumericFor with the given for token
sourcepub fn with_index_variable(self, index_variable: TokenReference) -> Self
pub fn with_index_variable(self, index_variable: TokenReference) -> Self
Returns a new NumericFor with the given index variable
sourcepub fn with_equal_token(self, equal_token: TokenReference) -> Self
pub fn with_equal_token(self, equal_token: TokenReference) -> Self
Returns a new NumericFor with the given =
token
sourcepub fn with_start(self, start: Expression) -> Self
pub fn with_start(self, start: Expression) -> Self
Returns a new NumericFor with the given start expression
sourcepub fn with_start_end_comma(self, start_end_comma: TokenReference) -> Self
pub fn with_start_end_comma(self, start_end_comma: TokenReference) -> Self
Returns a new NumericFor with the given comma between the start and end expressions
sourcepub fn with_end(self, end: Expression) -> Self
pub fn with_end(self, end: Expression) -> Self
Returns a new NumericFor with the given end expression
sourcepub fn with_end_step_comma(self, end_step_comma: Option<TokenReference>) -> Self
pub fn with_end_step_comma(self, end_step_comma: Option<TokenReference>) -> Self
Returns a new NumericFor with the given comma between the end and the step expressions
sourcepub fn with_step(self, step: Option<Expression>) -> Self
pub fn with_step(self, step: Option<Expression>) -> Self
Returns a new NumericFor with the given step expression
sourcepub fn with_do_token(self, do_token: TokenReference) -> Self
pub fn with_do_token(self, do_token: TokenReference) -> Self
Returns a new NumericFor with the given do
token
sourcepub fn with_block(self, block: Block) -> Self
pub fn with_block(self, block: Block) -> Self
Returns a new NumericFor with the given block
sourcepub fn with_end_token(self, end_token: TokenReference) -> Self
pub fn with_end_token(self, end_token: TokenReference) -> Self
Returns a new NumericFor with the given end
token
sourcepub fn with_type_specifier(self, type_specifier: Option<TypeSpecifier>) -> Self
pub fn with_type_specifier(self, type_specifier: Option<TypeSpecifier>) -> Self
Returns a new NumericFor with the given type specifiers Only available when the “roblox” feature flag is enabled.
Trait Implementations
sourceimpl Clone for NumericFor
impl Clone for NumericFor
sourcefn clone(&self) -> NumericFor
fn clone(&self) -> NumericFor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for NumericFor
impl Debug for NumericFor
sourceimpl<'de> Deserialize<'de> for NumericFor
impl<'de> Deserialize<'de> for NumericFor
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for NumericFor
impl Display for NumericFor
sourceimpl Node for NumericFor
impl Node for NumericFor
sourcefn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
sourcefn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
sourcefn similar(&self, other: &Self) -> bool
fn similar(&self, other: &Self) -> bool
Whether another node of the same type is the same as this one semantically, ignoring position
sourcefn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
fn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
The token references that comprise a node
sourceimpl PartialEq<NumericFor> for NumericFor
impl PartialEq<NumericFor> for NumericFor
sourcefn eq(&self, other: &NumericFor) -> bool
fn eq(&self, other: &NumericFor) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &NumericFor) -> bool
fn ne(&self, other: &NumericFor) -> bool
This method tests for !=
.
sourceimpl Serialize for NumericFor
impl Serialize for NumericFor
impl StructuralPartialEq for NumericFor
Auto Trait Implementations
impl RefUnwindSafe for NumericFor
impl Send for NumericFor
impl Sync for NumericFor
impl Unpin for NumericFor
impl UnwindSafe for NumericFor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more