module documentation

Various types used in the ACMEScript Interpreter

Class PCall A dataclass that holds call-specific attributes.
Class PError Error codes.
Class PState The internal states of a script.
Class SBooleanSymbol A boolean symbol that can be either "true" or "false".
Class SJsonSymbol A JSON symbol that can be used to store dictionaries or lists.
Class SLambdaSymbol A lambda expression symbol that can be used to store an anonymous function definition.
Class SListCharSymbol A list character symbol that can be either '(' or ')'. It is used to mark the beginning and end of a list in the interpreter.
Class SListQuoteSymbol A list of quoted elements that is not executed.
Class SListSymbol A list of SSymbol objects that can be used to store a list of elements. It is used to store a list of symbols, strings, numbers, or other lists.
Class SNilSymbol A NIL symbol that is used to represent the absence of a value. It is used to indicate that a variable or symbol has no value.
Class SNumberSymbol A number symbol that can be either an integer or a float. It is stored as a "Decimal" object for precision.
Class SStringSymbol A string symbol that can be used to store a string value.
Class SSymbol The basic class to store and handle symbols, lists, and values in the Interpreter.
Class SSymbolQuoteSymbol A quoted symbol that is not executed. It is used to store a symbol that is not evaluated, but can be referenced later.
Class SSymbolSymbol A symbol that is not quoted and can be used to store a symbol name. It is used to store a symbol that can be referenced or evaluated later.
Class STSymbol A True symbol that is used to represent the boolean value "true".
Class SType Type definitions for supported interpreter types.
Type Alias FunctionDefinition A data type that defines a defun function definition. The first tupple element is a list of argument names, and the second element is an SSymbol that is executed as the function body.
Type Alias PErrorLogCallable Function callback for error log functions.
Type Alias PFuncCallable Function callback for pre, post and error functions.
Type Alias PLogCallable Function callback for normal log functions.
Type Alias PMatchCallable Signature of a match function callable.
Type Alias PSymbolCallable Signature of a symbol callable. The callbacks are called with a PContext object and is supposed to return it again, updated with a return value, or None in case of an error.
Type Alias PSymbolDict Dictionary of function callbacks for commands.
Type Alias SSymbolsList Type definition for a list of SSymbol objects.
Variable PErrorState Named tuple that represents an error state.
FunctionDefinition =

A data type that defines a defun function definition. The first tupple element is a list of argument names, and the second element is an SSymbol that is executed as the function body.

Value
tuple[list[str], SSymbol]
PErrorLogCallable =

Function callback for error log functions.

Value
Callable[[PContext, str, Exception], None]
PFuncCallable =

Function callback for pre, post and error functions.

Value
Callable[[PContext], PContext]
PLogCallable =

Function callback for normal log functions.

Value
Callable[[PContext, str], None]
PMatchCallable =

Signature of a match function callable.

It will get called with the current PContext instance, a regular expression, and the string to check. It must return a boolean value that indicates the result of the match.

Value
Callable[[PContext, str, str], bool]
PSymbolCallable =

Signature of a symbol callable. The callbacks are called with a PContext object and is supposed to return it again, updated with a return value, or None in case of an error.

Value
Callable[[PContext, SSymbol], PContext]
PSymbolDict =

Dictionary of function callbacks for commands.

Value
dict[str, PSymbolCallable | SSymbol]
SSymbolsList =

Type definition for a list of SSymbol objects.

Value
list[SSymbol]
PErrorState =

Named tuple that represents an error state.

It contains the error code, the error message, the SSymbol expression that caused the error, and an (optional) exception.