mutablecst
local mutablecst = require("@lute/syntax/mutablecst")WARNING
These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.
Summary
| Entry | Description |
|---|---|
| CstAttribute | A function attribute node (@checked, @native, or @deprecated). |
| CstElseIfExpr | An elseif clause in an if-else expression. |
| CstElseIfStat | An elseif clause in an if statement. |
| CstEof | The end-of-file token. |
| CstExpr | Union of all expression node types in the Luau CST. |
| CstExprBinary | A binary expression node (e.g., a + b). |
| CstExprCall | A function call expression node. |
| CstExprConstantBool | A boolean literal node (true or false). |
| CstExprConstantInteger | An integer literal node. |
| CstExprConstantNil | A nil literal node. |
| CstExprConstantNumber | A number literal node. |
| CstExprConstantString | A string literal node. |
| CstExprFunction | An anonymous function expression node. |
| CstExprGlobal | A reference to a global variable. |
| CstExprGroup | A parenthesized expression node. |
| CstExprIfElse | An if-else expression node. |
| CstExprIndexExpr | A bracketed index expression node (e.g., t[k]). |
| CstExprIndexName | A dot or colon index expression node (e.g., t.k or t:method). |
| CstExprInstantiate | An explicit generic instantiation expression node (e.g., f<<T>>). |
| CstExprInterpString | An interpolated string expression node (e.g., `hello {name}`). |
| CstExprLocal | A reference to a local variable. |
| CstExprTable | A table constructor expression node. |
| CstExprTypeAssertion | A type assertion expression node (e.g., x :: T). |
| CstExprUnary | A unary expression node (e.g., not x, -x, #x). |
| CstExprVarargs | A varargs expression node (...). |
| CstFunctionTypeParameter | A parameter in a function type annotation. |
| CstGenericType | A generic type parameter (e.g., T in function f<T>). |
| CstGenericTypePack | A generic type pack parameter (e.g., T... in function f<T...>). |
| CstLocal | A local variable binding site in the CST. |
| CstNode | Union of all node types in the Luau CST. |
| CstParseResult | The result of parsing a Luau script, containing the root block, EOF token, and source location info. |
| CstStat | Union of all statement node types in the Luau CST. |
| CstStatAssign | An assignment statement node. |
| CstStatBlock | A block statement node (a sequence of statements). |
| CstStatBreak | A break statement node. |
| CstStatCompoundAssign | A compound assignment statement node (e.g., x += 1). |
| CstStatConst | A const variable declaration statement node. |
| CstStatContinue | A continue statement node. |
| CstStatDo | A do...end block statement node. |
| CstStatExpr | A statement consisting of a bare expression (e.g., a function call used as a statement). |
| CstStatFor | A numeric for loop statement node. |
| CstStatForIn | A generic for...in loop statement node. |
| CstStatFunction | A function declaration statement node. |
| CstStatIf | An if...then...elseif...else...end statement node. |
| CstStatLocal | A local variable declaration statement node. |
| CstStatLocalFunction | A local function declaration statement node. |
| CstStatRepeat | A repeat...until loop statement node. |
| CstStatReturn | A return statement node. |
| CstStatTypeAlias | A type alias declaration statement node. |
| CstStatTypeFunction | A type function declaration statement node. |
| CstStatWhile | A while...do...end loop statement node. |
| CstTableExprGeneralItem | A table constructor entry with a computed key (e.g., [expr] = value). |
| CstTableExprItem | Union of all table constructor entry types. |
| CstTableExprListItem | A positional table constructor entry (e.g., value in { value }). |
| CstTableExprRecordItem | A named table constructor entry (e.g., key = value). |
| CstTableTypeItem | Union of all table type entry kinds. |
| CstTableTypeItemIndexer | A computed-key indexer entry in a table type (e.g., [K]: V). |
| CstTableTypeItemProperty | A named property entry in a table type (e.g., key: T). |
| CstType | Union of all type annotation node types in the Luau CST. |
| CstTypeArray | An array type annotation node (e.g., { T }). |
| CstTypeFunction | A function type annotation node. |
| CstTypeGroup | A parenthesized type annotation node. |
| CstTypeIntersection | An intersection type annotation node (e.g., A & B). |
| CstTypeOptional | An optional type annotation node (e.g., T?). |
| CstTypePack | Union of all type pack annotation node types in the Luau CST. |
| CstTypePackExplicit | An explicit type pack annotation node (e.g., (T, U)). |
| CstTypePackGeneric | A generic type pack annotation node (e.g., T...). |
| CstTypePackVariadic | A variadic type pack annotation node (e.g., ...T). |
| CstTypeReference | A named type reference node (e.g., string, MyType<T>). |
| CstTypeSingletonBool | A boolean singleton type node (true or false). |
| CstTypeSingletonString | A string singleton type node (e.g., "hello"). |
| CstTypeTable | A table type annotation node. |
| CstTypeTypeof | A typeof(expr) type annotation node. |
| CstTypeUnion | A union type annotation node (e.g., `A |
| MultiLineComment | A multi-line block comment trivia token (--[[...]]). |
| SingleLineComment | A single-line comment trivia token (--). |
| Span | A source location range, defined by begin and end line/column positions. |
| Trivia | Trivia attached to a token: whitespace or comments. |
| Whitespace | A whitespace trivia token. |
Types
CstAttribute
A function attribute node (@checked, @native, or @deprecated).
type CstAttribute = {
location: Span,
kind: "attribute",
name: CstToken<"@checked" | "@native" | "@deprecated">,
}CstElseIfExpr
An elseif clause in an if-else expression.
type CstElseIfExpr = {
elseIfKeyword: CstToken<"elseif">,
localKeyword: CstToken<"local" | "const">?,
conditionLocal: CstLocal?,
equals: CstToken<"=">?,
condition: CstExpr,
thenKeyword: CstToken<"then">,
thenExpr: CstExpr,
}CstElseIfStat
An elseif clause in an if statement.
type CstElseIfStat = {
elseIfKeyword: CstToken<"elseif">,
localKeyword: CstToken<"local" | "const">?,
conditionLocal: CstLocal?,
equals: CstToken<"=">?,
condition: CstExpr,
thenKeyword: CstToken<"then">,
thenBlock: CstStatBlock,
}CstEof
The end-of-file token.
type CstEof = CstToken<""> & { tag: "eof" }CstExpr
Union of all expression node types in the Luau CST.
type CstExpr =CstExprBinary
A binary expression node (e.g., a + b).
type CstExprBinary = {
location: Span,
kind: "expr",
tag: "binary",
lhsOperand: CstExpr,
operator: CstToken,
rhsOperand: CstExpr,
}CstExprCall
A function call expression node.
type CstExprCall = {
location: Span,
kind: "expr",
tag: "call",
func: CstExpr,
openParens: CstToken<"(">?,
arguments: CstPunctuated<CstExpr>,
closeParens: CstToken<")">?,
self: boolean,
argLocation: Span,
}CstExprConstantBool
A boolean literal node (true or false).
type CstExprConstantBool = {
location: Span,
kind: "expr",
tag: "boolean",
value: boolean,
token: CstToken<"true" | "false">,
}CstExprConstantInteger
An integer literal node.
type CstExprConstantInteger = {
location: Span,
kind: "expr",
tag: "integer",
value: number,
token: CstToken<string>,
}CstExprConstantNil
A nil literal node.
type CstExprConstantNil = {
location: Span,
kind: "expr",
tag: "nil",
token: CstToken<"nil">,
}CstExprConstantNumber
A number literal node.
type CstExprConstantNumber = {
location: Span,
kind: "expr",
tag: "number",
value: number,
token: CstToken<string>,
}CstExprConstantString
A string literal node.
type CstExprConstantString = {
location: Span,
kind: "expr",
tag: "string",
quoteStyle: "single" | "double" | "block" | "interp",
blockDepth: number,
value: CstToken<string>,
}CstExprFunction
An anonymous function expression node.
type CstExprFunction = {
location: Span,
kind: "expr",
tag: "function",
attributes: { CstAttribute },
functionKeyword: CstToken<"function">,
openGenerics: CstToken<"<">?,
generics: CstPunctuated<CstGenericType>,
genericPacks: CstPunctuated<CstGenericTypePack>,
closeGenerics: CstToken<">">?,
openParens: CstToken<"(">,
self: CstLocal?,
parameters: CstPunctuated<CstLocal>,
hasVararg: boolean, -- Present so AstExprFunction subtypes structurally against CstExprFunction
vararg: CstToken<"...">?,
varargColon: CstToken<":">?,
varargAnnotation: CstTypePack?,
closeParens: CstToken<")">,
returnSpecifier: CstToken<":">?,
returnAnnotation: CstTypePack?,
body: CstStatBlock,
endKeyword: CstToken<"end">,
}CstExprGlobal
A reference to a global variable.
type CstExprGlobal = { location: Span, kind: "expr", tag: "global", name: CstToken }CstExprGroup
A parenthesized expression node.
type CstExprGroup = {
location: Span,
kind: "expr",
tag: "group",
openParens: CstToken<"(">,
expression: CstExpr,
closeParens: CstToken<")">,
}CstExprIfElse
An if-else expression node.
type CstExprIfElse = {
location: Span,
kind: "expr",
tag: "conditional",
ifKeyword: CstToken<"if">,
localKeyword: CstToken<"local" | "const">?,
conditionLocal: CstLocal?,
equals: CstToken<"=">?,
condition: CstExpr,
thenKeyword: CstToken<"then">,
thenExpr: CstExpr,
elseifs: { CstElseIfExpr },
elseKeyword: CstToken<"else">,
elseExpr: CstExpr,
}CstExprIndexExpr
A bracketed index expression node (e.g., t[k]).
type CstExprIndexExpr = {
location: Span,
kind: "expr",
tag: "index",
expression: CstExpr,
openBrackets: CstToken<"[">,
index: CstExpr,
closeBrackets: CstToken<"]">,
}CstExprIndexName
A dot or colon index expression node (e.g., t.k or t:method).
type CstExprIndexName = {
location: Span,
kind: "expr",
tag: "indexname",
expression: CstExpr,
accessor: CstToken<"." | ":">,
index: CstToken<string>,
indexLocation: Span,
}CstExprInstantiate
An explicit generic instantiation expression node (e.g., f<<T>>).
type CstExprInstantiate = {
location: Span,
kind: "expr",
tag: "instantiate",
expr: CstExpr,
leftArrow1: CstToken<"<">,
leftArrow2: CstToken<"<">,
typeArguments: CstPunctuated<CstType | CstTypePack>,
rightArrow1: CstToken<">">,
rightArrow2: CstToken<">">,
}CstExprInterpString
An interpolated string expression node (e.g., `hello {name}`).
type CstExprInterpString = {
location: Span,
kind: "expr",
tag: "interpolatedstring",
strings: { CstToken<string> },
expressions: { CstExpr },
}CstExprLocal
A reference to a local variable.
type CstExprLocal = {
location: Span,
kind: "expr",
tag: "local",
token: CstToken<string>,
["local"]: CstLocal,
upvalue: boolean,
}CstExprTable
A table constructor expression node.
type CstExprTable = {
location: Span,
kind: "expr",
tag: "table",
openBrace: CstToken<"{">,
entries: { CstTableExprItem },
closeBrace: CstToken<"}">,
}CstExprTypeAssertion
A type assertion expression node (e.g., x :: T).
type CstExprTypeAssertion = {
location: Span,
kind: "expr",
tag: "cast",
operand: CstExpr,
operator: CstToken<"::">,
annotation: CstType,
}CstExprUnary
A unary expression node (e.g., not x, -x, #x).
type CstExprUnary = {
location: Span,
kind: "expr",
tag: "unary",
operator: CstToken<"not" | "-" | "#">,
operand: CstExpr,
}CstExprVarargs
A varargs expression node (...).
type CstExprVarargs = {
location: Span,
kind: "expr",
tag: "vararg",
token: CstToken<"...">,
}CstFunctionTypeParameter
A parameter in a function type annotation.
type CstFunctionTypeParameter = {
name: CstToken?,
colon: CstToken<":">?,
type: CstType,
}CstGenericType
A generic type parameter (e.g., T in function f<T>).
type CstGenericType = {
tag: "generic",
name: CstToken<string>,
equals: CstToken<"=">?,
default: CstType?,
}CstGenericTypePack
A generic type pack parameter (e.g., T... in function f<T...>).
type CstGenericTypePack = {
tag: "genericpack",
name: CstToken<string>,
ellipsis: CstToken<"...">,
equals: CstToken<"=">?,
default: CstTypePack?,
}CstLocal
A local variable binding site in the CST.
type CstLocal = {
location: Span,
kind: "local",
name: CstToken<string>,
colon: CstToken<":">?,
annotation: CstType?,
shadows: CstLocal?,
}CstNode
Union of all node types in the Luau CST.
type CstNode = CstExpr | CstStat | CstType | CstTypePack | CstLocal | CstAttribute | CstTokenCstParseResult
The result of parsing a Luau script, containing the root block, EOF token, and source location info.
type CstParseResult = {
root: CstStatBlock,
eof: CstEof,
lines: number,
lineOffsets: { number },
}CstStat
Union of all statement node types in the Luau CST.
type CstStat =CstStatAssign
An assignment statement node.
type CstStatAssign = {
location: Span,
kind: "stat",
tag: "assign",
variables: CstPunctuated<CstExpr>,
equals: CstToken<"=">,
values: CstPunctuated<CstExpr>,
}CstStatBlock
A block statement node (a sequence of statements).
type CstStatBlock = {
location: Span,
kind: "stat",
tag: "block",
statements: { CstStat },
}CstStatBreak
A break statement node.
type CstStatBreak = { location: Span, kind: "stat", tag: "break", token: CstToken<"break"> }CstStatCompoundAssign
A compound assignment statement node (e.g., x += 1).
type CstStatCompoundAssign = {
location: Span,
kind: "stat",
tag: "compoundassign",
variable: CstExpr,
operator: CstToken, -- TODO: Enforce token type
value: CstExpr,
}CstStatConst
A const variable declaration statement node.
type CstStatConst = {
location: Span,
kind: "stat",
tag: "const",
constKeyword: CstToken<"const">,
variables: CstPunctuated<CstLocal>,
equals: CstToken<"=">?,
values: CstPunctuated<CstExpr>,
}CstStatContinue
A continue statement node.
type CstStatContinue = {
location: Span,
kind: "stat",
tag: "continue",
token: CstToken<"continue">,
}CstStatDo
A do...end block statement node.
type CstStatDo = {
location: Span,
kind: "stat",
tag: "do",
doKeyword: CstToken<"do">,
body: CstStatBlock,
endKeyword: CstToken<"end">,
}CstStatExpr
A statement consisting of a bare expression (e.g., a function call used as a statement).
type CstStatExpr = {
location: Span,
kind: "stat",
tag: "expression",
expression: CstExpr,
}CstStatFor
A numeric for loop statement node.
type CstStatFor = {
location: Span,
kind: "stat",
tag: "for",
forKeyword: CstToken<"for">,
variable: CstLocal,
equals: CstToken<"=">,
from: CstExpr,
toComma: CstToken<",">,
to: CstExpr,
stepComma: CstToken<",">?,
step: CstExpr?,
doKeyword: CstToken<"do">,
body: CstStatBlock,
endKeyword: CstToken<"end">,
}CstStatForIn
A generic for...in loop statement node.
type CstStatForIn = {
location: Span,
kind: "stat",
tag: "forin",
forKeyword: CstToken<"for">,
variables: CstPunctuated<CstLocal>,
inKeyword: CstToken<"in">,
values: CstPunctuated<CstExpr>,
doKeyword: CstToken<"do">,
body: CstStatBlock,
endKeyword: CstToken<"end">,
}CstStatFunction
A function declaration statement node.
type CstStatFunction = {
location: Span,
kind: "stat",
tag: "function",
name: CstExpr,
func: CstExprFunction,
}CstStatIf
An if...then...elseif...else...end statement node.
type CstStatIf = {
location: Span,
kind: "stat",
tag: "conditional",
ifKeyword: CstToken<"if">,
localKeyword: CstToken<"local" | "const">?,
conditionLocal: CstLocal?,
equals: CstToken<"=">?,
condition: CstExpr,
thenKeyword: CstToken<"then">,
thenBlock: CstStatBlock,
elseifs: { CstElseIfStat },
elseKeyword: CstToken<"else">?, -- TODO: This could be elseif!
elseBlock: CstStatBlock?,
endKeyword: CstToken<"end">,
}CstStatLocal
A local variable declaration statement node.
type CstStatLocal = {
location: Span,
kind: "stat",
tag: "local",
localKeyword: CstToken<"local">,
variables: CstPunctuated<CstLocal>,
equals: CstToken<"=">?,
values: CstPunctuated<CstExpr>,
}CstStatLocalFunction
A local function declaration statement node.
type CstStatLocalFunction = {
location: Span,
kind: "stat",
tag: "localfunction",
localKeyword: CstToken<"local">,
name: CstLocal,
func: CstExprFunction,
}CstStatRepeat
A repeat...until loop statement node.
type CstStatRepeat = {
location: Span,
kind: "stat",
tag: "repeat",
repeatKeyword: CstToken<"repeat">,
body: CstStatBlock,
untilKeyword: CstToken<"until">,
condition: CstExpr,
}CstStatReturn
A return statement node.
type CstStatReturn = {
location: Span,
kind: "stat",
tag: "return",
returnKeyword: CstToken<"return">,
expressions: CstPunctuated<CstExpr>,
}CstStatTypeAlias
A type alias declaration statement node.
type CstStatTypeAlias = {
location: Span,
kind: "stat",
tag: "typealias",
isExported: boolean,
export: CstToken<"export">?,
typeToken: CstToken<"type">,
name: CstToken,
openGenerics: CstToken<"<">?,
generics: CstPunctuated<CstGenericType>?,
genericPacks: CstPunctuated<CstGenericTypePack>?,
closeGenerics: CstToken<">">?,
equals: CstToken<"=">,
type: CstType,
}CstStatTypeFunction
A type function declaration statement node.
type CstStatTypeFunction = {
location: Span,
kind: "stat",
tag: "typefunction",
isExported: boolean,
export: CstToken<"export">?,
type: CstToken<"type">,
name: CstToken,
body: CstExprFunction,
}CstStatWhile
A while...do...end loop statement node.
type CstStatWhile = {
location: Span,
kind: "stat",
tag: "while",
whileKeyword: CstToken<"while">,
condition: CstExpr,
doKeyword: CstToken<"do">,
body: CstStatBlock,
endKeyword: CstToken<"end">,
}CstTableExprGeneralItem
A table constructor entry with a computed key (e.g., [expr] = value).
type CstTableExprGeneralItem = {
location: Span,
kind: "general",
indexerOpen: CstToken<"[">,
key: CstExpr,
indexerClose: CstToken<"]">,
equals: CstToken<"=">,
value: CstExpr,
separator: CstToken<"," | ";">?,
isTableItem: true,
}CstTableExprItem
Union of all table constructor entry types.
type CstTableExprItem = CstTableExprListItem | CstTableExprRecordItem | CstTableExprGeneralItemCstTableExprListItem
A positional table constructor entry (e.g., value in { value }).
type CstTableExprListItem = {
location: Span,
kind: "list",
value: CstExpr,
separator: CstToken<"," | ";">?,
isTableItem: true,
}CstTableExprRecordItem
A named table constructor entry (e.g., key = value).
type CstTableExprRecordItem = {
location: Span,
kind: "record",
key: CstToken<string>,
equals: CstToken<"=">,
value: CstExpr,
separator: CstToken<"," | ";">?,
isTableItem: true,
}CstTableTypeItem
Union of all table type entry kinds.
type CstTableTypeItem = CstTableTypeItemIndexer | CstTableTypeItemPropertyCstTableTypeItemIndexer
A computed-key indexer entry in a table type (e.g., [K]: V).
type CstTableTypeItemIndexer = {
kind: "indexer",
access: CstToken<"read" | "write">?,
indexerOpen: CstToken<"[">,
key: CstType,
indexerClose: CstToken<"]">,
colon: CstToken<":">,
value: CstType,
separator: CstToken<"," | ";">?,
}CstTableTypeItemProperty
A named property entry in a table type (e.g., key: T).
type CstTableTypeItemProperty = {
kind: "property",
access: CstToken<"read" | "write">?,
indexerOpen: CstToken<"[">?,
quoteStyle: ("single" | "double")?,
key: CstToken,
indexerClose: CstToken<"]">?,
colon: CstToken<":">,
value: CstType,
separator: CstToken<"," | ";">?,
}CstType
Union of all type annotation node types in the Luau CST.
type CstType =CstTypeArray
An array type annotation node (e.g., { T }).
type CstTypeArray = {
location: Span,
kind: "type",
tag: "array",
openBrace: CstToken<"{">,
access: CstToken<"read" | "write">?,
type: CstType,
closeBrace: CstToken<"}">,
}CstTypeFunction
A function type annotation node.
type CstTypeFunction = {
location: Span,
kind: "type",
tag: "function",
openGenerics: CstToken<"<">?,
generics: CstPunctuated<CstGenericType>?,
genericPacks: CstPunctuated<CstGenericTypePack>?,
closeGenerics: CstToken<">">?,
openParens: CstToken<"(">,
parameters: CstPunctuated<CstFunctionTypeParameter>,
vararg: CstTypePack?,
closeParens: CstToken<")">,
returnArrow: CstToken<"->">,
returnTypes: CstTypePack,
}CstTypeGroup
A parenthesized type annotation node.
type CstTypeGroup = {
location: Span,
kind: "type",
tag: "group",
openParens: CstToken<"(">,
type: CstType,
closeParens: CstToken<")">,
}CstTypeIntersection
An intersection type annotation node (e.g., A & B).
type CstTypeIntersection = {
location: Span,
kind: "type",
tag: "intersection",
leading: CstToken<"&">?,
types: CstPunctuated<CstType, "&">,
}CstTypeOptional
An optional type annotation node (e.g., T?).
type CstTypeOptional =CstTypePack
Union of all type pack annotation node types in the Luau CST.
type CstTypePack = CstTypePackExplicit | CstTypePackGeneric | CstTypePackVariadicCstTypePackExplicit
An explicit type pack annotation node (e.g., (T, U)).
type CstTypePackExplicit = {
location: Span,
kind: "typepack",
tag: "explicit",
openParens: CstToken<"(">?,
types: CstPunctuated<CstType>,
tailType: CstTypePack?,
closeParens: CstToken<")">?,
}CstTypePackGeneric
A generic type pack annotation node (e.g., T...).
type CstTypePackGeneric = {
location: Span,
kind: "typepack",
tag: "generic",
name: CstToken,
ellipsis: CstToken<"...">,
}CstTypePackVariadic
A variadic type pack annotation node (e.g., ...T).
type CstTypePackVariadic = {
location: Span,
kind: "typepack",
tag: "variadic",
--- May be nil when present as the vararg annotation in a function body
ellipsis: CstToken<"...">?,
type: CstType,
}CstTypeReference
A named type reference node (e.g., string, MyType<T>).
type CstTypeReference = {
location: Span,
kind: "type",
tag: "reference",
prefix: CstToken<string>?,
prefixPoint: CstToken<".">?,
name: CstToken<string>,
openParameters: CstToken<"<">?,
parameters: CstPunctuated<CstType | CstTypePack>?,
closeParameters: CstToken<">">?,
}CstTypeSingletonBool
A boolean singleton type node (true or false).
type CstTypeSingletonBool = {
location: Span,
kind: "type",
tag: "boolean",
value: boolean,
token: CstToken<"true" | "false">,
}CstTypeSingletonString
A string singleton type node (e.g., "hello").
type CstTypeSingletonString = {
location: Span,
kind: "type",
tag: "string",
quoteStyle: "single" | "double",
value: CstToken<string>,
}CstTypeTable
A table type annotation node.
type CstTypeTable = {
location: Span,
kind: "type",
tag: "table",
openBrace: CstToken<"{">,
entries: { CstTableTypeItem },
closeBrace: CstToken<"}">,
}CstTypeTypeof
A typeof(expr) type annotation node.
type CstTypeTypeof = {
location: Span,
kind: "type",
tag: "typeof",
typeof: CstToken<"typeof">,
openParens: CstToken<"(">,
expression: CstExpr,
closeParens: CstToken<")">,
}CstTypeUnion
A union type annotation node (e.g., A | B).
type CstTypeUnion = {
location: Span,
kind: "type",
tag: "union",
leading: CstToken<"|">?,
-- Separator may be nil for CstTypeOptional
types: CstPunctuated<CstType, "|">,
}MultiLineComment
A multi-line block comment trivia token (--[[...]]).
type MultiLineComment = {
tag: "blockcomment",
location: Span,
text: string,
-- TODO: depth: number,
}SingleLineComment
A single-line comment trivia token (--).
type SingleLineComment = {
tag: "comment",
location: Span,
text: string,
}Span
A source location range, defined by begin and end line/column positions.
type Span = setmetatable<SpanData, SpanMT>Trivia
Trivia attached to a token: whitespace or comments.
type Trivia = Whitespace | SingleLineComment | MultiLineCommentWhitespace
A whitespace trivia token.
type Whitespace = {
tag: "whitespace",
location: Span,
text: string,
}