Struct full_moon::ast::GenericFor
source · pub struct GenericFor { /* private fields */ }
Expand description
A generic for loop, such as for index, value in pairs(list) do end
Implementations§
source§impl GenericFor
impl GenericFor
sourcepub fn new(
names: Punctuated<TokenReference>,
expr_list: Punctuated<Expression>
) -> Self
pub fn new( names: Punctuated<TokenReference>, expr_list: Punctuated<Expression> ) -> Self
Creates a new GenericFor from the given names and expressions
sourcepub fn for_token(&self) -> &TokenReference
pub fn for_token(&self) -> &TokenReference
The for
token
sourcepub fn names(&self) -> &Punctuated<TokenReference>
pub fn names(&self) -> &Punctuated<TokenReference>
Returns the punctuated sequence of names
In for index, value in pairs(list) do
, iterates over index
and value
sourcepub fn in_token(&self) -> &TokenReference
pub fn in_token(&self) -> &TokenReference
The in
token
sourcepub fn expressions(&self) -> &Punctuated<Expression>
pub fn expressions(&self) -> &Punctuated<Expression>
Returns the punctuated sequence of the expressions looped over
In for index, value in pairs(list) do
, iterates over pairs(list)
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_specifiers(&self) -> impl Iterator<Item = Option<&TypeSpecifier>>
Available on crate feature roblox
only.
pub fn type_specifiers(&self) -> impl Iterator<Item = Option<&TypeSpecifier>>
roblox
only.The type specifiers of the named variables, in the order that they were assigned.
for i, v: string in pairs() do
returns an iterator containing:
None, Some(TypeSpecifier(string))
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 GenericFor with the given for
token
sourcepub fn with_names(self, names: Punctuated<TokenReference>) -> Self
pub fn with_names(self, names: Punctuated<TokenReference>) -> Self
Returns a new GenericFor with the given names
sourcepub fn with_in_token(self, in_token: TokenReference) -> Self
pub fn with_in_token(self, in_token: TokenReference) -> Self
Returns a new GenericFor with the given in
token
sourcepub fn with_expressions(self, expr_list: Punctuated<Expression>) -> Self
pub fn with_expressions(self, expr_list: Punctuated<Expression>) -> Self
Returns a new GenericFor with the given expression list
sourcepub fn with_do_token(self, do_token: TokenReference) -> Self
pub fn with_do_token(self, do_token: TokenReference) -> Self
Returns a new GenericFor with the given do
token
sourcepub fn with_block(self, block: Block) -> Self
pub fn with_block(self, block: Block) -> Self
Returns a new GenericFor 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 GenericFor with the given end
token
sourcepub fn with_type_specifiers(
self,
type_specifiers: Vec<Option<TypeSpecifier>>
) -> Self
Available on crate feature roblox
only.
pub fn with_type_specifiers( self, type_specifiers: Vec<Option<TypeSpecifier>> ) -> Self
roblox
only.Returns a new GenericFor with the given type specifiers Only available when the “roblox” feature flag is enabled.
Trait Implementations§
source§impl Clone for GenericFor
impl Clone for GenericFor
source§fn clone(&self) -> GenericFor
fn clone(&self) -> GenericFor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GenericFor
impl Debug for GenericFor
source§impl<'de> Deserialize<'de> for GenericFor
impl<'de> Deserialize<'de> for GenericFor
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 GenericFor
impl Display for GenericFor
source§impl Node for GenericFor
impl Node for GenericFor
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 GenericFor
impl PartialEq for GenericFor
source§fn eq(&self, other: &GenericFor) -> bool
fn eq(&self, other: &GenericFor) -> bool
self
and other
values to be equal, and is used
by ==
.