dot-language-support 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -10,244 +10,340 @@ function createMapFromTemplate(template) {
10
10
  }
11
11
 
12
12
  // src/types.ts
13
- var ErrorSource = /* @__PURE__ */ ((ErrorSource2) => {
14
- ErrorSource2[ErrorSource2["Scan"] = 1] = "Scan";
15
- ErrorSource2[ErrorSource2["Parse"] = 2] = "Parse";
16
- ErrorSource2[ErrorSource2["Check"] = 4] = "Check";
17
- return ErrorSource2;
18
- })(ErrorSource || {});
19
- var ParseError = /* @__PURE__ */ ((ParseError2) => {
20
- ParseError2[ParseError2["ExpectationFailed"] = 0] = "ExpectationFailed";
21
- ParseError2[ParseError2["TrailingData"] = 1] = "TrailingData";
22
- ParseError2[ParseError2["FailedListParsing"] = 2] = "FailedListParsing";
23
- return ParseError2;
24
- })(ParseError || {});
25
- var ScanError = /* @__PURE__ */ ((ScanError2) => {
26
- ScanError2[ScanError2["ExpectationFailed"] = 0] = "ExpectationFailed";
27
- ScanError2[ScanError2["Unterminated"] = 1] = "Unterminated";
28
- return ScanError2;
29
- })(ScanError || {});
30
- var CheckError = /* @__PURE__ */ ((CheckError2) => {
31
- CheckError2[CheckError2["InvalidEdgeOperation"] = 0] = "InvalidEdgeOperation";
32
- CheckError2[CheckError2["InvalidShapeName"] = 1] = "InvalidShapeName";
33
- return CheckError2;
34
- })(CheckError || {});
35
- var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => {
36
- DiagnosticCategory2[DiagnosticCategory2["Error"] = 1] = "Error";
37
- DiagnosticCategory2[DiagnosticCategory2["Warning"] = 2] = "Warning";
38
- DiagnosticCategory2[DiagnosticCategory2["Message"] = 3] = "Message";
39
- DiagnosticCategory2[DiagnosticCategory2["Suggestion"] = 4] = "Suggestion";
40
- return DiagnosticCategory2;
41
- })(DiagnosticCategory || {});
42
- var SyntaxKind = /* @__PURE__ */ ((SyntaxKind2) => {
43
- SyntaxKind2[SyntaxKind2["Unknown"] = 0] = "Unknown";
44
- SyntaxKind2[SyntaxKind2["EndOfFileToken"] = 1] = "EndOfFileToken";
45
- SyntaxKind2[SyntaxKind2["NewLineTrivia"] = 2] = "NewLineTrivia";
46
- SyntaxKind2[SyntaxKind2["WhitespaceTrivia"] = 3] = "WhitespaceTrivia";
47
- SyntaxKind2[SyntaxKind2["HashCommentTrivia"] = 4] = "HashCommentTrivia";
48
- SyntaxKind2[SyntaxKind2["SingleLineCommentTrivia"] = 5] = "SingleLineCommentTrivia";
49
- SyntaxKind2[SyntaxKind2["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia";
50
- SyntaxKind2[SyntaxKind2["CommaToken"] = 7] = "CommaToken";
51
- SyntaxKind2[SyntaxKind2["SemicolonToken"] = 8] = "SemicolonToken";
52
- SyntaxKind2[SyntaxKind2["PlusToken"] = 9] = "PlusToken";
53
- SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 10] = "OpenBraceToken";
54
- SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 11] = "CloseBraceToken";
55
- SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 12] = "OpenBracketToken";
56
- SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 13] = "CloseBracketToken";
57
- SyntaxKind2[SyntaxKind2["ColonToken"] = 14] = "ColonToken";
58
- SyntaxKind2[SyntaxKind2["EqualsToken"] = 15] = "EqualsToken";
59
- SyntaxKind2[SyntaxKind2["LessThan"] = 16] = "LessThan";
60
- SyntaxKind2[SyntaxKind2["GreaterThan"] = 17] = "GreaterThan";
61
- SyntaxKind2[SyntaxKind2["CompassNorthToken"] = 18] = "CompassNorthToken";
62
- SyntaxKind2[SyntaxKind2["CompassNorthEastToken"] = 19] = "CompassNorthEastToken";
63
- SyntaxKind2[SyntaxKind2["CompassEastToken"] = 20] = "CompassEastToken";
64
- SyntaxKind2[SyntaxKind2["CompassSouthEastToken"] = 21] = "CompassSouthEastToken";
65
- SyntaxKind2[SyntaxKind2["CompassSouthToken"] = 22] = "CompassSouthToken";
66
- SyntaxKind2[SyntaxKind2["CompassSouthWestToken"] = 23] = "CompassSouthWestToken";
67
- SyntaxKind2[SyntaxKind2["CompassWestToken"] = 24] = "CompassWestToken";
68
- SyntaxKind2[SyntaxKind2["CompassNorthWestToken"] = 25] = "CompassNorthWestToken";
69
- SyntaxKind2[SyntaxKind2["CompassCenterToken"] = 26] = "CompassCenterToken";
70
- SyntaxKind2[SyntaxKind2["UnderscoreToken"] = 27] = "UnderscoreToken";
71
- SyntaxKind2[SyntaxKind2["StringLiteral"] = 28] = "StringLiteral";
72
- SyntaxKind2[SyntaxKind2["HtmlIdentifier"] = 29] = "HtmlIdentifier";
73
- SyntaxKind2[SyntaxKind2["TextIdentifier"] = 30] = "TextIdentifier";
74
- SyntaxKind2[SyntaxKind2["QuotedTextIdentifier"] = 31] = "QuotedTextIdentifier";
75
- SyntaxKind2[SyntaxKind2["NumericIdentifier"] = 32] = "NumericIdentifier";
76
- SyntaxKind2[SyntaxKind2["GraphKeyword"] = 33] = "GraphKeyword";
77
- SyntaxKind2[SyntaxKind2["DigraphKeyword"] = 34] = "DigraphKeyword";
78
- SyntaxKind2[SyntaxKind2["NodeKeyword"] = 35] = "NodeKeyword";
79
- SyntaxKind2[SyntaxKind2["EdgeKeyword"] = 36] = "EdgeKeyword";
80
- SyntaxKind2[SyntaxKind2["SubgraphKeyword"] = 37] = "SubgraphKeyword";
81
- SyntaxKind2[SyntaxKind2["StrictKeyword"] = 38] = "StrictKeyword";
82
- SyntaxKind2[SyntaxKind2["DirectedEdgeOp"] = 39] = "DirectedEdgeOp";
83
- SyntaxKind2[SyntaxKind2["UndirectedEdgeOp"] = 40] = "UndirectedEdgeOp";
84
- SyntaxKind2[SyntaxKind2["DirectedGraph"] = 41] = "DirectedGraph";
85
- SyntaxKind2[SyntaxKind2["UndirectedGraph"] = 42] = "UndirectedGraph";
86
- SyntaxKind2[SyntaxKind2["NodeStatement"] = 43] = "NodeStatement";
87
- SyntaxKind2[SyntaxKind2["EdgeStatement"] = 44] = "EdgeStatement";
88
- SyntaxKind2[SyntaxKind2["AttributeStatement"] = 45] = "AttributeStatement";
89
- SyntaxKind2[SyntaxKind2["IdEqualsIdStatement"] = 46] = "IdEqualsIdStatement";
90
- SyntaxKind2[SyntaxKind2["SubGraph"] = 47] = "SubGraph";
91
- SyntaxKind2[SyntaxKind2["SubGraphStatement"] = 48] = "SubGraphStatement";
92
- SyntaxKind2[SyntaxKind2["EdgeRhs"] = 49] = "EdgeRhs";
93
- SyntaxKind2[SyntaxKind2["AttributeContainer"] = 50] = "AttributeContainer";
94
- SyntaxKind2[SyntaxKind2["Assignment"] = 51] = "Assignment";
95
- SyntaxKind2[SyntaxKind2["NormalPortDeclaration"] = 52] = "NormalPortDeclaration";
96
- SyntaxKind2[SyntaxKind2["CompassPortDeclaration"] = 53] = "CompassPortDeclaration";
97
- SyntaxKind2[SyntaxKind2["NodeId"] = 54] = "NodeId";
98
- SyntaxKind2[SyntaxKind2["Count"] = 55] = "Count";
99
- SyntaxKind2[SyntaxKind2["FirstNode"] = 41 /* DirectedGraph */] = "FirstNode";
100
- SyntaxKind2[SyntaxKind2["CompassBegin"] = 18 /* CompassNorthToken */] = "CompassBegin";
101
- SyntaxKind2[SyntaxKind2["CompassEnd"] = 27 /* UnderscoreToken */] = "CompassEnd";
102
- SyntaxKind2[SyntaxKind2["LastKeyword"] = 38 /* StrictKeyword */] = "LastKeyword";
103
- return SyntaxKind2;
104
- })(SyntaxKind || {});
105
- var SyntaxNodeFlags = /* @__PURE__ */ ((SyntaxNodeFlags2) => {
106
- SyntaxNodeFlags2[SyntaxNodeFlags2["None"] = 0] = "None";
107
- SyntaxNodeFlags2[SyntaxNodeFlags2["ContainsErrors"] = 2] = "ContainsErrors";
108
- SyntaxNodeFlags2[SyntaxNodeFlags2["Synthesized"] = 4] = "Synthesized";
109
- return SyntaxNodeFlags2;
110
- })(SyntaxNodeFlags || {});
111
- var GraphContext = /* @__PURE__ */ ((GraphContext2) => {
112
- GraphContext2[GraphContext2["None"] = 0] = "None";
113
- GraphContext2[GraphContext2["Strict"] = 2] = "Strict";
114
- GraphContext2[GraphContext2["Directed"] = 4] = "Directed";
115
- GraphContext2[GraphContext2["Undirected"] = 8] = "Undirected";
116
- return GraphContext2;
117
- })(GraphContext || {});
118
- var TokenFlags = /* @__PURE__ */ ((TokenFlags2) => {
119
- TokenFlags2[TokenFlags2["None"] = 0] = "None";
120
- TokenFlags2[TokenFlags2["Unterminated"] = 2] = "Unterminated";
121
- TokenFlags2[TokenFlags2["PrecedingLineBreak"] = 4] = "PrecedingLineBreak";
122
- return TokenFlags2;
123
- })(TokenFlags || {});
124
- var CharacterCodes = /* @__PURE__ */ ((CharacterCodes2) => {
125
- CharacterCodes2[CharacterCodes2["nullCharacter"] = 0] = "nullCharacter";
126
- CharacterCodes2[CharacterCodes2["maxAsciiCharacter"] = 127] = "maxAsciiCharacter";
127
- CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
128
- CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
129
- CharacterCodes2[CharacterCodes2["lineSeparator"] = 8232] = "lineSeparator";
130
- CharacterCodes2[CharacterCodes2["paragraphSeparator"] = 8233] = "paragraphSeparator";
131
- CharacterCodes2[CharacterCodes2["nextLine"] = 133] = "nextLine";
132
- CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
133
- CharacterCodes2[CharacterCodes2["nonBreakingSpace"] = 160] = "nonBreakingSpace";
134
- CharacterCodes2[CharacterCodes2["enQuad"] = 8192] = "enQuad";
135
- CharacterCodes2[CharacterCodes2["emQuad"] = 8193] = "emQuad";
136
- CharacterCodes2[CharacterCodes2["enSpace"] = 8194] = "enSpace";
137
- CharacterCodes2[CharacterCodes2["emSpace"] = 8195] = "emSpace";
138
- CharacterCodes2[CharacterCodes2["threePerEmSpace"] = 8196] = "threePerEmSpace";
139
- CharacterCodes2[CharacterCodes2["fourPerEmSpace"] = 8197] = "fourPerEmSpace";
140
- CharacterCodes2[CharacterCodes2["sixPerEmSpace"] = 8198] = "sixPerEmSpace";
141
- CharacterCodes2[CharacterCodes2["figureSpace"] = 8199] = "figureSpace";
142
- CharacterCodes2[CharacterCodes2["punctuationSpace"] = 8200] = "punctuationSpace";
143
- CharacterCodes2[CharacterCodes2["thinSpace"] = 8201] = "thinSpace";
144
- CharacterCodes2[CharacterCodes2["hairSpace"] = 8202] = "hairSpace";
145
- CharacterCodes2[CharacterCodes2["zeroWidthSpace"] = 8203] = "zeroWidthSpace";
146
- CharacterCodes2[CharacterCodes2["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace";
147
- CharacterCodes2[CharacterCodes2["ideographicSpace"] = 12288] = "ideographicSpace";
148
- CharacterCodes2[CharacterCodes2["mathematicalSpace"] = 8287] = "mathematicalSpace";
149
- CharacterCodes2[CharacterCodes2["ogham"] = 5760] = "ogham";
150
- CharacterCodes2[CharacterCodes2["_"] = 95] = "_";
151
- CharacterCodes2[CharacterCodes2["$"] = 36] = "$";
152
- CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
153
- CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
154
- CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
155
- CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
156
- CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
157
- CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
158
- CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
159
- CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
160
- CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
161
- CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
162
- CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
163
- CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
164
- CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
165
- CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
166
- CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
167
- CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
168
- CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
169
- CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
170
- CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
171
- CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
172
- CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
173
- CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
174
- CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
175
- CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
176
- CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
177
- CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
178
- CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
179
- CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
180
- CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
181
- CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
182
- CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
183
- CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
184
- CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
185
- CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
186
- CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
187
- CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
188
- CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
189
- CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
190
- CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
191
- CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
192
- CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
193
- CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
194
- CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
195
- CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
196
- CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
197
- CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
198
- CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
199
- CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
200
- CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
201
- CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
202
- CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
203
- CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
204
- CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
205
- CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
206
- CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
207
- CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
208
- CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
209
- CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
210
- CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
211
- CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
212
- CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
213
- CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
214
- CharacterCodes2[CharacterCodes2["ampersand"] = 38] = "ampersand";
215
- CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
216
- CharacterCodes2[CharacterCodes2["at"] = 64] = "at";
217
- CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
218
- CharacterCodes2[CharacterCodes2["backtick"] = 96] = "backtick";
219
- CharacterCodes2[CharacterCodes2["bar"] = 124] = "bar";
220
- CharacterCodes2[CharacterCodes2["caret"] = 94] = "caret";
221
- CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
222
- CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
223
- CharacterCodes2[CharacterCodes2["closeParen"] = 41] = "closeParen";
224
- CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
225
- CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
226
- CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
227
- CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
228
- CharacterCodes2[CharacterCodes2["equals"] = 61] = "equals";
229
- CharacterCodes2[CharacterCodes2["exclamation"] = 33] = "exclamation";
230
- CharacterCodes2[CharacterCodes2["greaterThan"] = 62] = "greaterThan";
231
- CharacterCodes2[CharacterCodes2["hash"] = 35] = "hash";
232
- CharacterCodes2[CharacterCodes2["lessThan"] = 60] = "lessThan";
233
- CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
234
- CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
235
- CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
236
- CharacterCodes2[CharacterCodes2["openParen"] = 40] = "openParen";
237
- CharacterCodes2[CharacterCodes2["percent"] = 37] = "percent";
238
- CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
239
- CharacterCodes2[CharacterCodes2["question"] = 63] = "question";
240
- CharacterCodes2[CharacterCodes2["semicolon"] = 59] = "semicolon";
241
- CharacterCodes2[CharacterCodes2["singleQuote"] = 39] = "singleQuote";
242
- CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
243
- CharacterCodes2[CharacterCodes2["tilde"] = 126] = "tilde";
244
- CharacterCodes2[CharacterCodes2["backspace"] = 8] = "backspace";
245
- CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
246
- CharacterCodes2[CharacterCodes2["byteOrderMark"] = 65279] = "byteOrderMark";
247
- CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
248
- CharacterCodes2[CharacterCodes2["verticalTab"] = 11] = "verticalTab";
249
- return CharacterCodes2;
250
- })(CharacterCodes || {});
13
+ var errorSource = {
14
+ Scan: 1,
15
+ Parse: 2,
16
+ Check: 4
17
+ };
18
+ var parseError = {
19
+ ExpectationFailed: 0,
20
+ TrailingData: 1,
21
+ FailedListParsing: 2
22
+ };
23
+ var scanError = {
24
+ ExpectationFailed: 0,
25
+ Unterminated: 1
26
+ };
27
+ var checkError = {
28
+ InvalidEdgeOperation: 0,
29
+ InvalidShapeName: 1
30
+ };
31
+ var diagnosticCategory = {
32
+ Error: 1,
33
+ Warning: 2,
34
+ Message: 3,
35
+ Suggestion: 4
36
+ };
37
+ var syntaxKind = {
38
+ Unknown: 0,
39
+ EndOfFileToken: 1,
40
+ NewLineTrivia: 2,
41
+ WhitespaceTrivia: 3,
42
+ HashCommentTrivia: 4,
43
+ SingleLineCommentTrivia: 5,
44
+ MultiLineCommentTrivia: 6,
45
+ CommaToken: 7,
46
+ SemicolonToken: 8,
47
+ PlusToken: 9,
48
+ OpenBraceToken: 10,
49
+ CloseBraceToken: 11,
50
+ OpenBracketToken: 12,
51
+ CloseBracketToken: 13,
52
+ ColonToken: 14,
53
+ EqualsToken: 15,
54
+ LessThan: 16,
55
+ GreaterThan: 17,
56
+ CompassNorthToken: 18,
57
+ CompassNorthEastToken: 19,
58
+ CompassEastToken: 20,
59
+ CompassSouthEastToken: 21,
60
+ CompassSouthToken: 22,
61
+ CompassSouthWestToken: 23,
62
+ CompassWestToken: 24,
63
+ CompassNorthWestToken: 25,
64
+ CompassCenterToken: 26,
65
+ UnderscoreToken: 27,
66
+ StringLiteral: 28,
67
+ HtmlIdentifier: 29,
68
+ TextIdentifier: 30,
69
+ QuotedTextIdentifier: 31,
70
+ // Contains multiple "QuotedTextIdentifier" for concatenation with +
71
+ NumericIdentifier: 32,
72
+ GraphKeyword: 33,
73
+ DigraphKeyword: 34,
74
+ NodeKeyword: 35,
75
+ EdgeKeyword: 36,
76
+ SubgraphKeyword: 37,
77
+ StrictKeyword: 38,
78
+ DirectedEdgeOp: 39,
79
+ UndirectedEdgeOp: 40,
80
+ DirectedGraph: 41,
81
+ UndirectedGraph: 42,
82
+ NodeStatement: 43,
83
+ EdgeStatement: 44,
84
+ AttributeStatement: 45,
85
+ IdEqualsIdStatement: 46,
86
+ SubGraph: 47,
87
+ SubGraphStatement: 48,
88
+ EdgeRhs: 49,
89
+ AttributeContainer: 50,
90
+ Assignment: 51,
91
+ NormalPortDeclaration: 52,
92
+ CompassPortDeclaration: 53,
93
+ NodeId: 54,
94
+ Count: 55,
95
+ // Number of items in this enum
96
+ FirstNode: 41,
97
+ // DirectedGraph
98
+ CompassBegin: 18,
99
+ // CompassNorthToken,
100
+ CompassEnd: 27,
101
+ // UnderscoreToken,
102
+ LastKeyword: 38
103
+ // StrictKeyword,
104
+ // Identifier: QuotedTextIdentifier | HtmlIdentifier | TextIdentifier | NumericIdentifier,
105
+ };
106
+ var syntaxKindNames = {
107
+ 0: "Unknown",
108
+ 1: "EndOfFileToken",
109
+ 2: "NewLineTrivia",
110
+ 3: "WhitespaceTrivia",
111
+ 4: "HashCommentTrivia",
112
+ 5: "SingleLineCommentTrivia",
113
+ 6: "MultiLineCommentTrivia",
114
+ 7: "CommaToken",
115
+ 8: "SemicolonToken",
116
+ 9: "PlusToken",
117
+ 10: "OpenBraceToken",
118
+ 11: "CloseBraceToken",
119
+ 12: "OpenBracketToken",
120
+ 13: "CloseBracketToken",
121
+ 14: "ColonToken",
122
+ 15: "EqualsToken",
123
+ 16: "LessThan",
124
+ 17: "GreaterThan",
125
+ 18: "CompassNorthToken",
126
+ 19: "CompassNorthEastToken",
127
+ 20: "CompassEastToken",
128
+ 21: "CompassSouthEastToken",
129
+ 22: "CompassSouthToken",
130
+ 23: "CompassSouthWestToken",
131
+ 24: "CompassWestToken",
132
+ 25: "CompassNorthWestToken",
133
+ 26: "CompassCenterToken",
134
+ 27: "UnderscoreToken",
135
+ 28: "StringLiteral",
136
+ 29: "HtmlIdentifier",
137
+ 30: "TextIdentifier",
138
+ 31: "QuotedTextIdentifier",
139
+ // Contains multiple "QuotedTextIdentifier" for concatenation with +
140
+ 32: "NumericIdentifier",
141
+ 33: "GraphKeyword",
142
+ 34: "DigraphKeyword",
143
+ 35: "NodeKeyword",
144
+ 36: "EdgeKeyword",
145
+ 37: "SubgraphKeyword",
146
+ 38: "StrictKeyword",
147
+ 39: "DirectedEdgeOp",
148
+ 40: "UndirectedEdgeOp",
149
+ 41: "DirectedGraph",
150
+ 42: "UndirectedGraph",
151
+ 43: "NodeStatement",
152
+ 44: "EdgeStatement",
153
+ 45: "AttributeStatement",
154
+ 46: "IdEqualsIdStatement",
155
+ 47: "SubGraph",
156
+ 48: "SubGraphStatement",
157
+ 49: "EdgeRhs",
158
+ 50: "AttributeContainer",
159
+ 51: "Assignment",
160
+ 52: "NormalPortDeclaration",
161
+ 53: "CompassPortDeclaration",
162
+ 54: "NodeId",
163
+ 55: "Count"
164
+ // Number of items in this enum
165
+ };
166
+ var syntaxNodeFlags = {
167
+ None: 0,
168
+ ContainsErrors: 1 << 1,
169
+ Synthesized: 1 << 2
170
+ };
171
+ var graphContext = {
172
+ None: 0,
173
+ Strict: 1 << 1,
174
+ Directed: 1 << 2,
175
+ Undirected: 1 << 3
176
+ };
177
+ var tokenFlags = {
178
+ None: 0,
179
+ Unterminated: 1 << 1,
180
+ PrecedingLineBreak: 1 << 2
181
+ };
182
+ var characterCodes = {
183
+ nullCharacter: 0,
184
+ maxAsciiCharacter: 127,
185
+ lineFeed: 10,
186
+ // \n
187
+ carriageReturn: 13,
188
+ // \r
189
+ lineSeparator: 8232,
190
+ paragraphSeparator: 8233,
191
+ nextLine: 133,
192
+ // Unicode 3.0 space characters
193
+ space: 32,
194
+ // " "
195
+ nonBreakingSpace: 160,
196
+ //
197
+ enQuad: 8192,
198
+ emQuad: 8193,
199
+ enSpace: 8194,
200
+ emSpace: 8195,
201
+ threePerEmSpace: 8196,
202
+ fourPerEmSpace: 8197,
203
+ sixPerEmSpace: 8198,
204
+ figureSpace: 8199,
205
+ punctuationSpace: 8200,
206
+ thinSpace: 8201,
207
+ hairSpace: 8202,
208
+ zeroWidthSpace: 8203,
209
+ narrowNoBreakSpace: 8239,
210
+ ideographicSpace: 12288,
211
+ mathematicalSpace: 8287,
212
+ ogham: 5760,
213
+ _: 95,
214
+ $: 36,
215
+ _0: 48,
216
+ _1: 49,
217
+ _2: 50,
218
+ _3: 51,
219
+ _4: 52,
220
+ _5: 53,
221
+ _6: 54,
222
+ _7: 55,
223
+ _8: 56,
224
+ _9: 57,
225
+ a: 97,
226
+ b: 98,
227
+ c: 99,
228
+ d: 100,
229
+ e: 101,
230
+ f: 102,
231
+ g: 103,
232
+ h: 104,
233
+ i: 105,
234
+ j: 106,
235
+ k: 107,
236
+ l: 108,
237
+ m: 109,
238
+ n: 110,
239
+ o: 111,
240
+ p: 112,
241
+ q: 113,
242
+ r: 114,
243
+ s: 115,
244
+ t: 116,
245
+ u: 117,
246
+ v: 118,
247
+ w: 119,
248
+ x: 120,
249
+ y: 121,
250
+ z: 122,
251
+ A: 65,
252
+ B: 66,
253
+ C: 67,
254
+ D: 68,
255
+ E: 69,
256
+ F: 70,
257
+ G: 71,
258
+ H: 72,
259
+ I: 73,
260
+ J: 74,
261
+ K: 75,
262
+ L: 76,
263
+ M: 77,
264
+ N: 78,
265
+ O: 79,
266
+ P: 80,
267
+ Q: 81,
268
+ R: 82,
269
+ S: 83,
270
+ T: 84,
271
+ U: 85,
272
+ V: 86,
273
+ W: 87,
274
+ X: 88,
275
+ Y: 89,
276
+ Z: 90,
277
+ ampersand: 38,
278
+ // &
279
+ asterisk: 42,
280
+ // *
281
+ at: 64,
282
+ // @
283
+ backslash: 92,
284
+ // \
285
+ backtick: 96,
286
+ // `
287
+ bar: 124,
288
+ // |
289
+ caret: 94,
290
+ // ^
291
+ closeBrace: 125,
292
+ // }
293
+ closeBracket: 93,
294
+ // ]
295
+ closeParen: 41,
296
+ // )
297
+ colon: 58,
298
+ // :
299
+ comma: 44,
300
+ // ,
301
+ dot: 46,
302
+ // .
303
+ doubleQuote: 34,
304
+ // "
305
+ equals: 61,
306
+ // =
307
+ exclamation: 33,
308
+ // !
309
+ greaterThan: 62,
310
+ // >
311
+ hash: 35,
312
+ // #
313
+ lessThan: 60,
314
+ // <
315
+ minus: 45,
316
+ // -
317
+ openBrace: 123,
318
+ // {
319
+ openBracket: 91,
320
+ // [
321
+ openParen: 40,
322
+ // (
323
+ percent: 37,
324
+ // %
325
+ plus: 43,
326
+ // +
327
+ question: 63,
328
+ // ?
329
+ semicolon: 59,
330
+ // ;
331
+ singleQuote: 39,
332
+ // '
333
+ slash: 47,
334
+ // /
335
+ tilde: 126,
336
+ // ~
337
+ backspace: 8,
338
+ // \b
339
+ formFeed: 12,
340
+ // \f
341
+ byteOrderMark: 65279,
342
+ tab: 9,
343
+ // \t
344
+ verticalTab: 11
345
+ // \v
346
+ };
251
347
 
252
348
  // src/service/util.ts
253
349
  function getStart(sourceFile, node) {
@@ -258,7 +354,7 @@ function getTokenPosOfNode(sourceFile, node) {
258
354
  return skipTrivia(sourceFile.content, node.pos);
259
355
  }
260
356
  function nodeIsMissing(node) {
261
- return node === void 0 ? true : node.pos === node.end && node.pos >= 0 && node.kind !== 1 /* EndOfFileToken */;
357
+ return node === void 0 ? true : node.pos === node.end && node.pos >= 0 && node.kind !== syntaxKind.EndOfFileToken;
262
358
  }
263
359
  function syntaxNodesToRanges(doc, sourceFile, nodes) {
264
360
  return nodes.map((node) => syntaxNodeToRange(doc, sourceFile, node));
@@ -287,35 +383,35 @@ function assertNever(v) {
287
383
 
288
384
  // src/scanner.ts
289
385
  var textToToken = createMapFromTemplate({
290
- digraph: 34 /* DigraphKeyword */,
291
- graph: 33 /* GraphKeyword */,
292
- edge: 36 /* EdgeKeyword */,
293
- node: 35 /* NodeKeyword */,
294
- strict: 38 /* StrictKeyword */,
295
- subgraph: 37 /* SubgraphKeyword */,
296
- n: 18 /* CompassNorthToken */,
297
- ne: 19 /* CompassNorthEastToken */,
298
- e: 20 /* CompassEastToken */,
299
- se: 21 /* CompassSouthEastToken */,
300
- s: 22 /* CompassSouthToken */,
301
- sw: 23 /* CompassSouthWestToken */,
302
- w: 24 /* CompassWestToken */,
303
- nw: 25 /* CompassNorthWestToken */,
304
- c: 26 /* CompassCenterToken */,
305
- "+": 9 /* PlusToken */,
306
- "=": 15 /* EqualsToken */,
307
- "->": 39 /* DirectedEdgeOp */,
308
- "--": 40 /* UndirectedEdgeOp */,
309
- "{": 10 /* OpenBraceToken */,
310
- "}": 11 /* CloseBraceToken */,
311
- "[": 12 /* OpenBracketToken */,
312
- "]": 13 /* CloseBracketToken */,
313
- ";": 8 /* SemicolonToken */,
314
- ":": 14 /* ColonToken */,
315
- _: 27 /* UnderscoreToken */,
316
- ",": 7 /* CommaToken */,
317
- "<": 16 /* LessThan */,
318
- ">": 17 /* GreaterThan */
386
+ digraph: syntaxKind.DigraphKeyword,
387
+ graph: syntaxKind.GraphKeyword,
388
+ edge: syntaxKind.EdgeKeyword,
389
+ node: syntaxKind.NodeKeyword,
390
+ strict: syntaxKind.StrictKeyword,
391
+ subgraph: syntaxKind.SubgraphKeyword,
392
+ n: syntaxKind.CompassNorthToken,
393
+ ne: syntaxKind.CompassNorthEastToken,
394
+ e: syntaxKind.CompassEastToken,
395
+ se: syntaxKind.CompassSouthEastToken,
396
+ s: syntaxKind.CompassSouthToken,
397
+ sw: syntaxKind.CompassSouthWestToken,
398
+ w: syntaxKind.CompassWestToken,
399
+ nw: syntaxKind.CompassNorthWestToken,
400
+ c: syntaxKind.CompassCenterToken,
401
+ "+": syntaxKind.PlusToken,
402
+ "=": syntaxKind.EqualsToken,
403
+ "->": syntaxKind.DirectedEdgeOp,
404
+ "--": syntaxKind.UndirectedEdgeOp,
405
+ "{": syntaxKind.OpenBraceToken,
406
+ "}": syntaxKind.CloseBraceToken,
407
+ "[": syntaxKind.OpenBracketToken,
408
+ "]": syntaxKind.CloseBracketToken,
409
+ ";": syntaxKind.SemicolonToken,
410
+ ":": syntaxKind.ColonToken,
411
+ _: syntaxKind.UnderscoreToken,
412
+ ",": syntaxKind.CommaToken,
413
+ "<": syntaxKind.LessThan,
414
+ ">": syntaxKind.GreaterThan
319
415
  });
320
416
  function makeReverseMap(source) {
321
417
  const result = /* @__PURE__ */ new Map();
@@ -332,6 +428,16 @@ function getTextAsToken(token) {
332
428
  return textToToken.get(token);
333
429
  }
334
430
  var DefaultScanner = class {
431
+ end;
432
+ pos;
433
+ startPos;
434
+ tokenPos;
435
+ token;
436
+ tokenValue;
437
+ tokenFlags;
438
+ isUnterminated;
439
+ text;
440
+ onError;
335
441
  setText(newText, start = 0, length) {
336
442
  this.text = newText || "";
337
443
  this.end = length === void 0 ? this.text.length : start + length;
@@ -345,134 +451,134 @@ var DefaultScanner = class {
345
451
  this.pos = textPos;
346
452
  this.startPos = textPos;
347
453
  this.tokenPos = textPos;
348
- this.token = 0 /* Unknown */;
454
+ this.token = syntaxKind.Unknown;
349
455
  this.tokenValue = void 0;
350
- this.tokenFlags = 0 /* None */;
456
+ this.tokenFlags = tokenFlags.None;
351
457
  }
352
458
  scan(skipTrivia2 = true) {
353
459
  this.startPos = this.pos;
354
- this.tokenFlags = 0 /* None */;
460
+ this.tokenFlags = tokenFlags.None;
355
461
  this.isUnterminated = false;
356
462
  while (true) {
357
463
  this.tokenPos = this.pos;
358
464
  if (this.pos >= this.end) {
359
- return this.token = 1 /* EndOfFileToken */;
465
+ return this.token = syntaxKind.EndOfFileToken;
360
466
  }
361
467
  let ch = this.text.charCodeAt(this.pos);
362
468
  switch (ch) {
363
- case 10 /* lineFeed */:
364
- case 13 /* carriageReturn */:
365
- this.tokenFlags |= 4 /* PrecedingLineBreak */;
469
+ case characterCodes.lineFeed:
470
+ case characterCodes.carriageReturn:
471
+ this.tokenFlags |= tokenFlags.PrecedingLineBreak;
366
472
  if (skipTrivia2) {
367
473
  this.pos++;
368
474
  continue;
369
475
  }
370
- if (ch === 13 /* carriageReturn */ && this.pos + 1 < this.end && this.text.charCodeAt(this.pos + 1) === 10 /* lineFeed */) {
476
+ if (ch === characterCodes.carriageReturn && this.pos + 1 < this.end && this.text.charCodeAt(this.pos + 1) === characterCodes.lineFeed) {
371
477
  this.pos += 2;
372
478
  } else {
373
479
  this.pos++;
374
480
  }
375
- return this.token = 2 /* NewLineTrivia */;
376
- case 9 /* tab */:
377
- case 11 /* verticalTab */:
378
- case 12 /* formFeed */:
379
- case 32 /* space */:
481
+ return this.token = syntaxKind.NewLineTrivia;
482
+ case characterCodes.tab:
483
+ case characterCodes.verticalTab:
484
+ case characterCodes.formFeed:
485
+ case characterCodes.space:
380
486
  if (skipTrivia2) {
381
487
  this.pos++;
382
488
  continue;
383
489
  }
384
490
  while (this.pos < this.end && this.#isWhiteSpaceSingleLine(this.text.charCodeAt(this.pos)))
385
491
  this.pos++;
386
- return this.token = 3 /* WhitespaceTrivia */;
387
- case 35 /* hash */: {
492
+ return this.token = syntaxKind.WhitespaceTrivia;
493
+ case characterCodes.hash: {
388
494
  const content = this.#scanHashCommentTrivia(skipTrivia2);
389
495
  if (skipTrivia2) continue;
390
496
  this.tokenValue = content;
391
- return this.token = 4 /* HashCommentTrivia */;
497
+ return this.token = syntaxKind.HashCommentTrivia;
392
498
  }
393
- case 47 /* slash */: {
499
+ case characterCodes.slash: {
394
500
  if (this.pos + 1 < this.end) {
395
501
  const nextChar = this.text.charCodeAt(this.pos + 1);
396
502
  switch (nextChar) {
397
- case 47 /* slash */: {
503
+ case characterCodes.slash: {
398
504
  const commentContent = this.#scanSingleLineCommentTrivia(skipTrivia2);
399
505
  if (skipTrivia2) continue;
400
506
  this.tokenValue = commentContent;
401
- return this.token = 5 /* SingleLineCommentTrivia */;
507
+ return this.token = syntaxKind.SingleLineCommentTrivia;
402
508
  }
403
- case 42 /* asterisk */: {
509
+ case characterCodes.asterisk: {
404
510
  const commentContent = this.#scanMultiLineCommentTrivia(skipTrivia2);
405
511
  if (skipTrivia2) continue;
406
512
  this.tokenValue = commentContent;
407
- return this.token = 6 /* MultiLineCommentTrivia */;
513
+ return this.token = syntaxKind.MultiLineCommentTrivia;
408
514
  }
409
515
  }
410
516
  }
411
517
  this.#error(
412
518
  'Unexpected "/". Did you mean to start a comment like "/*" or "//"? If you wanted to use it as an identifier, put it in double quotes.',
413
- 0 /* ExpectationFailed */
519
+ scanError.ExpectationFailed
414
520
  );
415
521
  ++this.pos;
416
522
  break;
417
523
  }
418
- case 123 /* openBrace */:
524
+ case characterCodes.openBrace:
419
525
  this.pos++;
420
- return this.token = 10 /* OpenBraceToken */;
421
- case 125 /* closeBrace */:
526
+ return this.token = syntaxKind.OpenBraceToken;
527
+ case characterCodes.closeBrace:
422
528
  this.pos++;
423
- return this.token = 11 /* CloseBraceToken */;
424
- case 91 /* openBracket */:
529
+ return this.token = syntaxKind.CloseBraceToken;
530
+ case characterCodes.openBracket:
425
531
  this.pos++;
426
- return this.token = 12 /* OpenBracketToken */;
427
- case 93 /* closeBracket */:
532
+ return this.token = syntaxKind.OpenBracketToken;
533
+ case characterCodes.closeBracket:
428
534
  this.pos++;
429
- return this.token = 13 /* CloseBracketToken */;
430
- case 43 /* plus */:
535
+ return this.token = syntaxKind.CloseBracketToken;
536
+ case characterCodes.plus:
431
537
  this.pos++;
432
- return this.token = 9 /* PlusToken */;
433
- case 61 /* equals */:
538
+ return this.token = syntaxKind.PlusToken;
539
+ case characterCodes.equals:
434
540
  this.pos++;
435
- return this.token = 15 /* EqualsToken */;
436
- case 48 /* _0 */:
437
- case 49 /* _1 */:
438
- case 50 /* _2 */:
439
- case 51 /* _3 */:
440
- case 52 /* _4 */:
441
- case 53 /* _5 */:
442
- case 54 /* _6 */:
443
- case 55 /* _7 */:
444
- case 56 /* _8 */:
445
- case 57 /* _9 */:
446
- case 46 /* dot */:
541
+ return this.token = syntaxKind.EqualsToken;
542
+ case characterCodes._0:
543
+ case characterCodes._1:
544
+ case characterCodes._2:
545
+ case characterCodes._3:
546
+ case characterCodes._4:
547
+ case characterCodes._5:
548
+ case characterCodes._6:
549
+ case characterCodes._7:
550
+ case characterCodes._8:
551
+ case characterCodes._9:
552
+ case characterCodes.dot:
447
553
  this.tokenValue = this.#scanNumber();
448
- return this.token = 32 /* NumericIdentifier */;
449
- case 45 /* minus */: {
554
+ return this.token = syntaxKind.NumericIdentifier;
555
+ case characterCodes.minus: {
450
556
  const nextChar = this.text.charCodeAt(this.pos + 1);
451
557
  switch (nextChar) {
452
- case 45 /* minus */:
558
+ case characterCodes.minus:
453
559
  this.pos += 2;
454
- return this.token = 40 /* UndirectedEdgeOp */;
455
- case 62 /* greaterThan */:
560
+ return this.token = syntaxKind.UndirectedEdgeOp;
561
+ case characterCodes.greaterThan:
456
562
  this.pos += 2;
457
- return this.token = 39 /* DirectedEdgeOp */;
458
- case 48 /* _0 */:
459
- case 49 /* _1 */:
460
- case 50 /* _2 */:
461
- case 51 /* _3 */:
462
- case 52 /* _4 */:
463
- case 53 /* _5 */:
464
- case 54 /* _6 */:
465
- case 55 /* _7 */:
466
- case 56 /* _8 */:
467
- case 57 /* _9 */:
468
- case 46 /* dot */:
563
+ return this.token = syntaxKind.DirectedEdgeOp;
564
+ case characterCodes._0:
565
+ case characterCodes._1:
566
+ case characterCodes._2:
567
+ case characterCodes._3:
568
+ case characterCodes._4:
569
+ case characterCodes._5:
570
+ case characterCodes._6:
571
+ case characterCodes._7:
572
+ case characterCodes._8:
573
+ case characterCodes._9:
574
+ case characterCodes.dot:
469
575
  this.tokenValue = this.#scanNumber();
470
- return this.token = 32 /* NumericIdentifier */;
576
+ return this.token = syntaxKind.NumericIdentifier;
471
577
  default: {
472
578
  const chr = this.text.charAt(this.pos + 1);
473
579
  this.#error(
474
580
  `Unexpected "${chr}". Did you mean to define an edge? Depending on the type of graph you are defining, use "->" or "--".`,
475
- 0 /* ExpectationFailed */
581
+ scanError.ExpectationFailed
476
582
  );
477
583
  break;
478
584
  }
@@ -481,24 +587,24 @@ var DefaultScanner = class {
481
587
  break;
482
588
  }
483
589
  // TODO: Remove UnderscoreToken
484
- case 95 /* _ */:
590
+ case characterCodes._:
485
591
  this.pos++;
486
- return this.token = 27 /* UnderscoreToken */;
487
- case 59 /* semicolon */:
592
+ return this.token = syntaxKind.UnderscoreToken;
593
+ case characterCodes.semicolon:
488
594
  this.pos++;
489
- return this.token = 8 /* SemicolonToken */;
490
- case 58 /* colon */:
595
+ return this.token = syntaxKind.SemicolonToken;
596
+ case characterCodes.colon:
491
597
  this.pos++;
492
- return this.token = 14 /* ColonToken */;
493
- case 44 /* comma */:
598
+ return this.token = syntaxKind.ColonToken;
599
+ case characterCodes.comma:
494
600
  this.pos++;
495
- return this.token = 7 /* CommaToken */;
496
- case 60 /* lessThan */:
601
+ return this.token = syntaxKind.CommaToken;
602
+ case characterCodes.lessThan:
497
603
  this.tokenValue = this.#scanHtml();
498
- return this.token = 29 /* HtmlIdentifier */;
499
- case 34 /* doubleQuote */:
604
+ return this.token = syntaxKind.HtmlIdentifier;
605
+ case characterCodes.doubleQuote:
500
606
  this.tokenValue = this.#scanString();
501
- return this.token = 28 /* StringLiteral */;
607
+ return this.token = syntaxKind.StringLiteral;
502
608
  default: {
503
609
  if (isIdentifierStart(ch)) {
504
610
  this.pos++;
@@ -515,7 +621,7 @@ var DefaultScanner = class {
515
621
  const chr = this.text.charAt(this.pos);
516
622
  this.#error(
517
623
  `Unexpected "${chr}". Did you mean to start an identifier? Node names cannot start with "${chr}".`,
518
- 0 /* ExpectationFailed */
624
+ scanError.ExpectationFailed
519
625
  );
520
626
  this.pos++;
521
627
  break;
@@ -523,7 +629,7 @@ var DefaultScanner = class {
523
629
  }
524
630
  }
525
631
  }
526
- #error(message, sub, category = 1 /* Error */, errPos = this.pos, length = 0) {
632
+ #error(message, sub, category = diagnosticCategory.Error, errPos = this.pos, length = 0) {
527
633
  const cb = this.onError;
528
634
  if (cb) {
529
635
  const posSave = this.pos;
@@ -533,10 +639,10 @@ var DefaultScanner = class {
533
639
  }
534
640
  }
535
641
  #isWhiteSpaceSingleLine(ch) {
536
- return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ || ch === 160 /* nonBreakingSpace */ || ch === 133 /* nextLine */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */;
642
+ return ch === characterCodes.space || ch === characterCodes.tab || ch === characterCodes.verticalTab || ch === characterCodes.formFeed || ch === characterCodes.nonBreakingSpace || ch === characterCodes.nextLine || ch === characterCodes.ogham || ch >= characterCodes.enQuad && ch <= characterCodes.zeroWidthSpace || ch === characterCodes.narrowNoBreakSpace || ch === characterCodes.mathematicalSpace || ch === characterCodes.ideographicSpace || ch === characterCodes.byteOrderMark;
537
643
  }
538
644
  #isAtMultiLineCommentEnd(pos) {
539
- return pos + 1 < this.end && this.text.charCodeAt(pos) === 42 /* asterisk */ && this.text.charCodeAt(pos + 1) === 47 /* slash */;
645
+ return pos + 1 < this.end && this.text.charCodeAt(pos) === characterCodes.asterisk && this.text.charCodeAt(pos + 1) === characterCodes.slash;
540
646
  }
541
647
  #scanHashCommentTrivia(skip) {
542
648
  ++this.pos;
@@ -568,18 +674,18 @@ var DefaultScanner = class {
568
674
  while (true) {
569
675
  if (this.pos >= this.end) {
570
676
  result += this.text.substring(start, this.pos);
571
- this.tokenFlags |= 2 /* Unterminated */;
677
+ this.tokenFlags |= tokenFlags.Unterminated;
572
678
  this.isUnterminated = true;
573
- this.#error("Unterminated html literal", 1 /* Unterminated */);
679
+ this.#error("Unterminated html literal", scanError.Unterminated);
574
680
  break;
575
681
  }
576
682
  const ch = this.text.charCodeAt(this.pos);
577
- if (ch === 60 /* lessThan */) {
683
+ if (ch === characterCodes.lessThan) {
578
684
  ++subTagsLevel;
579
685
  this.pos++;
580
686
  continue;
581
687
  }
582
- if (ch === 62 /* greaterThan */) {
688
+ if (ch === characterCodes.greaterThan) {
583
689
  this.pos++;
584
690
  console.assert(subTagsLevel >= 0);
585
691
  if (subTagsLevel === 0) {
@@ -603,13 +709,13 @@ var DefaultScanner = class {
603
709
  while (true) {
604
710
  if (this.pos >= this.end) {
605
711
  result += this.text.substring(start, this.pos);
606
- this.tokenFlags |= 2 /* Unterminated */;
712
+ this.tokenFlags |= tokenFlags.Unterminated;
607
713
  this.isUnterminated = true;
608
- this.#error("Unterminated string", 1 /* Unterminated */);
714
+ this.#error("Unterminated string", scanError.Unterminated);
609
715
  break;
610
716
  }
611
717
  const ch = this.text.charCodeAt(this.pos);
612
- if (ch === 92 /* backslash */) {
718
+ if (ch === characterCodes.backslash) {
613
719
  hasBackslash = true;
614
720
  } else {
615
721
  if (hasBackslash) {
@@ -622,9 +728,9 @@ var DefaultScanner = class {
622
728
  }
623
729
  if (isLineBreak(ch)) {
624
730
  result += this.text.substring(start, this.pos);
625
- this.tokenFlags |= 2 /* Unterminated */;
731
+ this.tokenFlags |= tokenFlags.Unterminated;
626
732
  this.isUnterminated = true;
627
- this.#error("Unterminated string", 1 /* Unterminated */);
733
+ this.#error("Unterminated string", scanError.Unterminated);
628
734
  break;
629
735
  }
630
736
  }
@@ -642,18 +748,18 @@ var DefaultScanner = class {
642
748
  while (true) {
643
749
  const ch = this.text.charCodeAt(this.pos);
644
750
  switch (ch) {
645
- case 48 /* _0 */:
646
- case 49 /* _1 */:
647
- case 50 /* _2 */:
648
- case 51 /* _3 */:
649
- case 52 /* _4 */:
650
- case 53 /* _5 */:
651
- case 54 /* _6 */:
652
- case 55 /* _7 */:
653
- case 56 /* _8 */:
654
- case 57 /* _9 */:
751
+ case characterCodes._0:
752
+ case characterCodes._1:
753
+ case characterCodes._2:
754
+ case characterCodes._3:
755
+ case characterCodes._4:
756
+ case characterCodes._5:
757
+ case characterCodes._6:
758
+ case characterCodes._7:
759
+ case characterCodes._8:
760
+ case characterCodes._9:
655
761
  break;
656
- case 46 /* dot */:
762
+ case characterCodes.dot:
657
763
  if (hadDot) {
658
764
  result += this.text.substring(start, this.pos);
659
765
  return result;
@@ -661,7 +767,7 @@ var DefaultScanner = class {
661
767
  hadDot = true;
662
768
  hadMinus = true;
663
769
  break;
664
- case 45 /* minus */:
770
+ case characterCodes.minus:
665
771
  if (this.pos !== start || hadMinus) {
666
772
  result += this.text.substring(start, this.pos);
667
773
  return result;
@@ -679,7 +785,7 @@ var DefaultScanner = class {
679
785
  const len = tokenValue.length;
680
786
  if (len >= 4 && len <= 8) {
681
787
  const ch = tokenValue.charCodeAt(0);
682
- if (ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 65 /* A */ && ch <= 90 /* Z */) {
788
+ if (ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes.A && ch <= characterCodes.Z) {
683
789
  const lowerCaseToken = tokenValue.toLowerCase();
684
790
  const t = textToToken.get(lowerCaseToken);
685
791
  if (t !== void 0) {
@@ -688,7 +794,7 @@ var DefaultScanner = class {
688
794
  }
689
795
  }
690
796
  }
691
- return this.token = 30 /* TextIdentifier */;
797
+ return this.token = syntaxKind.TextIdentifier;
692
798
  }
693
799
  lookAhead(callback) {
694
800
  return this.#speculationHelper(
@@ -724,26 +830,26 @@ var DefaultScanner = class {
724
830
  }
725
831
  };
726
832
  function isIdentifierStart(ch) {
727
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 95 /* _ */ || ch === 60 /* lessThan */ || ch === 34 /* doubleQuote */;
833
+ return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes._ || ch === characterCodes.lessThan || ch === characterCodes.doubleQuote;
728
834
  }
729
835
  function isIdentifierPart(ch) {
730
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */;
836
+ return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes.$ || ch === characterCodes._ || ch > characterCodes.maxAsciiCharacter;
731
837
  }
732
838
  function skipTrivia(text, pos) {
733
839
  while (true) {
734
840
  const ch = text.charCodeAt(pos);
735
841
  switch (ch) {
736
- case 13 /* carriageReturn */:
737
- if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) ++pos;
842
+ case characterCodes.carriageReturn:
843
+ if (text.charCodeAt(pos + 1) === characterCodes.lineFeed) ++pos;
738
844
  continue;
739
- case 10 /* lineFeed */:
740
- case 9 /* tab */:
741
- case 11 /* verticalTab */:
742
- case 12 /* formFeed */:
743
- case 32 /* space */:
845
+ case characterCodes.lineFeed:
846
+ case characterCodes.tab:
847
+ case characterCodes.verticalTab:
848
+ case characterCodes.formFeed:
849
+ case characterCodes.space:
744
850
  ++pos;
745
851
  continue;
746
- case 35 /* hash */: {
852
+ case characterCodes.hash: {
747
853
  ++pos;
748
854
  while (pos < text.length) {
749
855
  if (isLineBreak(text.charCodeAt(pos))) break;
@@ -751,11 +857,11 @@ function skipTrivia(text, pos) {
751
857
  }
752
858
  continue;
753
859
  }
754
- case 47 /* slash */:
860
+ case characterCodes.slash:
755
861
  if (pos + 1 < text.length) {
756
862
  const nextChar = text.charCodeAt(pos + 1);
757
863
  switch (nextChar) {
758
- case 47 /* slash */: {
864
+ case characterCodes.slash: {
759
865
  pos += 2;
760
866
  while (pos < text.length) {
761
867
  if (isLineBreak(text.charCodeAt(pos))) break;
@@ -763,10 +869,10 @@ function skipTrivia(text, pos) {
763
869
  }
764
870
  continue;
765
871
  }
766
- case 42 /* asterisk */: {
872
+ case characterCodes.asterisk: {
767
873
  pos += 2;
768
874
  while (pos < text.length) {
769
- if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {
875
+ if (text.charCodeAt(pos) === characterCodes.asterisk && text.charCodeAt(pos + 1) === characterCodes.slash) {
770
876
  pos += 2;
771
877
  break;
772
878
  }
@@ -782,26 +888,32 @@ function skipTrivia(text, pos) {
782
888
  }
783
889
  }
784
890
  function isLineBreak(ch) {
785
- return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */;
891
+ return ch === characterCodes.lineFeed || ch === characterCodes.carriageReturn;
786
892
  }
787
893
 
788
894
  // src/parser.ts
789
- var ParsingContext = /* @__PURE__ */ ((ParsingContext2) => {
790
- ParsingContext2[ParsingContext2["None"] = 0] = "None";
791
- ParsingContext2[ParsingContext2["StatementList"] = 1] = "StatementList";
792
- ParsingContext2[ParsingContext2["AttributeContainerList"] = 2] = "AttributeContainerList";
793
- ParsingContext2[ParsingContext2["AssignmentList"] = 3] = "AssignmentList";
794
- ParsingContext2[ParsingContext2["EdgeRhsList"] = 4] = "EdgeRhsList";
795
- ParsingContext2[ParsingContext2["QuotedTextIdentifierConcatenation"] = 5] = "QuotedTextIdentifierConcatenation";
796
- ParsingContext2[ParsingContext2["Count"] = 6] = "Count";
797
- return ParsingContext2;
798
- })(ParsingContext || {});
895
+ var parsingContext = {
896
+ None: 0,
897
+ StatementList: 1,
898
+ AttributeContainerList: 2,
899
+ AssignmentList: 3,
900
+ EdgeRhsList: 4,
901
+ QuotedTextIdentifierConcatenation: 5,
902
+ Count: 6
903
+ // Number of parsing contexts
904
+ };
799
905
  var Parser = class {
906
+ currentToken = syntaxKind.Unknown;
907
+ nodeCount;
908
+ identifiers;
909
+ identifierCount = 0;
910
+ sourceText;
911
+ scanner = new DefaultScanner();
912
+ currentNodeHasError;
913
+ currentContext;
914
+ diagnostics;
800
915
  // TODO
801
916
  constructor() {
802
- this.currentToken = 0 /* Unknown */;
803
- this.identifierCount = 0;
804
- this.scanner = new DefaultScanner();
805
917
  this.#resetState();
806
918
  }
807
919
  #resetState() {
@@ -813,7 +925,7 @@ var Parser = class {
813
925
  this.nodeCount = 0;
814
926
  this.diagnostics = [];
815
927
  this.currentNodeHasError = false;
816
- this.currentContext = 0 /* None */;
928
+ this.currentContext = parsingContext.None;
817
929
  }
818
930
  #nextToken() {
819
931
  this.currentToken = this.scanner.scan(true);
@@ -822,6 +934,7 @@ var Parser = class {
822
934
  #token() {
823
935
  return this.currentToken;
824
936
  }
937
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: TODO
825
938
  #getLinesFromFile(sourceText) {
826
939
  return sourceText.split(/\r?\n/);
827
940
  }
@@ -830,14 +943,14 @@ var Parser = class {
830
943
  this.scanner.setText(this.sourceText);
831
944
  this.#nextToken();
832
945
  let graph;
833
- if (this.#token() !== 1 /* EndOfFileToken */) {
946
+ if (this.#token() !== syntaxKind.EndOfFileToken) {
834
947
  graph = this.#parseGraph();
835
- if (this.#token() !== 1 /* EndOfFileToken */) {
948
+ if (this.#token() !== syntaxKind.EndOfFileToken) {
836
949
  this.#parseErrorAtPosition(
837
950
  this.scanner.tokenPos,
838
951
  this.scanner.text.length - 1,
839
952
  "Content after the end of a graph declaration is invalid.",
840
- { source: 2 /* Parse */, sub: 1 /* TrailingData */ }
953
+ { source: errorSource.Parse, sub: parseError.TrailingData }
841
954
  );
842
955
  }
843
956
  }
@@ -851,48 +964,48 @@ var Parser = class {
851
964
  return result;
852
965
  }
853
966
  #parseGraph() {
854
- const strictToken = this.#parseOptionalToken(38 /* StrictKeyword */);
855
- const keyword = this.#parseExpectedTokenOneOf(34 /* DigraphKeyword */, [
856
- 34 /* DigraphKeyword */,
857
- 33 /* GraphKeyword */
967
+ const strictToken = this.#parseOptionalToken(syntaxKind.StrictKeyword);
968
+ const keyword = this.#parseExpectedTokenOneOf(syntaxKind.DigraphKeyword, [
969
+ syntaxKind.DigraphKeyword,
970
+ syntaxKind.GraphKeyword
858
971
  ]);
859
- const kind = keyword === void 0 || keyword.kind === 34 /* DigraphKeyword */ ? 41 /* DirectedGraph */ : 42 /* UndirectedGraph */;
972
+ const kind = keyword === void 0 || keyword.kind === syntaxKind.DigraphKeyword ? syntaxKind.DirectedGraph : syntaxKind.UndirectedGraph;
860
973
  const graphStart = strictToken ? strictToken.pos : keyword.pos;
861
974
  const node = this.#createNode(kind, graphStart);
862
975
  node.strict = strictToken;
863
976
  node.keyword = keyword;
864
977
  node.id = this.#isIdentifier() ? this.#parseIdentifier() : void 0;
865
- this.#parseExpectedToken(10 /* OpenBraceToken */);
978
+ this.#parseExpectedToken(syntaxKind.OpenBraceToken);
866
979
  node.statements = this.#parseList(
867
- 1 /* StatementList */,
980
+ parsingContext.StatementList,
868
981
  () => this.#parseStatement()
869
982
  );
870
- this.#parseExpectedToken(11 /* CloseBraceToken */);
983
+ this.#parseExpectedToken(syntaxKind.CloseBraceToken);
871
984
  return this.#finishNode(node);
872
985
  }
873
986
  #parseIdentifier() {
874
987
  let result;
875
988
  const escapedIdTexts = [];
876
989
  switch (this.#token()) {
877
- case 30 /* TextIdentifier */:
990
+ case syntaxKind.TextIdentifier:
878
991
  result = this.#parseTextIdentifier();
879
992
  escapedIdTexts.push(result.text);
880
993
  break;
881
- case 28 /* StringLiteral */:
994
+ case syntaxKind.StringLiteral:
882
995
  result = this.#parseQuotedTextIdentifierConcatenation();
883
996
  escapedIdTexts.push(...result.values.map((v) => v.text));
884
997
  break;
885
- case 29 /* HtmlIdentifier */:
998
+ case syntaxKind.HtmlIdentifier:
886
999
  result = this.#parseHtmlIdentifier();
887
1000
  escapedIdTexts.push(result.htmlContent);
888
1001
  break;
889
- case 32 /* NumericIdentifier */:
1002
+ case syntaxKind.NumericIdentifier:
890
1003
  result = this.#parseNumericIdentifier();
891
1004
  escapedIdTexts.push(result.text);
892
1005
  break;
893
1006
  default:
894
- this.#reportExpectedError([30 /* TextIdentifier */]);
895
- result = this.#createMissingNode(30 /* TextIdentifier */);
1007
+ this.#reportExpectedError([syntaxKind.TextIdentifier]);
1008
+ result = this.#createMissingNode(syntaxKind.TextIdentifier);
896
1009
  break;
897
1010
  }
898
1011
  for (const i of escapedIdTexts) {
@@ -906,7 +1019,7 @@ var Parser = class {
906
1019
  if (!has) this.identifiers.add(id);
907
1020
  }
908
1021
  #parseTextIdentifier() {
909
- const node = this.#createNode(30 /* TextIdentifier */);
1022
+ const node = this.#createNode(syntaxKind.TextIdentifier);
910
1023
  const text = this.scanner.tokenValue;
911
1024
  this.#nextToken();
912
1025
  if (text === void 0) throw "Satisfy type checker";
@@ -914,9 +1027,9 @@ var Parser = class {
914
1027
  return this.#finishNode(node);
915
1028
  }
916
1029
  #parseQuotedTextIdentifierConcatenation() {
917
- const node = this.#createNode(31 /* QuotedTextIdentifier */);
1030
+ const node = this.#createNode(syntaxKind.QuotedTextIdentifier);
918
1031
  node.values = this.#parseList(
919
- 5 /* QuotedTextIdentifierConcatenation */,
1032
+ parsingContext.QuotedTextIdentifierConcatenation,
920
1033
  () => this.#parseQuotedTextIdentifier(),
921
1034
  /* at least one */
922
1035
  true
@@ -924,20 +1037,21 @@ var Parser = class {
924
1037
  return this.#finishNode(node);
925
1038
  }
926
1039
  #parseQuotedTextIdentifier() {
927
- const node = this.#createNode(28 /* StringLiteral */);
928
- if (this.#token() === 9 /* PlusToken */) this.#nextToken();
1040
+ const node = this.#createNode(syntaxKind.StringLiteral);
1041
+ if (this.#token() === syntaxKind.PlusToken) this.#nextToken();
929
1042
  const text = this.scanner.tokenValue;
930
1043
  this.#nextToken();
931
1044
  if (text === void 0) throw "Satisfy type checker";
932
1045
  node.text = text;
933
1046
  return this.#finishNode(node);
934
1047
  }
1048
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: TODO
935
1049
  #isQuotedStringFollowing() {
936
1050
  this.#nextToken();
937
- return this.#token() === 28 /* StringLiteral */;
1051
+ return this.#token() === syntaxKind.StringLiteral;
938
1052
  }
939
1053
  #parseHtmlIdentifier() {
940
- const node = this.#createNode(29 /* HtmlIdentifier */);
1054
+ const node = this.#createNode(syntaxKind.HtmlIdentifier);
941
1055
  const text = this.scanner.tokenValue;
942
1056
  this.#nextToken();
943
1057
  if (text === void 0) throw "Satisfy type checker";
@@ -945,7 +1059,7 @@ var Parser = class {
945
1059
  return this.#finishNode(node);
946
1060
  }
947
1061
  #parseNumericIdentifier() {
948
- const node = this.#createNode(32 /* NumericIdentifier */);
1062
+ const node = this.#createNode(syntaxKind.NumericIdentifier);
949
1063
  const text = this.scanner.tokenValue;
950
1064
  this.#nextToken();
951
1065
  if (text === void 0) throw "Satisfy type checker";
@@ -955,27 +1069,27 @@ var Parser = class {
955
1069
  }
956
1070
  #parseStatement() {
957
1071
  switch (this.#token()) {
958
- case 33 /* GraphKeyword */:
959
- case 35 /* NodeKeyword */:
960
- case 36 /* EdgeKeyword */:
1072
+ case syntaxKind.GraphKeyword:
1073
+ case syntaxKind.NodeKeyword:
1074
+ case syntaxKind.EdgeKeyword:
961
1075
  return this.#parseAttributeStatement();
962
- case 10 /* OpenBraceToken */:
963
- case 37 /* SubgraphKeyword */: {
1076
+ case syntaxKind.OpenBraceToken:
1077
+ case syntaxKind.SubgraphKeyword: {
964
1078
  const subgraph = this.#parseSubGraph();
965
- if (this.#token() === 8 /* SemicolonToken */) {
1079
+ if (this.#token() === syntaxKind.SemicolonToken) {
966
1080
  const subgraphStatement2 = this.#createNode(
967
- 48 /* SubGraphStatement */,
1081
+ syntaxKind.SubGraphStatement,
968
1082
  subgraph.pos
969
1083
  );
970
1084
  subgraphStatement2.subgraph = subgraph;
971
1085
  subgraphStatement2.terminator = this.#parseExpectedToken(
972
- 8 /* SemicolonToken */
1086
+ syntaxKind.SemicolonToken
973
1087
  );
974
1088
  return this.#finishNode(subgraphStatement2);
975
1089
  }
976
1090
  if (this.#isEdgeOp()) return this.#parseEdgeStatement(subgraph);
977
1091
  const subgraphStatement = this.#createNode(
978
- 48 /* SubGraphStatement */,
1092
+ syntaxKind.SubGraphStatement,
979
1093
  subgraph.pos
980
1094
  );
981
1095
  subgraphStatement.subgraph = subgraph;
@@ -995,28 +1109,28 @@ var Parser = class {
995
1109
  }
996
1110
  #parseAttributeStatement() {
997
1111
  switch (this.#token()) {
998
- case 33 /* GraphKeyword */:
999
- case 35 /* NodeKeyword */:
1000
- case 36 /* EdgeKeyword */: {
1001
- const node = this.#createNode(45 /* AttributeStatement */);
1112
+ case syntaxKind.GraphKeyword:
1113
+ case syntaxKind.NodeKeyword:
1114
+ case syntaxKind.EdgeKeyword: {
1115
+ const node = this.#createNode(syntaxKind.AttributeStatement);
1002
1116
  node.subject = this.#parseTokenNode();
1003
- if (this.#token() === 12 /* OpenBracketToken */) {
1117
+ if (this.#token() === syntaxKind.OpenBracketToken) {
1004
1118
  node.attributes = this.#parseList(
1005
- 2 /* AttributeContainerList */,
1119
+ parsingContext.AttributeContainerList,
1006
1120
  () => this.#parseAttributeContainer()
1007
1121
  );
1008
1122
  } else {
1009
- this.#reportExpectedError([12 /* OpenBracketToken */]);
1123
+ this.#reportExpectedError([syntaxKind.OpenBracketToken]);
1010
1124
  const missingStatement = this.#createMissingNode(
1011
- 45 /* AttributeStatement */
1125
+ syntaxKind.AttributeStatement
1012
1126
  );
1013
1127
  missingStatement.attributes = this.#createNodeArray(
1014
- [this.#createMissingNode(50 /* AttributeContainer */)],
1128
+ [this.#createMissingNode(syntaxKind.AttributeContainer)],
1015
1129
  this.scanner.tokenPos,
1016
1130
  this.scanner.tokenPos
1017
1131
  );
1018
1132
  }
1019
- node.terminator = this.#parseOptionalToken(8 /* SemicolonToken */);
1133
+ node.terminator = this.#parseOptionalToken(syntaxKind.SemicolonToken);
1020
1134
  return this.#finishNode(node);
1021
1135
  }
1022
1136
  default:
@@ -1024,89 +1138,89 @@ var Parser = class {
1024
1138
  }
1025
1139
  }
1026
1140
  #parseAttributeContainer() {
1027
- if (this.#token() !== 12 /* OpenBracketToken */) debugger;
1028
- const node = this.#createNode(50 /* AttributeContainer */);
1029
- node.openBracket = this.#parseExpectedToken(12 /* OpenBracketToken */);
1141
+ if (this.#token() !== syntaxKind.OpenBracketToken) debugger;
1142
+ const node = this.#createNode(syntaxKind.AttributeContainer);
1143
+ node.openBracket = this.#parseExpectedToken(syntaxKind.OpenBracketToken);
1030
1144
  if (this.#isIdentifier() && this.#lookAhead(() => this.#isAssignmentStart())) {
1031
1145
  node.assignments = this.#parseList(
1032
- 3 /* AssignmentList */,
1146
+ parsingContext.AssignmentList,
1033
1147
  () => this.#parseAssignment()
1034
1148
  );
1035
1149
  } else {
1036
1150
  node.assignments = this.#createEmptyArray();
1037
1151
  }
1038
- node.closeBracket = this.#parseExpectedToken(13 /* CloseBracketToken */);
1152
+ node.closeBracket = this.#parseExpectedToken(syntaxKind.CloseBracketToken);
1039
1153
  return this.#finishNode(node);
1040
1154
  }
1041
1155
  #isAssignmentStart() {
1042
1156
  if (!this.#isIdentifier) debugger;
1043
1157
  this.#nextToken();
1044
- return this.#token() === 15 /* EqualsToken */;
1158
+ return this.#token() === syntaxKind.EqualsToken;
1045
1159
  }
1046
1160
  #parseIdEqualsIdStatement() {
1047
1161
  if (!this.#isIdentifier) debugger;
1048
1162
  const leftIdentifier = this.#parseIdentifier();
1049
1163
  const node = this.#createNode(
1050
- 46 /* IdEqualsIdStatement */,
1164
+ syntaxKind.IdEqualsIdStatement,
1051
1165
  leftIdentifier.pos
1052
1166
  );
1053
1167
  node.leftId = leftIdentifier;
1054
- if (this.#token() !== 15 /* EqualsToken */) debugger;
1055
- this.#parseExpectedToken(15 /* EqualsToken */);
1168
+ if (this.#token() !== syntaxKind.EqualsToken) debugger;
1169
+ this.#parseExpectedToken(syntaxKind.EqualsToken);
1056
1170
  node.rightId = this.#parseIdentifier();
1057
- node.terminator = this.#parseOptionalToken(8 /* SemicolonToken */);
1171
+ node.terminator = this.#parseOptionalToken(syntaxKind.SemicolonToken);
1058
1172
  return this.#finishNode(node);
1059
1173
  }
1060
1174
  #isIdEqualsIdStatement() {
1061
1175
  if (!this.#isIdentifier) debugger;
1062
1176
  this.#nextToken();
1063
- return this.#token() === 15 /* EqualsToken */;
1177
+ return this.#token() === syntaxKind.EqualsToken;
1064
1178
  }
1065
1179
  #parseNodeStatement() {
1066
1180
  if (!this.#isIdentifier) debugger;
1067
- const node = this.#createNode(43 /* NodeStatement */);
1181
+ const node = this.#createNode(syntaxKind.NodeStatement);
1068
1182
  node.id = this.#parseNodeId();
1069
- if (this.#token() === 12 /* OpenBracketToken */) {
1183
+ if (this.#token() === syntaxKind.OpenBracketToken) {
1070
1184
  node.attributes = this.#parseList(
1071
- 2 /* AttributeContainerList */,
1185
+ parsingContext.AttributeContainerList,
1072
1186
  () => this.#parseAttributeContainer()
1073
1187
  );
1074
1188
  } else {
1075
1189
  node.attributes = this.#createEmptyArray();
1076
1190
  }
1077
- node.terminator = this.#parseOptionalToken(8 /* SemicolonToken */);
1191
+ node.terminator = this.#parseOptionalToken(syntaxKind.SemicolonToken);
1078
1192
  return this.#finishNode(node);
1079
1193
  }
1080
1194
  #parseEdgeStatement(precedingItem) {
1081
1195
  console.assert(
1082
- precedingItem.kind === 47 /* SubGraph */ || precedingItem.kind === 54 /* NodeId */
1196
+ precedingItem.kind === syntaxKind.SubGraph || precedingItem.kind === syntaxKind.NodeId
1083
1197
  );
1084
1198
  console.assert(precedingItem.pos !== void 0);
1085
1199
  if (!this.#isEdgeOp()) debugger;
1086
- const node = this.#createNode(44 /* EdgeStatement */, precedingItem.pos);
1200
+ const node = this.#createNode(syntaxKind.EdgeStatement, precedingItem.pos);
1087
1201
  node.source = precedingItem;
1088
- node.rhs = this.#parseList(4 /* EdgeRhsList */, () => this.#parseEdgeRhs());
1089
- if (this.#token() === 12 /* OpenBracketToken */) {
1202
+ node.rhs = this.#parseList(parsingContext.EdgeRhsList, () => this.#parseEdgeRhs());
1203
+ if (this.#token() === syntaxKind.OpenBracketToken) {
1090
1204
  node.attributes = this.#parseList(
1091
- 2 /* AttributeContainerList */,
1205
+ parsingContext.AttributeContainerList,
1092
1206
  () => this.#parseAttributeContainer()
1093
1207
  );
1094
1208
  } else {
1095
1209
  node.attributes = this.#createEmptyArray();
1096
1210
  }
1097
- node.terminator = this.#parseOptionalToken(8 /* SemicolonToken */);
1211
+ node.terminator = this.#parseOptionalToken(syntaxKind.SemicolonToken);
1098
1212
  return this.#finishNode(node);
1099
1213
  }
1100
1214
  #parseEdgeRhs() {
1101
- const node = this.#createNode(49 /* EdgeRhs */);
1102
- const op = this.#parseExpectedTokenOneOf(39 /* DirectedEdgeOp */, [
1103
- 39 /* DirectedEdgeOp */,
1104
- 40 /* UndirectedEdgeOp */
1215
+ const node = this.#createNode(syntaxKind.EdgeRhs);
1216
+ const op = this.#parseExpectedTokenOneOf(syntaxKind.DirectedEdgeOp, [
1217
+ syntaxKind.DirectedEdgeOp,
1218
+ syntaxKind.UndirectedEdgeOp
1105
1219
  ]);
1106
1220
  node.operation = op;
1107
1221
  switch (this.#token()) {
1108
- case 37 /* SubgraphKeyword */:
1109
- case 10 /* OpenBraceToken */:
1222
+ case syntaxKind.SubgraphKeyword:
1223
+ case syntaxKind.OpenBraceToken:
1110
1224
  node.target = this.#parseSubGraph();
1111
1225
  break;
1112
1226
  default: {
@@ -1120,18 +1234,18 @@ var Parser = class {
1120
1234
  const result = this.#createNode(kind);
1121
1235
  if (isIdentifierNode(result)) {
1122
1236
  switch (result.kind) {
1123
- case 31 /* QuotedTextIdentifier */: {
1124
- const literal = this.#createNode(28 /* StringLiteral */);
1237
+ case syntaxKind.QuotedTextIdentifier: {
1238
+ const literal = this.#createNode(syntaxKind.StringLiteral);
1125
1239
  literal.text = "";
1126
1240
  const values = this.#createNodeArray([literal], result.pos, result.pos);
1127
1241
  result.values = values;
1128
1242
  break;
1129
1243
  }
1130
- case 29 /* HtmlIdentifier */:
1244
+ case syntaxKind.HtmlIdentifier:
1131
1245
  result.htmlContent = "";
1132
1246
  break;
1133
- case 30 /* TextIdentifier */:
1134
- case 32 /* NumericIdentifier */:
1247
+ case syntaxKind.TextIdentifier:
1248
+ case syntaxKind.NumericIdentifier:
1135
1249
  result.text = "";
1136
1250
  break;
1137
1251
  }
@@ -1140,66 +1254,66 @@ var Parser = class {
1140
1254
  }
1141
1255
  #parseAssignment() {
1142
1256
  if (!this.#isIdentifier) debugger;
1143
- const node = this.#createNode(51 /* Assignment */);
1257
+ const node = this.#createNode(syntaxKind.Assignment);
1144
1258
  node.leftId = this.#parseIdentifier();
1145
- this.#parseExpectedToken(15 /* EqualsToken */);
1259
+ this.#parseExpectedToken(syntaxKind.EqualsToken);
1146
1260
  node.rightId = this.#parseIdentifier();
1147
1261
  let terminator = this.#parseOptionalToken(
1148
- 7 /* CommaToken */
1262
+ syntaxKind.CommaToken
1149
1263
  );
1150
1264
  if (terminator === void 0)
1151
- terminator = this.#parseOptionalToken(8 /* SemicolonToken */);
1265
+ terminator = this.#parseOptionalToken(syntaxKind.SemicolonToken);
1152
1266
  node.terminator = terminator;
1153
1267
  return this.#finishNode(node);
1154
1268
  }
1155
1269
  #parseSubGraph() {
1156
1270
  console.assert(
1157
- this.#token() === 37 /* SubgraphKeyword */ || this.#token() === 10 /* OpenBraceToken */
1271
+ this.#token() === syntaxKind.SubgraphKeyword || this.#token() === syntaxKind.OpenBraceToken
1158
1272
  );
1159
- const subGraph = this.#parseOptionalToken(37 /* SubgraphKeyword */);
1273
+ const subGraph = this.#parseOptionalToken(syntaxKind.SubgraphKeyword);
1160
1274
  const subGraphStart = subGraph !== void 0 ? subGraph.pos : void 0;
1161
- const node = this.#createNode(47 /* SubGraph */, subGraphStart);
1275
+ const node = this.#createNode(syntaxKind.SubGraph, subGraphStart);
1162
1276
  const identifier = subGraph !== void 0 && this.#isIdentifier() ? this.#parseIdentifier() : void 0;
1163
1277
  node.id = identifier;
1164
- this.#parseExpectedToken(10 /* OpenBraceToken */);
1278
+ this.#parseExpectedToken(syntaxKind.OpenBraceToken);
1165
1279
  node.statements = this.#parseList(
1166
- 1 /* StatementList */,
1280
+ parsingContext.StatementList,
1167
1281
  () => this.#parseStatement()
1168
1282
  );
1169
- this.#parseExpectedToken(11 /* CloseBraceToken */);
1283
+ this.#parseExpectedToken(syntaxKind.CloseBraceToken);
1170
1284
  return this.#finishNode(node);
1171
1285
  }
1172
1286
  #parseNodeId() {
1173
1287
  if (!this.#isIdentifier) debugger;
1174
- const node = this.#createNode(54 /* NodeId */);
1288
+ const node = this.#createNode(syntaxKind.NodeId);
1175
1289
  node.id = this.#parseIdentifier();
1176
- node.port = this.#token() === 14 /* ColonToken */ ? this.#parsePortDeclaration() : void 0;
1290
+ node.port = this.#token() === syntaxKind.ColonToken ? this.#parsePortDeclaration() : void 0;
1177
1291
  return this.#finishNode(node);
1178
1292
  }
1179
1293
  #parseCompassPortDeclaration() {
1180
- console.assert(this.#token() === 14 /* ColonToken */);
1181
- const node = this.#createNode(53 /* CompassPortDeclaration */);
1294
+ console.assert(this.#token() === syntaxKind.ColonToken);
1295
+ const node = this.#createNode(syntaxKind.CompassPortDeclaration);
1182
1296
  node.colon = this.#parseTokenNode();
1183
1297
  node.compassPt = this.#parseTokenNode();
1184
1298
  return this.#finishNode(node);
1185
1299
  }
1186
1300
  #parseNormalPortDeclaration() {
1187
- console.assert(this.#token() === 14 /* ColonToken */);
1188
- const node = this.#createNode(52 /* NormalPortDeclaration */);
1301
+ console.assert(this.#token() === syntaxKind.ColonToken);
1302
+ const node = this.#createNode(syntaxKind.NormalPortDeclaration);
1189
1303
  node.colon = this.#parseTokenNode();
1190
1304
  node.id = this.#parseIdentifier();
1191
- node.compassPt = this.#token() === 14 /* ColonToken */ ? this.#parseCompassPortDeclaration() : void 0;
1305
+ node.compassPt = this.#token() === syntaxKind.ColonToken ? this.#parseCompassPortDeclaration() : void 0;
1192
1306
  return this.#finishNode(node);
1193
1307
  }
1194
1308
  #parsePortDeclaration() {
1195
- console.assert(this.#token() === 14 /* ColonToken */);
1309
+ console.assert(this.#token() === syntaxKind.ColonToken);
1196
1310
  if (this.#lookAhead(() => this.#isCompassPort()))
1197
1311
  return this.#parseCompassPortDeclaration();
1198
1312
  return this.#parseNormalPortDeclaration();
1199
1313
  }
1200
1314
  #isCompassPort() {
1201
- console.assert(this.#token() === 14 /* ColonToken */);
1202
- if (this.#token() !== 14 /* ColonToken */) return false;
1315
+ console.assert(this.#token() === syntaxKind.ColonToken);
1316
+ if (this.#token() !== syntaxKind.ColonToken) return false;
1203
1317
  this.#nextToken();
1204
1318
  return this.#isCompassPortKind(this.#token());
1205
1319
  }
@@ -1223,27 +1337,27 @@ var Parser = class {
1223
1337
  }
1224
1338
  #getContextParseError(context) {
1225
1339
  switch (context) {
1226
- case 1 /* StatementList */:
1340
+ case parsingContext.StatementList:
1227
1341
  return "Assignment, node definition, graph/node/edge attribute or edge definition expected.";
1228
- case 3 /* AssignmentList */:
1342
+ case parsingContext.AssignmentList:
1229
1343
  return "Assignment expected.";
1230
- case 4 /* EdgeRhsList */:
1344
+ case parsingContext.EdgeRhsList:
1231
1345
  return "Edge operation expected.";
1232
- case 5 /* QuotedTextIdentifierConcatenation */:
1346
+ case parsingContext.QuotedTextIdentifierConcatenation:
1233
1347
  return "Quoted identifier expected";
1234
- case 2 /* AttributeContainerList */:
1348
+ case parsingContext.AttributeContainerList:
1235
1349
  return "Attribute marker expected.";
1236
1350
  // TODO: Was besseres finden
1237
- case 0 /* None */:
1351
+ case parsingContext.None:
1238
1352
  return "Wat, no parsing context";
1239
- case 6 /* Count */:
1353
+ case parsingContext.Count:
1240
1354
  return "Wat, 'Count' parsing context";
1241
1355
  default:
1242
1356
  return assertNever(context);
1243
1357
  }
1244
1358
  }
1245
1359
  #isInSomeParsingContext() {
1246
- for (let ctx = 0; ctx < 6 /* Count */; ctx++) {
1360
+ for (let ctx = 0; ctx < parsingContext.Count; ctx++) {
1247
1361
  if (this.currentContext & 1 << ctx) {
1248
1362
  if (this.#isListElement(
1249
1363
  ctx,
@@ -1259,7 +1373,7 @@ var Parser = class {
1259
1373
  #abortListParsing(context) {
1260
1374
  this.#parseErrorAtCurrentToken(
1261
1375
  this.#getContextParseError(context),
1262
- 2 /* FailedListParsing */
1376
+ parseError.FailedListParsing
1263
1377
  );
1264
1378
  if (this.#isInSomeParsingContext()) {
1265
1379
  return true;
@@ -1269,34 +1383,34 @@ var Parser = class {
1269
1383
  }
1270
1384
  #isListElement(context, _inErrorRecovery) {
1271
1385
  switch (context) {
1272
- case 3 /* AssignmentList */:
1386
+ case parsingContext.AssignmentList:
1273
1387
  return this.#isIdentifier();
1274
- case 2 /* AttributeContainerList */:
1275
- return this.#token() === 12 /* OpenBracketToken */;
1276
- case 4 /* EdgeRhsList */:
1277
- return this.#token() === 39 /* DirectedEdgeOp */ || this.#token() === 40 /* UndirectedEdgeOp */;
1278
- case 5 /* QuotedTextIdentifierConcatenation */:
1279
- return this.#token() === 28 /* StringLiteral */ || this.#token() === 9 /* PlusToken */;
1280
- case 1 /* StatementList */:
1281
- return this.#isIdentifier() || this.#token() === 37 /* SubgraphKeyword */ || this.#token() === 10 /* OpenBraceToken */ || this.#token() === 33 /* GraphKeyword */ || this.#token() === 36 /* EdgeKeyword */ || this.#token() === 35 /* NodeKeyword */;
1388
+ case parsingContext.AttributeContainerList:
1389
+ return this.#token() === syntaxKind.OpenBracketToken;
1390
+ case parsingContext.EdgeRhsList:
1391
+ return this.#token() === syntaxKind.DirectedEdgeOp || this.#token() === syntaxKind.UndirectedEdgeOp;
1392
+ case parsingContext.QuotedTextIdentifierConcatenation:
1393
+ return this.#token() === syntaxKind.StringLiteral || this.#token() === syntaxKind.PlusToken;
1394
+ case parsingContext.StatementList:
1395
+ return this.#isIdentifier() || this.#token() === syntaxKind.SubgraphKeyword || this.#token() === syntaxKind.OpenBraceToken || this.#token() === syntaxKind.GraphKeyword || this.#token() === syntaxKind.EdgeKeyword || this.#token() === syntaxKind.NodeKeyword;
1282
1396
  default:
1283
1397
  throw "This should never happen";
1284
1398
  }
1285
1399
  }
1286
1400
  #isListTerminator(context) {
1287
1401
  const token = this.#token();
1288
- if (token === 1 /* EndOfFileToken */) return true;
1402
+ if (token === syntaxKind.EndOfFileToken) return true;
1289
1403
  switch (context) {
1290
- case 1 /* StatementList */:
1291
- return token === 11 /* CloseBraceToken */;
1292
- case 2 /* AttributeContainerList */:
1293
- return token !== 12 /* OpenBracketToken */;
1294
- case 3 /* AssignmentList */:
1295
- return token === 13 /* CloseBracketToken */;
1296
- case 4 /* EdgeRhsList */:
1297
- return token !== 39 /* DirectedEdgeOp */ && token !== 40 /* UndirectedEdgeOp */;
1298
- case 5 /* QuotedTextIdentifierConcatenation */:
1299
- return token !== 9 /* PlusToken */;
1404
+ case parsingContext.StatementList:
1405
+ return token === syntaxKind.CloseBraceToken;
1406
+ case parsingContext.AttributeContainerList:
1407
+ return token !== syntaxKind.OpenBracketToken;
1408
+ case parsingContext.AssignmentList:
1409
+ return token === syntaxKind.CloseBracketToken;
1410
+ case parsingContext.EdgeRhsList:
1411
+ return token !== syntaxKind.DirectedEdgeOp && token !== syntaxKind.UndirectedEdgeOp;
1412
+ case parsingContext.QuotedTextIdentifierConcatenation:
1413
+ return token !== syntaxKind.PlusToken;
1300
1414
  default:
1301
1415
  throw "Unsupported parsing context";
1302
1416
  }
@@ -1310,14 +1424,14 @@ var Parser = class {
1310
1424
  node.end = end === void 0 ? this.scanner.startPos : end;
1311
1425
  if (this.currentNodeHasError) {
1312
1426
  this.currentNodeHasError = false;
1313
- node.flags |= 2 /* ContainsErrors */;
1427
+ node.flags |= syntaxNodeFlags.ContainsErrors;
1314
1428
  }
1315
1429
  return node;
1316
1430
  }
1317
1431
  #createNode(kind, pos) {
1318
1432
  this.nodeCount++;
1319
1433
  const p = pos !== void 0 && pos >= 0 ? pos : this.scanner.startPos;
1320
- if (isNodeKind(kind) || kind === 0 /* Unknown */) return newNode(kind, p, p);
1434
+ if (isNodeKind(kind) || kind === syntaxKind.Unknown) return newNode(kind, p, p);
1321
1435
  return isIdentifier(kind) ? newIdentifier(kind, p, p) : newToken(kind, p, p);
1322
1436
  }
1323
1437
  #createNodeArray(elements, pos, end) {
@@ -1340,7 +1454,7 @@ var Parser = class {
1340
1454
  const lastError = this.#getLastError(ds);
1341
1455
  if (!lastError || start !== lastError.start) {
1342
1456
  ds.push({
1343
- category: 1 /* Error */,
1457
+ category: diagnosticCategory.Error,
1344
1458
  start,
1345
1459
  end,
1346
1460
  message,
@@ -1351,7 +1465,7 @@ var Parser = class {
1351
1465
  }
1352
1466
  #parseErrorAtCurrentToken(message, sub) {
1353
1467
  const error = {
1354
- source: 2 /* Parse */,
1468
+ source: errorSource.Parse,
1355
1469
  sub
1356
1470
  };
1357
1471
  return this.#parseErrorAtPosition(this.scanner.tokenPos, this.scanner.pos, message, error);
@@ -1359,18 +1473,18 @@ var Parser = class {
1359
1473
  #scanError(message, _category, sub, length) {
1360
1474
  const errorPos = this.scanner.pos;
1361
1475
  const err = {
1362
- source: 1 /* Scan */,
1476
+ source: errorSource.Scan,
1363
1477
  sub
1364
1478
  };
1365
1479
  this.#parseErrorAtPosition(errorPos, errorPos + length, message, err);
1366
1480
  }
1367
1481
  #reportExpectedError(expectedKinds) {
1368
- const found = this.#isIdentifier() ? "identifier" : this.#token() === 1 /* EndOfFileToken */ ? "end of file" : `"${getTokenAsText(this.#token())}"`;
1482
+ const found = this.#isIdentifier() ? "identifier" : this.#token() === syntaxKind.EndOfFileToken ? "end of file" : `"${getTokenAsText(this.#token())}"`;
1369
1483
  const expected = expectedKinds.map((k) => {
1370
1484
  if (isIdentifier(k)) {
1371
1485
  return "identifier";
1372
1486
  }
1373
- if (k === 1 /* EndOfFileToken */) {
1487
+ if (k === syntaxKind.EndOfFileToken) {
1374
1488
  return "end of file";
1375
1489
  }
1376
1490
  return `"${getTokenAsText(k)}"`;
@@ -1378,8 +1492,9 @@ var Parser = class {
1378
1492
  const lastExpected = expected.pop();
1379
1493
  const expectedJoined = expected.join(", ");
1380
1494
  const msg = expected.length > 0 ? `Expected ${expectedJoined} or ${lastExpected} but found ${found} instead.` : `Expected ${lastExpected} but found ${found} instead.`;
1381
- this.#parseErrorAtCurrentToken(msg, 0 /* ExpectationFailed */);
1495
+ this.#parseErrorAtCurrentToken(msg, parseError.ExpectationFailed);
1382
1496
  }
1497
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: TODO
1383
1498
  #parseExpectedOneOf(...kinds) {
1384
1499
  if (kinds.length < 2) {
1385
1500
  console.assert(false);
@@ -1415,6 +1530,7 @@ var Parser = class {
1415
1530
  this.#reportExpectedError([kind]);
1416
1531
  return this.#createMissingNode(kind);
1417
1532
  }
1533
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: TODO
1418
1534
  #parseExpected(kind) {
1419
1535
  const res = this.#parseOptional(kind);
1420
1536
  if (!res) this.#reportExpectedError([kind]);
@@ -1435,8 +1551,8 @@ var Parser = class {
1435
1551
  }
1436
1552
  #isEdgeOp() {
1437
1553
  switch (this.#token()) {
1438
- case 39 /* DirectedEdgeOp */:
1439
- case 40 /* UndirectedEdgeOp */:
1554
+ case syntaxKind.DirectedEdgeOp:
1555
+ case syntaxKind.UndirectedEdgeOp:
1440
1556
  return true;
1441
1557
  default:
1442
1558
  return false;
@@ -1444,17 +1560,17 @@ var Parser = class {
1444
1560
  }
1445
1561
  #isIdentifier() {
1446
1562
  switch (this.#token()) {
1447
- case 30 /* TextIdentifier */:
1448
- case 32 /* NumericIdentifier */:
1449
- case 28 /* StringLiteral */:
1450
- case 29 /* HtmlIdentifier */:
1563
+ case syntaxKind.TextIdentifier:
1564
+ case syntaxKind.NumericIdentifier:
1565
+ case syntaxKind.StringLiteral:
1566
+ case syntaxKind.HtmlIdentifier:
1451
1567
  return true;
1452
1568
  default:
1453
1569
  return false;
1454
1570
  }
1455
1571
  }
1456
1572
  #isCompassPortKind(kind) {
1457
- return kind >= 26 /* CompassCenterToken */ && kind <= 27 /* CompassEnd */;
1573
+ return kind >= syntaxKind.CompassCenterToken && kind <= syntaxKind.CompassEnd;
1458
1574
  }
1459
1575
  #speculationHelper(callback, isLookAhead) {
1460
1576
  const saveToken = this.#token();
@@ -1482,6 +1598,7 @@ var Parser = class {
1482
1598
  * callback returns something truthy, then the parser state is not rolled back. The result
1483
1599
  * of invoking the callback is returned from this function.
1484
1600
  */
1601
+ // biome-ignore lint/correctness/noUnusedPrivateClassMembers: TODO
1485
1602
  #tryParse(callback) {
1486
1603
  return this.#speculationHelper(
1487
1604
  callback,
@@ -1493,7 +1610,7 @@ var Parser = class {
1493
1610
  function newNode(kind, pos, end) {
1494
1611
  return {
1495
1612
  kind,
1496
- flags: 0 /* None */,
1613
+ flags: syntaxNodeFlags.None,
1497
1614
  end,
1498
1615
  pos,
1499
1616
  parent: void 0
@@ -1502,10 +1619,10 @@ function newNode(kind, pos, end) {
1502
1619
  var newIdentifier = newNode;
1503
1620
  var newToken = newNode;
1504
1621
  function isNodeKind(kind) {
1505
- return kind >= 41 /* FirstNode */;
1622
+ return kind >= syntaxKind.FirstNode;
1506
1623
  }
1507
1624
  function isIdentifier(kind) {
1508
- return kind === 29 /* HtmlIdentifier */ || kind === 32 /* NumericIdentifier */ || kind === 30 /* TextIdentifier */ || kind === 31 /* QuotedTextIdentifier */;
1625
+ return kind === syntaxKind.HtmlIdentifier || kind === syntaxKind.NumericIdentifier || kind === syntaxKind.TextIdentifier || kind === syntaxKind.QuotedTextIdentifier;
1509
1626
  }
1510
1627
  function isIdentifierNode(node) {
1511
1628
  return isIdentifier(node.kind);
@@ -2522,36 +2639,36 @@ function visitNodes(cbNode, cbNodes, nodes) {
2522
2639
  return void 0;
2523
2640
  }
2524
2641
  function forEachChild(node, cbNode, cbNodes) {
2525
- if (!node || node.kind <= 38 /* LastKeyword */) return;
2642
+ if (!node || node.kind <= syntaxKind.LastKeyword) return;
2526
2643
  switch (node.kind) {
2527
- case 41 /* DirectedGraph */:
2528
- case 42 /* UndirectedGraph */:
2644
+ case syntaxKind.DirectedGraph:
2645
+ case syntaxKind.UndirectedGraph:
2529
2646
  return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.strict) || visitNode(cbNode, node.id);
2530
- case 45 /* AttributeStatement */:
2647
+ case syntaxKind.AttributeStatement:
2531
2648
  return visitNodes(cbNode, cbNodes, node.attributes) || visitNode(cbNode, node.subject) || visitNode(cbNode, node.terminator);
2532
- case 44 /* EdgeStatement */:
2649
+ case syntaxKind.EdgeStatement:
2533
2650
  return visitNodes(cbNode, cbNodes, node.attributes) || visitNodes(cbNode, cbNodes, node.rhs) || visitNode(cbNode, node.source) || visitNode(cbNode, node.terminator);
2534
- case 43 /* NodeStatement */:
2651
+ case syntaxKind.NodeStatement:
2535
2652
  return visitNodes(cbNode, cbNodes, node.attributes) || visitNode(cbNode, node.id) || visitNode(cbNode, node.terminator);
2536
- case 47 /* SubGraph */:
2653
+ case syntaxKind.SubGraph:
2537
2654
  return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.id);
2538
- case 48 /* SubGraphStatement */:
2655
+ case syntaxKind.SubGraphStatement:
2539
2656
  return visitNode(cbNode, node.subgraph) || visitNode(cbNode, node.terminator);
2540
- case 46 /* IdEqualsIdStatement */:
2657
+ case syntaxKind.IdEqualsIdStatement:
2541
2658
  return visitNode(cbNode, node.leftId) || visitNode(cbNode, node.rightId) || visitNode(cbNode, node.terminator);
2542
- case 31 /* QuotedTextIdentifier */:
2659
+ case syntaxKind.QuotedTextIdentifier:
2543
2660
  return visitNodes(cbNode, cbNodes, node.values);
2544
- case 49 /* EdgeRhs */:
2661
+ case syntaxKind.EdgeRhs:
2545
2662
  return visitNode(cbNode, node.operation) || visitNode(cbNode, node.target);
2546
- case 50 /* AttributeContainer */:
2663
+ case syntaxKind.AttributeContainer:
2547
2664
  return visitNodes(cbNode, cbNodes, node.assignments);
2548
- case 51 /* Assignment */:
2665
+ case syntaxKind.Assignment:
2549
2666
  return visitNode(cbNode, node.leftId) || visitNode(cbNode, node.rightId) || visitNode(cbNode, node.terminator);
2550
- case 52 /* NormalPortDeclaration */:
2667
+ case syntaxKind.NormalPortDeclaration:
2551
2668
  return visitNode(cbNode, node.colon) || visitNode(cbNode, node.id) || visitNode(cbNode, node.compassPt);
2552
- case 53 /* CompassPortDeclaration */:
2669
+ case syntaxKind.CompassPortDeclaration:
2553
2670
  return visitNode(cbNode, node.colon) || visitNode(cbNode, node.compassPt);
2554
- case 54 /* NodeId */:
2671
+ case syntaxKind.NodeId:
2555
2672
  return visitNode(cbNode, node.port) || visitNode(cbNode, node.id);
2556
2673
  default:
2557
2674
  return void 0;
@@ -2583,7 +2700,7 @@ function findNodeAtOffset(root, offset, inclusiveEnd = false) {
2583
2700
  return void 0;
2584
2701
  }
2585
2702
  function getAllowedEdgeOperation(graph) {
2586
- return graph.kind === 41 /* DirectedGraph */ ? 39 /* DirectedEdgeOp */ : 40 /* UndirectedEdgeOp */;
2703
+ return graph.kind === syntaxKind.DirectedGraph ? syntaxKind.DirectedEdgeOp : syntaxKind.UndirectedEdgeOp;
2587
2704
  }
2588
2705
  function checkGraphSemantics(file, root) {
2589
2706
  const expectedEdgeOp = getAllowedEdgeOperation(root);
@@ -2594,7 +2711,7 @@ function checkGraphSemantics(file, root) {
2594
2711
  }
2595
2712
  function forEachAssignmentTransitive(root, cb) {
2596
2713
  forEachChild(root, (child) => {
2597
- if (child.kind === 51 /* Assignment */) {
2714
+ if (child.kind === syntaxKind.Assignment) {
2598
2715
  cb(child);
2599
2716
  return;
2600
2717
  }
@@ -2605,7 +2722,7 @@ function checkShapeLabelValues(root) {
2605
2722
  const invalidShapes = [];
2606
2723
  forEachAssignmentTransitive(root, (assignment) => {
2607
2724
  const { leftId, rightId } = assignment;
2608
- if (leftId.kind !== 30 /* TextIdentifier */ || rightId.kind !== 30 /* TextIdentifier */) {
2725
+ if (leftId.kind !== syntaxKind.TextIdentifier || rightId.kind !== syntaxKind.TextIdentifier) {
2609
2726
  return;
2610
2727
  }
2611
2728
  const leftText = leftId.text.trim();
@@ -2618,8 +2735,8 @@ function checkShapeLabelValues(root) {
2618
2735
  return;
2619
2736
  }
2620
2737
  invalidShapes.push({
2621
- category: 2 /* Warning */,
2622
- code: createCheckerError(1 /* InvalidShapeName */),
2738
+ category: diagnosticCategory.Warning,
2739
+ code: createCheckerError(checkError.InvalidShapeName),
2623
2740
  message: `Unknown shape "${rightText}".`,
2624
2741
  start: rightId.pos,
2625
2742
  end: rightId.end
@@ -2646,7 +2763,7 @@ function findOptionalSemicolons(node) {
2646
2763
  return terminators.filter((t) => !!t);
2647
2764
  }
2648
2765
  function isStatement(node) {
2649
- return node.kind === 48 /* SubGraphStatement */ || node.kind === 44 /* EdgeStatement */ || node.kind === 43 /* NodeStatement */ || node.kind === 46 /* IdEqualsIdStatement */ || node.kind === 45 /* AttributeStatement */;
2766
+ return node.kind === syntaxKind.SubGraphStatement || node.kind === syntaxKind.EdgeStatement || node.kind === syntaxKind.NodeStatement || node.kind === syntaxKind.IdEqualsIdStatement || node.kind === syntaxKind.AttributeStatement;
2650
2767
  }
2651
2768
  function findAllStatements(node, kind) {
2652
2769
  const allStatements = [];
@@ -2665,20 +2782,20 @@ function findEdgeErrors(expectedEdgeOp, node) {
2665
2782
  const wrongEdges = edges && edges.length > 0 ? edges.filter((e) => e.operation.kind !== expectedEdgeOp) : void 0;
2666
2783
  if (wrongEdges && wrongEdges.length > 0) {
2667
2784
  for (const edge of wrongEdges) {
2668
- edge.operation.flags |= 2 /* ContainsErrors */;
2785
+ edge.operation.flags |= syntaxNodeFlags.ContainsErrors;
2669
2786
  }
2670
2787
  return wrongEdges;
2671
2788
  }
2672
2789
  return void 0;
2673
2790
  }
2674
2791
  function createEdgeViolationDiagnostics(file, expectedEdgeOp, violators) {
2675
- const op = expectedEdgeOp === 40 /* UndirectedEdgeOp */ ? "--" : "->";
2676
- const graphType = expectedEdgeOp === 40 /* UndirectedEdgeOp */ ? "undirected" : "directed";
2792
+ const op = expectedEdgeOp === syntaxKind.UndirectedEdgeOp ? "--" : "->";
2793
+ const graphType = expectedEdgeOp === syntaxKind.UndirectedEdgeOp ? "undirected" : "directed";
2677
2794
  const message = `Invalid edge operation, use "${op}" in ${graphType} graph`;
2678
- const code = createCheckerError(0 /* InvalidEdgeOperation */);
2679
- const category = 1 /* Error */;
2795
+ const code = createCheckerError(checkError.InvalidEdgeOperation);
2796
+ const category = diagnosticCategory.Error;
2680
2797
  for (const edge of violators) {
2681
- edge.operation.flags |= 2 /* ContainsErrors */;
2798
+ edge.operation.flags |= syntaxNodeFlags.ContainsErrors;
2682
2799
  }
2683
2800
  return violators.map((edge) => {
2684
2801
  const start = getStart(file, edge.operation);
@@ -2693,26 +2810,26 @@ function createEdgeViolationDiagnostics(file, expectedEdgeOp, violators) {
2693
2810
  });
2694
2811
  }
2695
2812
  function isAttrStatement(node) {
2696
- return node.kind === 45 /* AttributeStatement */;
2813
+ return node.kind === syntaxKind.AttributeStatement;
2697
2814
  }
2698
2815
  function isEdgeStatement(node) {
2699
- return node.kind === 44 /* EdgeStatement */;
2816
+ return node.kind === syntaxKind.EdgeStatement;
2700
2817
  }
2701
2818
  function isNodeId(node) {
2702
- return node.kind === 54 /* NodeId */;
2819
+ return node.kind === syntaxKind.NodeId;
2703
2820
  }
2704
2821
  function edgeStatementHasAttributes(es) {
2705
2822
  return es.attributes && es.attributes.length > 0 && es.attributes.some((a) => a.assignments && a.assignments.length > 0);
2706
2823
  }
2707
2824
  function getIdentifierText(n) {
2708
2825
  switch (n.kind) {
2709
- case 29 /* HtmlIdentifier */:
2826
+ case syntaxKind.HtmlIdentifier:
2710
2827
  return n.htmlContent;
2711
- case 30 /* TextIdentifier */:
2828
+ case syntaxKind.TextIdentifier:
2712
2829
  return n.text;
2713
- case 32 /* NumericIdentifier */:
2830
+ case syntaxKind.NumericIdentifier:
2714
2831
  return n.text;
2715
- case 31 /* QuotedTextIdentifier */:
2832
+ case syntaxKind.QuotedTextIdentifier:
2716
2833
  return n.concatenation;
2717
2834
  // Assertion because concatenation is filled in binding step
2718
2835
  default:
@@ -2721,12 +2838,12 @@ function getIdentifierText(n) {
2721
2838
  }
2722
2839
  function createCheckerError(sub) {
2723
2840
  return {
2724
- source: 4 /* Check */,
2841
+ source: errorSource.Check,
2725
2842
  sub
2726
2843
  };
2727
2844
  }
2728
2845
  function nodeContainsErrors(node) {
2729
- return (node.flags & 2 /* ContainsErrors */) === 2 /* ContainsErrors */;
2846
+ return (node.flags & syntaxNodeFlags.ContainsErrors) === syntaxNodeFlags.ContainsErrors;
2730
2847
  }
2731
2848
 
2732
2849
  // src/binder.ts
@@ -2738,63 +2855,63 @@ function createBinder() {
2738
2855
  let parent;
2739
2856
  let symbolTable;
2740
2857
  let colorTable;
2741
- let graphContext = 0 /* None */;
2858
+ let gc = graphContext.None;
2742
2859
  function bind(node) {
2743
2860
  if (!node) return;
2744
2861
  const saveParent = parent;
2745
- const saveContext = graphContext;
2862
+ const saveContext = gc;
2746
2863
  node.parent = saveParent;
2747
2864
  node.graphContext = saveContext;
2748
2865
  parent = node;
2749
2866
  innerBind(node);
2750
2867
  parent = saveParent;
2751
- graphContext = saveContext;
2868
+ gc = saveContext;
2752
2869
  }
2753
2870
  function innerBind(node) {
2754
2871
  switch (node.kind) {
2755
- case 41 /* DirectedGraph */:
2756
- case 42 /* UndirectedGraph */:
2872
+ case syntaxKind.DirectedGraph:
2873
+ case syntaxKind.UndirectedGraph:
2757
2874
  return bindGraph(node);
2758
- case 45 /* AttributeStatement */:
2875
+ case syntaxKind.AttributeStatement:
2759
2876
  return bindAttributeStatement(node);
2760
- case 44 /* EdgeStatement */:
2877
+ case syntaxKind.EdgeStatement:
2761
2878
  return bindEdgeStatement(node);
2762
- case 43 /* NodeStatement */:
2879
+ case syntaxKind.NodeStatement:
2763
2880
  return bindNodeStatement(node);
2764
- case 47 /* SubGraph */:
2881
+ case syntaxKind.SubGraph:
2765
2882
  return bindSubGraph(node);
2766
- case 48 /* SubGraphStatement */:
2883
+ case syntaxKind.SubGraphStatement:
2767
2884
  return bindSubGraphStatement(node);
2768
- case 46 /* IdEqualsIdStatement */:
2885
+ case syntaxKind.IdEqualsIdStatement:
2769
2886
  return bindIdEqualsIdStatement(node);
2770
- case 31 /* QuotedTextIdentifier */:
2887
+ case syntaxKind.QuotedTextIdentifier:
2771
2888
  return bindQuotedTextIdentifier(node);
2772
- case 49 /* EdgeRhs */:
2889
+ case syntaxKind.EdgeRhs:
2773
2890
  return bindEdgeRhs(node);
2774
- case 50 /* AttributeContainer */:
2891
+ case syntaxKind.AttributeContainer:
2775
2892
  return bindAttributeContainer(node);
2776
- case 51 /* Assignment */:
2893
+ case syntaxKind.Assignment:
2777
2894
  return bindAssignment(node);
2778
- case 52 /* NormalPortDeclaration */:
2895
+ case syntaxKind.NormalPortDeclaration:
2779
2896
  return bindNormalPortDeclaration(node);
2780
- case 53 /* CompassPortDeclaration */:
2897
+ case syntaxKind.CompassPortDeclaration:
2781
2898
  return bindCompassPortDeclaration(node);
2782
- case 54 /* NodeId */:
2899
+ case syntaxKind.NodeId:
2783
2900
  return bindNodeId(node);
2784
2901
  default:
2785
- if (node.kind >= 41 /* FirstNode */) throw "TODO";
2902
+ if (node.kind >= syntaxKind.FirstNode) throw "TODO";
2786
2903
  }
2787
2904
  }
2788
2905
  function bindGraph(node) {
2789
2906
  if (node.strict) {
2790
- graphContext |= 2 /* Strict */;
2907
+ gc |= graphContext.Strict;
2791
2908
  }
2792
2909
  switch (node.kind) {
2793
- case 41 /* DirectedGraph */:
2794
- graphContext |= 4 /* Directed */;
2910
+ case syntaxKind.DirectedGraph:
2911
+ gc |= graphContext.Directed;
2795
2912
  break;
2796
- case 42 /* UndirectedGraph */:
2797
- graphContext |= 8 /* Undirected */;
2913
+ case syntaxKind.UndirectedGraph:
2914
+ gc |= graphContext.Undirected;
2798
2915
  break;
2799
2916
  }
2800
2917
  if (node.id) {
@@ -2867,14 +2984,14 @@ function createBinder() {
2867
2984
  bind(node.leftId);
2868
2985
  let carrierIdentifier;
2869
2986
  switch (superParentStatement.kind) {
2870
- case 43 /* NodeStatement */:
2987
+ case syntaxKind.NodeStatement:
2871
2988
  carrierIdentifier = superParentStatement.id.id;
2872
2989
  break;
2873
- case 44 /* EdgeStatement */:
2990
+ case syntaxKind.EdgeStatement:
2874
2991
  break;
2875
- case 48 /* SubGraphStatement */:
2992
+ case syntaxKind.SubGraphStatement:
2876
2993
  break;
2877
- case 45 /* AttributeStatement */:
2994
+ case syntaxKind.AttributeStatement:
2878
2995
  break;
2879
2996
  }
2880
2997
  if (carrierIdentifier) ensureMemberSymbol(node.leftId, carrierIdentifier);
@@ -2996,19 +3113,19 @@ function createChangeToEdit(start, end, changeTo) {
2996
3113
  return TextEdit.replace(Range.create(start, end), changeTo);
2997
3114
  }
2998
3115
  function getEdgeStr(op) {
2999
- return op === 39 /* DirectedEdgeOp */ ? "->" : "--";
3116
+ return op === syntaxKind.DirectedEdgeOp ? "->" : "--";
3000
3117
  }
3001
3118
  function getGraphKeywordStr(g) {
3002
- return g === 34 /* DigraphKeyword */ ? "digraph" : "graph";
3119
+ return g === syntaxKind.DigraphKeyword ? "digraph" : "graph";
3003
3120
  }
3004
3121
  function getOppositeKind(g) {
3005
- return g === 34 /* DigraphKeyword */ ? 33 /* GraphKeyword */ : 34 /* DigraphKeyword */;
3122
+ return g === syntaxKind.DigraphKeyword ? syntaxKind.GraphKeyword : syntaxKind.DigraphKeyword;
3006
3123
  }
3007
3124
  function getOppositeEdgeOp(g) {
3008
- return g === 39 /* DirectedEdgeOp */ ? 40 /* UndirectedEdgeOp */ : 39 /* DirectedEdgeOp */;
3125
+ return g === syntaxKind.DirectedEdgeOp ? syntaxKind.UndirectedEdgeOp : syntaxKind.DirectedEdgeOp;
3009
3126
  }
3010
3127
  function getAllowedOp(g) {
3011
- return g === 34 /* DigraphKeyword */ ? 39 /* DirectedEdgeOp */ : 40 /* UndirectedEdgeOp */;
3128
+ return g === syntaxKind.DigraphKeyword ? syntaxKind.DirectedEdgeOp : syntaxKind.UndirectedEdgeOp;
3012
3129
  }
3013
3130
 
3014
3131
  // src/service/command/ChangeAllOtherEdgeOpsAndFixGraphCommand.ts
@@ -3018,7 +3135,7 @@ function create(edgeOffsets, changeEdgesTo, graphOffset, changeFromGraph, change
3018
3135
  const edgeStr = getEdgeStr(changeEdgesTo);
3019
3136
  return {
3020
3137
  title,
3021
- command: "DOT.convertGraphType" /* ConvertGraphType */,
3138
+ command: commandIds.ConvertGraphType,
3022
3139
  arguments: [edgeOffsets, edgeStr, graphOffset, toGraph]
3023
3140
  };
3024
3141
  }
@@ -3043,7 +3160,7 @@ function execute(doc, _sourceFile, cmd) {
3043
3160
  };
3044
3161
  }
3045
3162
  function isChangeAllOtherEdgeOpsAndFixGraphCommand(cmd) {
3046
- return cmd.command === "DOT.convertGraphType" /* ConvertGraphType */ && !!cmd.arguments && cmd.arguments.length === 4;
3163
+ return cmd.command === commandIds.ConvertGraphType && !!cmd.arguments && cmd.arguments.length === 4;
3047
3164
  }
3048
3165
 
3049
3166
  // src/service/command/ChangeEdgeOpCommand.ts
@@ -3053,7 +3170,7 @@ function create2(startOffset, endOffset, changeTo, changeFrom) {
3053
3170
  const to = getEdgeStr(changeTo);
3054
3171
  return {
3055
3172
  title: `Change "${from}" to "${to}".`,
3056
- command: "DOT.changeEdgeOp" /* ChangeEdgeOp */,
3173
+ command: commandIds.ChangeEdgeOp,
3057
3174
  arguments: [startOffset, endOffset, to]
3058
3175
  };
3059
3176
  }
@@ -3072,7 +3189,7 @@ function execute2(doc, _sourceFile, cmd) {
3072
3189
  };
3073
3190
  }
3074
3191
  function isChangeEdgeOpCommand(cmd) {
3075
- return cmd.command === "DOT.changeEdgeOp" /* ChangeEdgeOp */ && !!cmd.arguments && cmd.arguments.length === 3;
3192
+ return cmd.command === commandIds.ChangeEdgeOp && !!cmd.arguments && cmd.arguments.length === 3;
3076
3193
  }
3077
3194
 
3078
3195
  // src/service/command/ConsolidateDescendantsCommand.ts
@@ -3082,7 +3199,7 @@ function create3(statements, below) {
3082
3199
  const title = below ? `Convert edges below from "${from}" to subgraph` : `Convert edges from "${from}" to subgraph`;
3083
3200
  return {
3084
3201
  title,
3085
- command: "DOT.consolidateDescendants" /* ConsolidateDescendants */,
3202
+ command: commandIds.ConsolidateDescendants,
3086
3203
  arguments: statements.map((s) => s.pos)
3087
3204
  };
3088
3205
  }
@@ -3153,14 +3270,14 @@ function execute3(doc, sourceFile, cmd) {
3153
3270
  };
3154
3271
  }
3155
3272
  function isConsolidateDescendantsCommand(cmd) {
3156
- return cmd.command === "DOT.consolidateDescendants" /* ConsolidateDescendants */ && !!cmd.arguments && cmd.arguments.length > 1;
3273
+ return cmd.command === commandIds.ConsolidateDescendants && !!cmd.arguments && cmd.arguments.length > 1;
3157
3274
  }
3158
3275
 
3159
3276
  // src/service/command/RemoveSemicolons.ts
3160
3277
  function create4() {
3161
3278
  return {
3162
3279
  title: "Remove optional semicolons",
3163
- command: "DOT.removeSemicolons" /* RemoveSemicolons */,
3280
+ command: commandIds.RemoveSemicolons,
3164
3281
  arguments: void 0
3165
3282
  };
3166
3283
  }
@@ -3184,7 +3301,7 @@ function execute4(doc, sourceFile, cmd) {
3184
3301
  };
3185
3302
  }
3186
3303
  function isRemoveSemicolonsCommand(cmd) {
3187
- return cmd.command === "DOT.removeSemicolons" /* RemoveSemicolons */ && (!cmd.arguments || cmd.arguments.length === 0 || cmd.arguments.every((e) => e === void 0));
3304
+ return cmd.command === commandIds.RemoveSemicolons && (!cmd.arguments || cmd.arguments.length === 0 || cmd.arguments.every((e) => e === void 0));
3188
3305
  }
3189
3306
 
3190
3307
  // src/service/codeAction.ts
@@ -3230,7 +3347,7 @@ function getGeneralRefactorings(doc, file, range) {
3230
3347
  const candidates = [];
3231
3348
  let clickedNode = findNodeAtOffset(g, rangeStartOffset);
3232
3349
  if (clickedNode && !!clickedNode.parent) {
3233
- if (clickedNode.kind === 8 /* SemicolonToken */) {
3350
+ if (clickedNode.kind === syntaxKind.SemicolonToken) {
3234
3351
  res.push(create4());
3235
3352
  }
3236
3353
  if (isIdentifierNode(clickedNode)) {
@@ -3293,31 +3410,31 @@ function getGeneralRefactorings(doc, file, range) {
3293
3410
  }
3294
3411
  function getCommandsForDiagnostic(doc, file, d) {
3295
3412
  switch (d.code.source) {
3296
- case 1 /* Scan */:
3413
+ case errorSource.Scan:
3297
3414
  return getScannerErrorCommand(doc, file, d, d.code);
3298
- case 2 /* Parse */:
3415
+ case errorSource.Parse:
3299
3416
  return getParserErrorCommand(doc, file, d, d.code);
3300
- case 4 /* Check */:
3417
+ case errorSource.Check:
3301
3418
  return getCheckerErrorCommand(doc, file, d, d.code);
3302
3419
  default:
3303
3420
  return assertNever(d.code);
3304
3421
  }
3305
3422
  }
3306
3423
  function getScannerErrorCommand(_doc, _file, d, code) {
3307
- console.assert(d.code.source === 1 /* Scan */);
3308
- console.assert(code.source === 1 /* Scan */);
3424
+ console.assert(d.code.source === errorSource.Scan);
3425
+ console.assert(code.source === errorSource.Scan);
3309
3426
  return void 0;
3310
3427
  }
3311
3428
  function getParserErrorCommand(_doc, _file, d, code) {
3312
- console.assert(d.code.source === 2 /* Parse */);
3313
- console.assert(code.source === 2 /* Parse */);
3429
+ console.assert(d.code.source === errorSource.Parse);
3430
+ console.assert(code.source === errorSource.Parse);
3314
3431
  return void 0;
3315
3432
  }
3316
3433
  function getCheckerErrorCommand(_doc, file, d, code) {
3317
- console.assert(d.code.source === 4 /* Check */);
3318
- console.assert(code.source === 4 /* Check */);
3434
+ console.assert(d.code.source === errorSource.Check);
3435
+ console.assert(code.source === errorSource.Check);
3319
3436
  switch (code.sub) {
3320
- case 0 /* InvalidEdgeOperation */: {
3437
+ case checkError.InvalidEdgeOperation: {
3321
3438
  const graph = file.graph;
3322
3439
  if (!graph) return void 0;
3323
3440
  const allowedOp = getAllowedEdgeOperation(graph);
@@ -3332,7 +3449,7 @@ function getCheckerErrorCommand(_doc, file, d, code) {
3332
3449
  );
3333
3450
  return [fixSingleEdge, fixAll, convertToThisWrongType];
3334
3451
  }
3335
- case 1 /* InvalidShapeName */:
3452
+ case checkError.InvalidShapeName:
3336
3453
  return void 0;
3337
3454
  }
3338
3455
  }
@@ -3361,11 +3478,17 @@ function isInRange(rangeStartOffset, rangeEndOffset, startOffset, endOffset) {
3361
3478
  if (rangeStartOffset === startOffset && rangeEndOffset === endOffset) return true;
3362
3479
  return false;
3363
3480
  }
3481
+ var commandIds = {
3482
+ ChangeEdgeOp: "DOT.changeEdgeOp",
3483
+ ConvertGraphType: "DOT.convertGraphType",
3484
+ ConsolidateDescendants: "DOT.consolidateDescendants",
3485
+ RemoveSemicolons: "DOT.removeSemicolons"
3486
+ };
3364
3487
  var commandHandlers = {
3365
- ["DOT.changeEdgeOp" /* ChangeEdgeOp */]: execute2,
3366
- ["DOT.convertGraphType" /* ConvertGraphType */]: execute,
3367
- ["DOT.consolidateDescendants" /* ConsolidateDescendants */]: execute3,
3368
- ["DOT.removeSemicolons" /* RemoveSemicolons */]: execute4
3488
+ [commandIds.ChangeEdgeOp]: execute2,
3489
+ [commandIds.ConvertGraphType]: execute,
3490
+ [commandIds.ConsolidateDescendants]: execute3,
3491
+ [commandIds.RemoveSemicolons]: execute4
3369
3492
  };
3370
3493
  function getAvailableCommands() {
3371
3494
  return Object.keys(commandHandlers);
@@ -3456,18 +3579,18 @@ function getCompletions(doc, sourceFile, position) {
3456
3579
  if (parent?.parent && isEdgeStatement(parent.parent) || prevOffsetNodeParent?.parent && isEdgeStatement(prevOffsetNodeParent.parent)) {
3457
3580
  return getNodeCompletions(symbols);
3458
3581
  }
3459
- if (node.kind === 50 /* AttributeContainer */) {
3582
+ if (node.kind === syntaxKind.AttributeContainer) {
3460
3583
  const openingBracket = node.openBracket;
3461
3584
  if (openingBracket.end - 1 > offset - 1) {
3462
- const exclusions = prevOffsetNode?.kind === 30 /* TextIdentifier */ && prevOffsetNode.symbol ? [prevOffsetNode.symbol.name] : void 0;
3585
+ const exclusions = prevOffsetNode?.kind === syntaxKind.TextIdentifier && prevOffsetNode.symbol ? [prevOffsetNode.symbol.name] : void 0;
3463
3586
  return getNodeCompletions(symbols, exclusions);
3464
3587
  }
3465
3588
  }
3466
- if (node.kind === 30 /* TextIdentifier */ && parent?.kind === 54 /* NodeId */) {
3589
+ if (node.kind === syntaxKind.TextIdentifier && parent?.kind === syntaxKind.NodeId) {
3467
3590
  const exclusions = node.symbol ? [node.symbol.name] : void 0;
3468
3591
  return getNodeCompletions(symbols, exclusions);
3469
3592
  }
3470
- if (node.kind === 50 /* AttributeContainer */ || node.kind === 7 /* CommaToken */ && parent?.kind === 51 /* Assignment */) {
3593
+ if (node.kind === syntaxKind.AttributeContainer || node.kind === syntaxKind.CommaToken && parent?.kind === syntaxKind.Assignment) {
3471
3594
  return getAttributeCompletions(position);
3472
3595
  }
3473
3596
  const prevNode = findNodeAtOffset(g, node.pos - 1, true);
@@ -3476,21 +3599,19 @@ function getCompletions(doc, sourceFile, position) {
3476
3599
  const p = prevNode.parent;
3477
3600
  if (p) {
3478
3601
  switch (p.kind) {
3479
- case 54 /* NodeId */: {
3602
+ case syntaxKind.NodeId:
3480
3603
  return getNodeCompletions(symbols);
3481
- }
3482
- case 51 /* Assignment */: {
3604
+ case syntaxKind.Assignment:
3483
3605
  return getAssignmentCompletion(p);
3484
- }
3485
3606
  }
3486
3607
  }
3487
3608
  }
3488
- if (node.flags & 2 /* ContainsErrors */ || node.end === node.pos) {
3609
+ if (node.flags & syntaxNodeFlags.ContainsErrors || node.end === node.pos) {
3489
3610
  const attribute = prevNode;
3490
3611
  if (!attribute) return [];
3491
3612
  if (!attribute.parent) throw "sourceFile is not bound";
3492
3613
  const parent2 = attribute.parent;
3493
- if (parent2.kind === 51 /* Assignment */) {
3614
+ if (parent2.kind === syntaxKind.Assignment) {
3494
3615
  return getAssignmentCompletion(parent2);
3495
3616
  }
3496
3617
  }
@@ -3549,8 +3670,8 @@ function getNodeCompletions(symbols, exlucdedSymbols) {
3549
3670
  const a = value.firstMention.parent;
3550
3671
  if (a) {
3551
3672
  switch (a.kind) {
3552
- case 41 /* DirectedGraph */:
3553
- case 42 /* UndirectedGraph */:
3673
+ case syntaxKind.DirectedGraph:
3674
+ case syntaxKind.UndirectedGraph:
3554
3675
  kind = lst2.CompletionItemKind.Class;
3555
3676
  break;
3556
3677
  }
@@ -3592,7 +3713,7 @@ function getHoverContents(n) {
3592
3713
  const parent = n.parent;
3593
3714
  if (parent) {
3594
3715
  switch (parent.kind) {
3595
- case 54 /* NodeId */: {
3716
+ case syntaxKind.NodeId: {
3596
3717
  if (n.symbol?.references) {
3597
3718
  const nodeIdentifierRefs = n.symbol?.references;
3598
3719
  const labelMentions = nodeIdentifierRefs.map(
@@ -3606,7 +3727,7 @@ function getHoverContents(n) {
3606
3727
  )}`;
3607
3728
  }
3608
3729
  }
3609
- } else if (parent.parent?.kind === 43 /* NodeStatement */) {
3730
+ } else if (parent.parent?.kind === syntaxKind.NodeStatement) {
3610
3731
  const label = getAssignedLabel(parent.parent);
3611
3732
  if (label) {
3612
3733
  return `(node) ${getIdentifierText(n)}: ${label}`;
@@ -3614,58 +3735,58 @@ function getHoverContents(n) {
3614
3735
  }
3615
3736
  return `(node) ${getIdentifierText(n)}`;
3616
3737
  }
3617
- case 51 /* Assignment */: {
3738
+ case syntaxKind.Assignment: {
3618
3739
  const assignment = parent;
3619
3740
  const left = getIdentifierText(assignment.leftId);
3620
3741
  const right = getIdentifierText(assignment.rightId);
3621
3742
  return `(assignment) \`${left}\` = \`${right}\``;
3622
3743
  }
3623
- case 41 /* DirectedGraph */:
3744
+ case syntaxKind.DirectedGraph:
3624
3745
  return getGraphHover(parent);
3625
- case 42 /* UndirectedGraph */:
3746
+ case syntaxKind.UndirectedGraph:
3626
3747
  return getGraphHover(parent);
3627
- case 48 /* SubGraphStatement */: {
3748
+ case syntaxKind.SubGraphStatement: {
3628
3749
  const sgs = parent;
3629
3750
  const sg = sgs.subgraph;
3630
3751
  return sg.id ? `(sub graph) ${getIdentifierText(sg.id)}` : "(sub graph)";
3631
3752
  }
3632
- case 47 /* SubGraph */: {
3753
+ case syntaxKind.SubGraph: {
3633
3754
  const sg = parent;
3634
3755
  return sg.id ? `(sub graph) ${getIdentifierText(sg.id)}` : "(sub graph)";
3635
3756
  }
3636
- case 46 /* IdEqualsIdStatement */: {
3757
+ case syntaxKind.IdEqualsIdStatement: {
3637
3758
  const idEqId = parent;
3638
3759
  const left = getIdentifierText(idEqId.leftId);
3639
3760
  const right = getIdentifierText(idEqId.rightId);
3640
3761
  return `(graph property) \`${left}\` = \`${right}\``;
3641
3762
  }
3642
- case 49 /* EdgeRhs */:
3763
+ case syntaxKind.EdgeRhs:
3643
3764
  return getEdgeHover(parent);
3644
3765
  }
3645
- return SyntaxKind[parent.kind];
3766
+ return syntaxKindNames[parent.kind];
3646
3767
  }
3647
- const fallback = SyntaxKind[n.kind];
3768
+ const fallback = syntaxKindNames[n.kind];
3648
3769
  return fallback ? `(${fallback.toLowerCase()})` : void 0;
3649
3770
  }
3650
3771
  switch (n.kind) {
3651
- case 33 /* GraphKeyword */:
3652
- case 34 /* DigraphKeyword */:
3653
- case 38 /* StrictKeyword */:
3772
+ case syntaxKind.GraphKeyword:
3773
+ case syntaxKind.DigraphKeyword:
3774
+ case syntaxKind.StrictKeyword:
3654
3775
  return getGraphHover(n.parent);
3655
3776
  // TODO: Why does findNodeAtOffset() return a non-leaf node
3656
3777
  // Did not expect to need to have this here.
3657
- case 41 /* DirectedGraph */:
3658
- case 42 /* UndirectedGraph */:
3778
+ case syntaxKind.DirectedGraph:
3779
+ case syntaxKind.UndirectedGraph:
3659
3780
  return getGraphHover(n);
3660
- case 39 /* DirectedEdgeOp */:
3661
- case 40 /* UndirectedEdgeOp */:
3781
+ case syntaxKind.DirectedEdgeOp:
3782
+ case syntaxKind.UndirectedEdgeOp:
3662
3783
  return getEdgeHover(n.parent);
3663
3784
  default:
3664
3785
  return void 0;
3665
3786
  }
3666
3787
  }
3667
3788
  function getGraphHover(g) {
3668
- const direction = g.kind === 41 /* DirectedGraph */ ? "directed" : "undirected";
3789
+ const direction = g.kind === syntaxKind.DirectedGraph ? "directed" : "undirected";
3669
3790
  const graphId = g.id;
3670
3791
  const strict = g.strict ? "strict " : "";
3671
3792
  return graphId ? `(${strict}${direction} graph) ${getIdentifierText(graphId)}` : `(${strict}${direction} graph)`;
@@ -3685,7 +3806,7 @@ function getEdgeHover(n) {
3685
3806
  )}`;
3686
3807
  }
3687
3808
  function getEdgeSourceOrTargetText(n) {
3688
- return n.kind === 54 /* NodeId */ ? getIdentifierText(n.id) : n.id !== void 0 ? `${getIdentifierText(n.id)}` : "sub graph";
3809
+ return n.kind === syntaxKind.NodeId ? getIdentifierText(n.id) : n.id !== void 0 ? `${getIdentifierText(n.id)}` : "sub graph";
3689
3810
  }
3690
3811
 
3691
3812
  // src/service/reference.ts
@@ -3767,10 +3888,10 @@ function renameSymbol(doc, sourceFile, position, newName) {
3767
3888
  return void 0;
3768
3889
  }
3769
3890
  function isRenameableNode(node) {
3770
- return node.kind === 54 /* NodeId */ || node.kind === 41 /* DirectedGraph */ || node.kind === 42 /* UndirectedGraph */;
3891
+ return node.kind === syntaxKind.NodeId || node.kind === syntaxKind.DirectedGraph || node.kind === syntaxKind.UndirectedGraph;
3771
3892
  }
3772
3893
  function isRenamableIdentifier(node) {
3773
- return node.kind !== 31 /* QuotedTextIdentifier */;
3894
+ return node.kind !== syntaxKind.QuotedTextIdentifier;
3774
3895
  }
3775
3896
 
3776
3897
  // src/error.ts
@@ -3828,26 +3949,27 @@ function createService() {
3828
3949
  };
3829
3950
  }
3830
3951
  export {
3831
- CharacterCodes,
3832
- CheckError,
3833
3952
  DefaultScanner,
3834
- DiagnosticCategory,
3835
- ErrorSource,
3836
- GraphContext,
3837
- ParseError,
3838
3953
  Parser,
3839
- ParsingContext,
3840
- ScanError,
3841
- SyntaxKind,
3842
- SyntaxNodeFlags,
3843
- TokenFlags,
3954
+ characterCodes,
3955
+ checkError,
3844
3956
  createService,
3957
+ diagnosticCategory,
3958
+ errorSource,
3845
3959
  forEachChild,
3846
3960
  getTextAsToken,
3847
3961
  getTokenAsText,
3962
+ graphContext,
3848
3963
  isIdentifier,
3849
3964
  isIdentifierNode,
3850
3965
  isIdentifierStart,
3851
3966
  isLineBreak,
3852
- skipTrivia
3967
+ parseError,
3968
+ parsingContext,
3969
+ scanError,
3970
+ skipTrivia,
3971
+ syntaxKind,
3972
+ syntaxKindNames,
3973
+ syntaxNodeFlags,
3974
+ tokenFlags
3853
3975
  };