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§
source§impl 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>
Available on crate feature roblox
only.
pub fn type_specifier(&self) -> Option<&TypeSpecifier>
roblox
only.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
Available on crate feature roblox
only.
pub fn with_type_specifier(self, type_specifier: Option<TypeSpecifier>) -> Self
roblox
only.Returns a new NumericFor with the given type specifiers Only available when the “roblox” feature flag is enabled.
Trait Implementations§
source§impl Clone for NumericFor
impl Clone for NumericFor
source§fn clone(&self) -> NumericFor
fn clone(&self) -> NumericFor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NumericFor
impl Debug for NumericFor
source§impl<'de> Deserialize<'de> for NumericFor
impl<'de> Deserialize<'de> for NumericFor
source§fn 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>,
source§impl Display for NumericFor
impl Display for NumericFor
source§impl Node for NumericFor
impl Node for NumericFor
source§fn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
source§fn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
source§fn similar(&self, other: &Self) -> bool
fn similar(&self, other: &Self) -> bool
source§impl PartialEq for NumericFor
impl PartialEq for NumericFor
source§fn eq(&self, other: &NumericFor) -> bool
fn eq(&self, other: &NumericFor) -> bool
self
and other
values to be equal, and is used
by ==
.