irx.analysis.validation
irx.analysis.validation
Source: packages/irx/src/irx/analysis/validation.py
title: Validation helpers for semantic analysis.
summary: >-
Collect the focused validation routines that emit diagnostics for
assignments, calls, casts, and temporal literals.Functions
validate_assignment(diagnostics: DiagnosticBag, *, target_name: str, target_type: astx.DataType | None, value_type: astx.DataType | None, node: astx.AST) -> None
title: Validate an assignment.
parameters:
diagnostics:
type: DiagnosticBag
target_name:
type: str
target_type:
type: astx.DataType | None
value_type:
type: astx.DataType | None
node:
type: astx.ASTvalidate_call(diagnostics: DiagnosticBag, *, function: SemanticFunction, arg_types: list[astx.DataType | None], node: astx.BaseMethodCall | astx.FunctionCall | astx.MethodCall | astx.StaticMethodCall | astx.WithStmt) -> CallResolution
title: Validate a function call.
parameters:
diagnostics:
type: DiagnosticBag
function:
type: SemanticFunction
arg_types:
type: list[astx.DataType | None]
node:
type: >-
astx.BaseMethodCall | astx.FunctionCall | astx.MethodCall |
astx.StaticMethodCall | astx.WithStmt
returns:
type: CallResolutionresolve_return(diagnostics: DiagnosticBag, *, function: SemanticFunction, value: astx.AST | None, value_type: astx.DataType | None, node: astx.FunctionReturn) -> ReturnResolution
title: Validate one return statement.
parameters:
diagnostics:
type: DiagnosticBag
function:
type: SemanticFunction
value:
type: astx.AST | None
value_type:
type: astx.DataType | None
node:
type: astx.FunctionReturn
returns:
type: ReturnResolutionvalidate_cast(diagnostics: DiagnosticBag, *, source_type: astx.DataType | None, target_type: astx.DataType | None, node: astx.AST) -> None
title: Validate a cast expression.
parameters:
diagnostics:
type: DiagnosticBag
source_type:
type: astx.DataType | None
target_type:
type: astx.DataType | None
node:
type: astx.ASTvalidate_literal_time(value: str) -> time
title: Validate an astx time literal.
parameters:
value:
type: str
returns:
type: timevalidate_literal_timestamp(value: str) -> datetime
title: Validate an astx timestamp literal.
parameters:
value:
type: str
returns:
type: datetimevalidate_literal_datetime(value: str) -> datetime
title: Validate an astx datetime literal.
parameters:
value:
type: str
returns:
type: datetimevalidate_calendar_date(value: str) -> date
title: Validate a date component.
parameters:
value:
type: str
returns:
type: date