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 luau
only.
pub fn type_specifiers(&self) -> impl Iterator<Item = Option<&TypeSpecifier>>
luau
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 “luau” 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 luau
only.
pub fn with_type_specifiers( self, type_specifiers: Vec<Option<TypeSpecifier>>, ) -> Self
luau
only.Returns a new GenericFor with the given type specifiers Only available when the “luau” 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 more