SplitScript reference / Language

Language

Compiler-owned syntax, declarations, lifecycle blocks, and contextual values.

Declarations

SymbolDescription
classDeclares a typed managed class binding.
enumDeclares a nominal sum type.
fnDeclares a function or method.
imageDeclares the managed types exposed by one runtime image.
layoutDeclares attachment-wide build dimensions or a named state memory shape.
namespaceDeclares a managed metadata namespace inside an image schema.
recordDeclares an immutable nominal record.
settingsDeclares live user settings.
stateDeclares process attachment and persistent watched state.
tickRateOverrides the lifecycle-owned polling rates.

Lifecycle blocks

SymbolDescription
gameTimeReports the current game time when known.
isLoadingReports loading state when known.
onAttachInitializes one attached process.
onDetachHandles closure of a previously attached process.
onResetReacts after the timer resets.
onStartReacts after the timer starts.
onStateReadyInitializes one committed state snapshot.
resetDecides whether to reset the timer.
setupInitializes one loaded script instance.
splitDecides whether to advance the current split.
startDecides whether to start the timer.
whileAttachedRuns on every initialized attached update.

Keywords

SymbolDescription
asExplicitly converts a value.
asyncMarks an explicitly typed function result as asynchronous.
awaitWaits for an asynchronous value and yields its result.
breakExits the nearest enclosing loop.
continueStarts the next iteration of the nearest enclosing loop.
debugKeeps a development-only statement in debug builds.
elseProvides a branch or unwrap fallback.
forIterates over an array, set, or integer range.
ifBranches as a statement or expression.
letDeclares an inferred variable.
loopRepeats a block until it breaks.
matchExhaustively matches a value.
retryRetries synchronous fallible work until it succeeds.
returnReturns from the current function or action.
selfRefers to the current method receiver.
throwTransfers an error to the nearest failure boundary.
whileRepeats a block while its condition is true.

Syntax

SymbolDescription
!=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 indexingReads an array element.
atReads a persistent state field through a pointer path.
callable typeDescribes a first-class callable value.
choice settingDeclares an enum-backed setting choice.
closureCreates a callable value with lexical captures.
EndConstructs an exhausted iterator step.
ErrConstructs a T! error.
file settingDeclares a file-selection setting.
fromSupplies one or more runtime metadata names for a managed declaration.
ItemConstructs a yielded iterator step.
maxLengthBounds a managed string field read.
OkExplicitly constructs a successful result value.
rangeCreates an explicitly exclusive or inclusive integer range.
settings familyDeclares a finite family of boolean settings at compile time.
sigConstructs a checked signature literal.
SomeExplicitly constructs a present optional value.
stable setting keyAssigns an explicit stable key in the host settings map.
staticDeclares a managed field read through its class rather than an instance.
T!Names a fallible result type.
T?Names an optional type.
template stringInterpolates values into a String.
utf16leDecodes a bounded native UTF-16LE string state field.
utf8Decodes a bounded native UTF-8 string state field.
vConstructs a checked Windows file-version literal.
value blockRuns scoped statements and yields its final expression.

Contextual values

SymbolDescription
currentAccesses the current committed state snapshot.
oldAccesses the previous committed state snapshot.
oldSettingsAccesses the previous settings view.