pub struct IterableSet {
pub var: VariableKind,
pub iterator: Spanned<PreExp>,
pub span: InputSpan,
}
Expand description
Represents an iterable set expression in the intermediate language.
An iterable set binds a variable or tuple of variables to elements from an iterator expression.
For example: x in 1..10
or (a,b) in pairs(matrix)
.
Fields§
§var: VariableKind
The variable(s) being bound
iterator: Spanned<PreExp>
The iterator expression producing values
span: InputSpan
Source code location information
Implementations§
Source§impl IterableSet
impl IterableSet
Sourcepub fn new(
var: VariableKind,
iterator: Spanned<PreExp>,
span: InputSpan,
) -> Self
pub fn new( var: VariableKind, iterator: Spanned<PreExp>, span: InputSpan, ) -> Self
Creates a new IterableSet.
§Arguments
var
- The variable(s) to bind iterator values toiterator
- The iterator expressionspan
- Source location information
Sourcepub fn populate_token_type_map(
&self,
context: &mut TypeCheckerContext,
fn_context: &FunctionContext<'_>,
)
pub fn populate_token_type_map( &self, context: &mut TypeCheckerContext, fn_context: &FunctionContext<'_>, )
Populates type information for variables in the type checker context.
§Arguments
context
- The type checker context to populatefn_context
- Function context for type checking
Sourcepub fn variable_types(
&self,
context: &TypeCheckerContext,
fn_context: &FunctionContext<'_>,
) -> Result<Vec<(Spanned<String>, PrimitiveKind)>, TransformError>
pub fn variable_types( &self, context: &TypeCheckerContext, fn_context: &FunctionContext<'_>, ) -> Result<Vec<(Spanned<String>, PrimitiveKind)>, TransformError>
Trait Implementations§
Source§impl Clone for IterableSet
impl Clone for IterableSet
Source§fn clone(&self) -> IterableSet
fn clone(&self) -> IterableSet
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IterableSet
impl Debug for IterableSet
Source§impl Display for IterableSet
impl Display for IterableSet
Auto Trait Implementations§
impl Freeze for IterableSet
impl RefUnwindSafe for IterableSet
impl Send for IterableSet
impl Sync for IterableSet
impl Unpin for IterableSet
impl UnwindSafe for IterableSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more