SplitScript reference / Language
Language
Compiler-owned syntax, declarations, lifecycle blocks, and contextual values.
Declarations
| Symbol | Description |
| class | Declares a typed managed class binding. |
| enum | Declares a nominal sum type. |
| fn | Declares a function or method. |
| image | Declares the managed types exposed by one runtime image. |
| layout | Declares attachment-wide build dimensions or a named state memory shape. |
| namespace | Declares a managed metadata namespace inside an image schema. |
| record | Declares an immutable nominal record. |
| settings | Declares live user settings. |
| state | Declares process attachment and persistent watched state. |
| tickRate | Overrides the lifecycle-owned polling rates. |
Lifecycle blocks
| Symbol | Description |
| gameTime | Reports the current game time when known. |
| isLoading | Reports loading state when known. |
| onAttach | Initializes one attached process. |
| onDetach | Handles closure of a previously attached process. |
| onReset | Reacts after the timer resets. |
| onStart | Reacts after the timer starts. |
| onStateReady | Initializes one committed state snapshot. |
| reset | Decides whether to reset the timer. |
| setup | Initializes one loaded script instance. |
| split | Decides whether to advance the current split. |
| start | Decides whether to start the timer. |
| whileAttached | Runs on every initialized attached update. |
Keywords
| Symbol | Description |
| as | Explicitly converts a value. |
| async | Marks an explicitly typed function result as asynchronous. |
| await | Waits for an asynchronous value and yields its result. |
| break | Exits the nearest enclosing loop. |
| continue | Starts the next iteration of the nearest enclosing loop. |
| debug | Keeps a development-only statement in debug builds. |
| else | Provides a branch or unwrap fallback. |
| for | Iterates over an array, set, or integer range. |
| if | Branches as a statement or expression. |
| let | Declares an inferred variable. |
| loop | Repeats a block until it breaks. |
| match | Exhaustively matches a value. |
| retry | Retries synchronous fallible work until it succeeds. |
| return | Returns from the current function or action. |
| self | Refers to the current method receiver. |
| throw | Transfers an error to the nearest failure boundary. |
| while | Repeats a block while its condition is true. |
Syntax
| Symbol | Description |
| != | Compares two values for inequality. |
| /// | Documents a source declaration, state field, setting, or heading. |
| == | Compares two values for equality. |
| ? | Propagates a T! error. |
| [T; N] | Names a garbage-collected array type. |
| array indexing | Reads an array element. |
| at | Reads a persistent state field through a pointer path. |
| callable type | Describes a first-class callable value. |
| choice setting | Declares an enum-backed setting choice. |
| closure | Creates a callable value with lexical captures. |
| End | Constructs an exhausted iterator step. |
| Err | Constructs a T! error. |
| file setting | Declares a file-selection setting. |
| from | Supplies one or more runtime metadata names for a managed declaration. |
| Item | Constructs a yielded iterator step. |
| maxLength | Bounds a managed string field read. |
| Ok | Explicitly constructs a successful result value. |
| range | Creates an explicitly exclusive or inclusive integer range. |
| settings family | Declares a finite family of boolean settings at compile time. |
| sig | Constructs a checked signature literal. |
| Some | Explicitly constructs a present optional value. |
| stable setting key | Assigns an explicit stable key in the host settings map. |
| static | Declares a managed field read through its class rather than an instance. |
| T! | Names a fallible result type. |
| T? | Names an optional type. |
| template string | Interpolates values into a String. |
| utf16le | Decodes a bounded native UTF-16LE string state field. |
| utf8 | Decodes a bounded native UTF-8 string state field. |
| v | Constructs a checked Windows file-version literal. |
| value block | Runs scoped statements and yields its final expression. |
Contextual values
| Symbol | Description |
| current | Accesses the current committed state snapshot. |
| old | Accesses the previous committed state snapshot. |
| oldSettings | Accesses the previous settings view. |