33
export class Token {
34
constructor(
36
>
readonly kind: TokenKind,
37
>
/**
38
>
* If this token is an opening bracket, this is the id of the opening bracket.
39
>
* If this token is a closing bracket, this is the id of the first opening bracket that is closed by this bracket.
40
>
* Otherwise, it is -1.
41
>
*/
42
>
readonly bracketId: OpeningBracketId,
43
>
/**
44
>
* If this token is an opening bracket, this just contains `bracketId`.
45
>
* If this token is a closing bracket, this lists all opening bracket ids, that it closes.
46
>
* Otherwise, it is empty.
47
>
*/
48
>
readonly bracketIds: SmallImmutableSet<OpeningBracketId>,
49
>
readonly astNode: BracketAstNode | TextAstNode | undefined,
50
>
) { }
51
}
52