SplitScript reference / Language

Language

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

Declarations

SymbolDescription
classDeclares a typed managed class binding.
conditional fieldsDeclares fields whose availability follows an ordinary enum value.
enumDeclares a nominal sum type.
fnDeclares a function or method.
imageDeclares the managed types exposed by one runtime image.
namespaceDeclares a managed metadata namespace inside an image schema.
settingsDeclares live user settings.
stateDeclares process attachment and persistent watched state.
structDeclares an immutable nominal structure.
tickRateOverrides the lifecycle-owned polling rates.

Lifecycle blocks

SymbolDescription
gameTimeReports the current game time when known.
isLoadingReports loading state when known.
onAttachInitializes one state-provider attachment.
onDetachHandles the end of a successfully initialized state-provider attachment.
onResetReacts after the timer resets.
onStartReacts after the timer starts.
onStateReadyInitializes one committed state snapshot.
resetDecides whether to reset the timer.
selectProcessChooses among same-name process candidates.
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.
isTests a value against a pattern.
iteratorNames the type-erased synchronous iterator over T.
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.
yieldSuspends a generator after producing one item.

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.
array rest patternMatches a variable-length middle of an array.
atReads a persistent state field through a pointer path.
binding patternDestructures one value into local names where a declaration cannot fail.
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.
providerDeclares one named runtime alternative inside a multi-provider state.
rangeDescribes an explicitly exclusive or inclusive integer interval.
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.
text input settingDeclares a free-form text-input setting.
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.