Skip to content

builtins

Functions:

build_cast

build_cast(value: AST, target_type: DataType) -> Cast
Source code in src/arx/builtins.py
27
28
29
30
31
32
33
34
35
36
37
38
def build_cast(value: astx.AST, target_type: astx.DataType) -> system.Cast:
    """
    title: Build an IRX Cast node.
    parameters:
      value:
        type: astx.AST
      target_type:
        type: astx.DataType
    returns:
      type: system.Cast
    """
    return system.Cast(value=value, target_type=target_type)

build_print

build_print(message: Expr) -> PrintExpr
Source code in src/arx/builtins.py
41
42
43
44
45
46
47
48
49
50
def build_print(message: astx.Expr) -> system.PrintExpr:
    """
    title: Build an IRX PrintExpr node.
    parameters:
      message:
        type: astx.Expr
    returns:
      type: system.PrintExpr
    """
    return system.PrintExpr(message=message)

is_builtin

is_builtin(name: str) -> bool
Source code in src/arx/builtins.py
15
16
17
18
19
20
21
22
23
24
def is_builtin(name: str) -> bool:
    """
    title: Check whether a function name is a parser-level built-in.
    parameters:
      name:
        type: str
    returns:
      type: bool
    """
    return name in {BUILTIN_CAST, BUILTIN_PRINT}