arx.parser.exceptions
arx.parser.exceptions
Source: packages/arx/src/arx/parser/exceptions.py
title: Statement-only exception syntax.
summary: >-
Preserve clause indentation and raise operand locations while constructing
language-independent ASTx nodes. IRx decides exception identities and
validity.Classes
ExceptionParserMixin(ParserMixinBase)
title: Parse raising and structured exception regions.Methods
parse_statement(self) -> astx.AST
title: Keep exception statements out of expression operands.
returns:
type: astx.ASTexception_expression(self) -> astx.Expr
title: Require an expression rather than a statement-valued operand.
returns:
type: astx.Exprparse_raise_stmt(self) -> astx.ThrowStmt
title: Parse an optional exception and optional explicit cause.
returns:
type: astx.ThrowStmtexception_clause(self, indentation: int) -> TokenKind | None
title: Consume line markers only when a same-level clause follows.
parameters:
indentation:
type: int
returns:
type: TokenKind | Noneexception_type_reference(self) -> astx.Expr
title: Parse a nominal or module-qualified handler type reference.
returns:
type: astx.Exprparse_except_clause(self) -> astx.CatchHandlerStmt
title: Parse a handler with optional nominal types and local binding.
returns:
type: astx.CatchHandlerStmtparse_try_stmt(self) -> astx.ExceptionHandlerStmt
title: Parse ordered handlers, optional else, and optional finally.
returns:
type: astx.ExceptionHandlerStmt