arx.builtins
arx.builtins
Source: packages/arx/src/arx/builtins.py
title: Compiler builtin helpers and bundled builtin-module loader.Functions
is_builtin(name: str) -> bool
title: Check whether a function name is a parser-level built-in.
parameters:
name:
type: str
returns:
type: boolbuild_cast(value: astx.DataType, target_type: astx.DataType) -> irx_astx.Cast
title: Build an IRx Cast node.
parameters:
value:
type: astx.DataType
target_type:
type: astx.DataType
returns:
type: irx_astx.Castbuild_isinstance(value: astx.Expr, target_type: astx.DataType) -> irx_astx.IsInstanceExpr
title: Build an IRx IsInstanceExpr node.
parameters:
value:
type: astx.Expr
target_type:
type: astx.DataType
returns:
type: irx_astx.IsInstanceExprbuild_print(message: astx.Expr) -> irx_astx.PrintExpr
title: Build an IRx PrintExpr node.
parameters:
message:
type: astx.Expr
returns:
type: irx_astx.PrintExprbuild_type_of(value: astx.Expr) -> irx_astx.TypeOfExpr
title: Build an IRx TypeOfExpr node.
parameters:
value:
type: astx.Expr
returns:
type: irx_astx.TypeOfExpris_builtin_module_specifier(specifier: str) -> bool
title: Return whether one specifier targets the bundled builtins.
parameters:
specifier:
type: str
returns:
type: boollist_builtin_modules() -> tuple[str, ...]
title: List bundled builtin module names.
returns:
type: tuple[str, Ellipsis]resolve_builtin_resource(module_name: str) -> Traversable
title: Resolve one builtin logical module name to a packaged resource.
parameters:
module_name:
type: str
returns:
type: Traversableget_builtin_source(module_name: str) -> str
title: Return the bundled source text for one builtin module.
parameters:
module_name:
type: str
returns:
type: strload_builtin_module(specifier: str) -> BuiltinModuleAsset
title: Load one builtin module from packaged resources.
parameters:
specifier:
type: str
returns:
type: BuiltinModuleAssetget_ambient_builtin_imports(module_key: str) -> tuple[irx_astx.ImportFromStmt, ...]
title: Build the implicit builtin imports for one module.
parameters:
module_key:
type: str
returns:
type: tuple[irx_astx.ImportFromStmt, Ellipsis]Classes
BuiltinModuleAsset
title: One bundled builtin module asset.
attributes:
logical_name:
type: str
specifier:
type: str
origin:
type: str
source:
type: str
is_package:
type: boolAmbientBuiltinBinding
title: One compiler-injected builtin binding.
attributes:
name:
type: str
module:
type: str