ASTStatementSwitch class

ASTStatement for switch (exp) { case v: ... break; default: ... }.

With fallThrough (the default, C-style switch): once a case matches, its block and the blocks of the following clauses run in order until a break (or return). With fallThrough false (e.g. Kotlin when, Python match): only the matched clause runs — there is no fall-through and break is implicit. If no case matches, the default clause (if present) runs.

Inheritance

Constructors

ASTStatementSwitch(ASTExpression expression, List<ASTSwitchCase> cases, {bool fallThrough = true})

Properties

cases List<ASTSwitchCase>
final
children Iterable<ASTNode>
The children nodes of this node.
no setteroverride
descendantChildren List<ASTNode>
Return the children and it's descendant children (unmodifiable).
no setterinherited
expression ASTExpression
final
fallThrough bool
Whether matched clauses fall through to the next clause (C-style).
final
hashCode int
The hash code for this object.
no setterinherited
parentNode ASTNode?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

associateToType(ASTTypedNode node) → void
inherited
cacheDescendantChildren() → void
Mark that this node can cache its descendantChildren.
inherited
defineRunContext(VMContext parentContext) VMContext
override
getNodeIdentifier(String name, {ASTNode? requester}) ASTNode?
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveNode(ASTNode? parentNode) → void
override
resolveRuntimeType(VMContext context, ASTNode? node) FutureOr<ASTType>
inherited
resolveType(VMContext? context) ASTType
override
run(VMContext parentContext, ASTRunStatus runStatus) FutureOr<ASTValue>
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited