API reference
python:astx:astx.flows.SwitchStmt
class SwitchStmt
SwitchStmt(value: Expr, cases: list[CaseStmt] | ASTNodes[CaseStmt], loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/flows.py:1165
AST class for Switch statements based on Rust's match syntax.
Attributes
-
kind — Type: ASTKind
-
value — Type: Expr
-
cases — Type: ASTNodes[CaseStmt]
Methods
-
__init__ — Initialize the SwitchStmt instance.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.