API reference
python:arxjit:arxjit.validation
module validation
arxjit.validation
Source: packages/arxjit/src/arxjit/validation.py:1
Python-subset validation for arxjit.
Second stage of the arxjit pipeline: walk the ast node produced by arxjit.source and check it only uses the v1 supported subset of pure Python (typed scalar arguments, arithmetic/comparison/boolean expressions, single- target local assignments, if/else, while, for over range, return). Dispatch is by node type via plum, matching the visitor convention used across the Arx packages. Every rejected construct is collected into its own Diagnostic so a function using several unsupported constructs reports all of them at once via UnsupportedSyntaxError; lowering the accepted subset to astx is a later stage and is not done here.
Attributes
-
_SCOPE_NODES — Scope nodes.; Type: tuple[type[ast.AST], ...]
-
_ALLOWED_BINOPS — Allowed binops.; Type: tuple[type[ast.operator], ...]
-
_ALLOWED_UNARYOPS — Allowed unaryops.; Type: tuple[type[ast.unaryop], ...]
-
_ALLOWED_COMPAREOPS — Allowed compareops.; Type: tuple[type[ast.cmpop], ...]
-
_UNSUPPORTED_MESSAGES — Unsupported messages.; Type: dict[type[ast.AST], str]
Functions
- validate — Validate that a function uses only the supported Python subset.