dot-language-support 4.0.4 → 4.1.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.d.mts +61 -63
- package/dist/index.mjs +62 -71
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -162,7 +162,7 @@ interface CompassPortDeclaration extends SyntaxNode {
|
|
|
162
162
|
colon: Token<typeof syntaxKind.ColonToken>;
|
|
163
163
|
compassPt: CompassPort;
|
|
164
164
|
}
|
|
165
|
-
type CompassPort = Token<typeof syntaxKind.CompassNorthToken> | Token<typeof syntaxKind.CompassNorthEastToken> | Token<typeof syntaxKind.CompassEastToken> | Token<typeof syntaxKind.CompassSouthEastToken> | Token<typeof syntaxKind.CompassSouthToken> | Token<typeof syntaxKind.CompassSouthWestToken> | Token<typeof syntaxKind.CompassWestToken> | Token<typeof syntaxKind.CompassNorthWestToken> | Token<typeof syntaxKind.CompassCenterToken
|
|
165
|
+
type CompassPort = Token<typeof syntaxKind.CompassNorthToken> | Token<typeof syntaxKind.CompassNorthEastToken> | Token<typeof syntaxKind.CompassEastToken> | Token<typeof syntaxKind.CompassSouthEastToken> | Token<typeof syntaxKind.CompassSouthToken> | Token<typeof syntaxKind.CompassSouthWestToken> | Token<typeof syntaxKind.CompassWestToken> | Token<typeof syntaxKind.CompassNorthWestToken> | Token<typeof syntaxKind.CompassCenterToken>;
|
|
166
166
|
type EdgeOp = Token<typeof syntaxKind.DirectedEdgeOp> | Token<typeof syntaxKind.UndirectedEdgeOp>;
|
|
167
167
|
interface TextRange {
|
|
168
168
|
pos: number;
|
|
@@ -197,39 +197,38 @@ declare const syntaxKind: {
|
|
|
197
197
|
readonly CompassWestToken: 24;
|
|
198
198
|
readonly CompassNorthWestToken: 25;
|
|
199
199
|
readonly CompassCenterToken: 26;
|
|
200
|
-
readonly
|
|
201
|
-
readonly
|
|
202
|
-
readonly
|
|
203
|
-
readonly
|
|
204
|
-
readonly
|
|
205
|
-
readonly
|
|
206
|
-
readonly
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
210
|
-
readonly
|
|
211
|
-
readonly
|
|
212
|
-
readonly
|
|
213
|
-
readonly
|
|
214
|
-
readonly
|
|
215
|
-
readonly
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
219
|
-
readonly
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
222
|
-
readonly
|
|
223
|
-
readonly
|
|
224
|
-
readonly
|
|
225
|
-
readonly
|
|
226
|
-
readonly
|
|
227
|
-
readonly
|
|
228
|
-
readonly
|
|
229
|
-
readonly FirstNode: 41;
|
|
200
|
+
readonly StringLiteral: 27;
|
|
201
|
+
readonly HtmlIdentifier: 28;
|
|
202
|
+
readonly TextIdentifier: 29;
|
|
203
|
+
readonly QuotedTextIdentifier: 30;
|
|
204
|
+
readonly NumericIdentifier: 31;
|
|
205
|
+
readonly GraphKeyword: 32;
|
|
206
|
+
readonly DigraphKeyword: 33;
|
|
207
|
+
readonly NodeKeyword: 34;
|
|
208
|
+
readonly EdgeKeyword: 35;
|
|
209
|
+
readonly SubgraphKeyword: 36;
|
|
210
|
+
readonly StrictKeyword: 37;
|
|
211
|
+
readonly DirectedEdgeOp: 38;
|
|
212
|
+
readonly UndirectedEdgeOp: 39;
|
|
213
|
+
readonly DirectedGraph: 40;
|
|
214
|
+
readonly UndirectedGraph: 41;
|
|
215
|
+
readonly NodeStatement: 42;
|
|
216
|
+
readonly EdgeStatement: 43;
|
|
217
|
+
readonly AttributeStatement: 44;
|
|
218
|
+
readonly IdEqualsIdStatement: 45;
|
|
219
|
+
readonly SubGraph: 46;
|
|
220
|
+
readonly SubGraphStatement: 47;
|
|
221
|
+
readonly EdgeRhs: 48;
|
|
222
|
+
readonly AttributeContainer: 49;
|
|
223
|
+
readonly Assignment: 50;
|
|
224
|
+
readonly NormalPortDeclaration: 51;
|
|
225
|
+
readonly CompassPortDeclaration: 52;
|
|
226
|
+
readonly NodeId: 53;
|
|
227
|
+
readonly Count: 54;
|
|
228
|
+
readonly FirstNode: 40;
|
|
230
229
|
readonly CompassBegin: 18;
|
|
231
|
-
readonly CompassEnd:
|
|
232
|
-
readonly LastKeyword:
|
|
230
|
+
readonly CompassEnd: 26;
|
|
231
|
+
readonly LastKeyword: 37;
|
|
233
232
|
};
|
|
234
233
|
declare const syntaxKindNames: {
|
|
235
234
|
readonly 0: "Unknown";
|
|
@@ -259,35 +258,34 @@ declare const syntaxKindNames: {
|
|
|
259
258
|
readonly 24: "CompassWestToken";
|
|
260
259
|
readonly 25: "CompassNorthWestToken";
|
|
261
260
|
readonly 26: "CompassCenterToken";
|
|
262
|
-
readonly 27: "
|
|
263
|
-
readonly 28: "
|
|
264
|
-
readonly 29: "
|
|
265
|
-
readonly 30: "
|
|
266
|
-
readonly 31: "
|
|
267
|
-
readonly 32: "
|
|
268
|
-
readonly 33: "
|
|
269
|
-
readonly 34: "
|
|
270
|
-
readonly 35: "
|
|
271
|
-
readonly 36: "
|
|
272
|
-
readonly 37: "
|
|
273
|
-
readonly 38: "
|
|
274
|
-
readonly 39: "
|
|
275
|
-
readonly 40: "
|
|
276
|
-
readonly 41: "
|
|
277
|
-
readonly 42: "
|
|
278
|
-
readonly 43: "
|
|
279
|
-
readonly 44: "
|
|
280
|
-
readonly 45: "
|
|
281
|
-
readonly 46: "
|
|
282
|
-
readonly 47: "
|
|
283
|
-
readonly 48: "
|
|
284
|
-
readonly 49: "
|
|
285
|
-
readonly 50: "
|
|
286
|
-
readonly 51: "
|
|
287
|
-
readonly 52: "
|
|
288
|
-
readonly 53: "
|
|
289
|
-
readonly 54: "
|
|
290
|
-
readonly 55: "Count";
|
|
261
|
+
readonly 27: "StringLiteral";
|
|
262
|
+
readonly 28: "HtmlIdentifier";
|
|
263
|
+
readonly 29: "TextIdentifier";
|
|
264
|
+
readonly 30: "QuotedTextIdentifier";
|
|
265
|
+
readonly 31: "NumericIdentifier";
|
|
266
|
+
readonly 32: "GraphKeyword";
|
|
267
|
+
readonly 33: "DigraphKeyword";
|
|
268
|
+
readonly 34: "NodeKeyword";
|
|
269
|
+
readonly 35: "EdgeKeyword";
|
|
270
|
+
readonly 36: "SubgraphKeyword";
|
|
271
|
+
readonly 37: "StrictKeyword";
|
|
272
|
+
readonly 38: "DirectedEdgeOp";
|
|
273
|
+
readonly 39: "UndirectedEdgeOp";
|
|
274
|
+
readonly 40: "DirectedGraph";
|
|
275
|
+
readonly 41: "UndirectedGraph";
|
|
276
|
+
readonly 42: "NodeStatement";
|
|
277
|
+
readonly 43: "EdgeStatement";
|
|
278
|
+
readonly 44: "AttributeStatement";
|
|
279
|
+
readonly 45: "IdEqualsIdStatement";
|
|
280
|
+
readonly 46: "SubGraph";
|
|
281
|
+
readonly 47: "SubGraphStatement";
|
|
282
|
+
readonly 48: "EdgeRhs";
|
|
283
|
+
readonly 49: "AttributeContainer";
|
|
284
|
+
readonly 50: "Assignment";
|
|
285
|
+
readonly 51: "NormalPortDeclaration";
|
|
286
|
+
readonly 52: "CompassPortDeclaration";
|
|
287
|
+
readonly 53: "NodeId";
|
|
288
|
+
readonly 54: "Count";
|
|
291
289
|
};
|
|
292
290
|
interface SyntaxNode extends TextRange {
|
|
293
291
|
kind: SyntaxKind;
|
|
@@ -536,7 +534,7 @@ declare class Parser {
|
|
|
536
534
|
constructor();
|
|
537
535
|
parse(sourceText: string): SourceFile;
|
|
538
536
|
}
|
|
539
|
-
declare function isIdentifier(kind: SyntaxKind): kind is 29 | 30 | 31
|
|
537
|
+
declare function isIdentifier(kind: SyntaxKind): kind is 28 | 29 | 30 | 31;
|
|
540
538
|
declare function isIdentifierNode(node: SyntaxNode): node is Identifier;
|
|
541
539
|
//#endregion
|
|
542
540
|
//#region src/service/service.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -62,39 +62,38 @@ const syntaxKind = {
|
|
|
62
62
|
CompassWestToken: 24,
|
|
63
63
|
CompassNorthWestToken: 25,
|
|
64
64
|
CompassCenterToken: 26,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
FirstNode: 41,
|
|
65
|
+
StringLiteral: 27,
|
|
66
|
+
HtmlIdentifier: 28,
|
|
67
|
+
TextIdentifier: 29,
|
|
68
|
+
QuotedTextIdentifier: 30,
|
|
69
|
+
NumericIdentifier: 31,
|
|
70
|
+
GraphKeyword: 32,
|
|
71
|
+
DigraphKeyword: 33,
|
|
72
|
+
NodeKeyword: 34,
|
|
73
|
+
EdgeKeyword: 35,
|
|
74
|
+
SubgraphKeyword: 36,
|
|
75
|
+
StrictKeyword: 37,
|
|
76
|
+
DirectedEdgeOp: 38,
|
|
77
|
+
UndirectedEdgeOp: 39,
|
|
78
|
+
DirectedGraph: 40,
|
|
79
|
+
UndirectedGraph: 41,
|
|
80
|
+
NodeStatement: 42,
|
|
81
|
+
EdgeStatement: 43,
|
|
82
|
+
AttributeStatement: 44,
|
|
83
|
+
IdEqualsIdStatement: 45,
|
|
84
|
+
SubGraph: 46,
|
|
85
|
+
SubGraphStatement: 47,
|
|
86
|
+
EdgeRhs: 48,
|
|
87
|
+
AttributeContainer: 49,
|
|
88
|
+
Assignment: 50,
|
|
89
|
+
NormalPortDeclaration: 51,
|
|
90
|
+
CompassPortDeclaration: 52,
|
|
91
|
+
NodeId: 53,
|
|
92
|
+
Count: 54,
|
|
93
|
+
FirstNode: 40,
|
|
95
94
|
CompassBegin: 18,
|
|
96
|
-
CompassEnd:
|
|
97
|
-
LastKeyword:
|
|
95
|
+
CompassEnd: 26,
|
|
96
|
+
LastKeyword: 37
|
|
98
97
|
};
|
|
99
98
|
/** reverse lookup because we cannot make syntaxKind an enum */
|
|
100
99
|
const syntaxKindNames = {
|
|
@@ -125,35 +124,34 @@ const syntaxKindNames = {
|
|
|
125
124
|
24: "CompassWestToken",
|
|
126
125
|
25: "CompassNorthWestToken",
|
|
127
126
|
26: "CompassCenterToken",
|
|
128
|
-
27: "
|
|
129
|
-
28: "
|
|
130
|
-
29: "
|
|
131
|
-
30: "
|
|
132
|
-
31: "
|
|
133
|
-
32: "
|
|
134
|
-
33: "
|
|
135
|
-
34: "
|
|
136
|
-
35: "
|
|
137
|
-
36: "
|
|
138
|
-
37: "
|
|
139
|
-
38: "
|
|
140
|
-
39: "
|
|
141
|
-
40: "
|
|
142
|
-
41: "
|
|
143
|
-
42: "
|
|
144
|
-
43: "
|
|
145
|
-
44: "
|
|
146
|
-
45: "
|
|
147
|
-
46: "
|
|
148
|
-
47: "
|
|
149
|
-
48: "
|
|
150
|
-
49: "
|
|
151
|
-
50: "
|
|
152
|
-
51: "
|
|
153
|
-
52: "
|
|
154
|
-
53: "
|
|
155
|
-
54: "
|
|
156
|
-
55: "Count"
|
|
127
|
+
27: "StringLiteral",
|
|
128
|
+
28: "HtmlIdentifier",
|
|
129
|
+
29: "TextIdentifier",
|
|
130
|
+
30: "QuotedTextIdentifier",
|
|
131
|
+
31: "NumericIdentifier",
|
|
132
|
+
32: "GraphKeyword",
|
|
133
|
+
33: "DigraphKeyword",
|
|
134
|
+
34: "NodeKeyword",
|
|
135
|
+
35: "EdgeKeyword",
|
|
136
|
+
36: "SubgraphKeyword",
|
|
137
|
+
37: "StrictKeyword",
|
|
138
|
+
38: "DirectedEdgeOp",
|
|
139
|
+
39: "UndirectedEdgeOp",
|
|
140
|
+
40: "DirectedGraph",
|
|
141
|
+
41: "UndirectedGraph",
|
|
142
|
+
42: "NodeStatement",
|
|
143
|
+
43: "EdgeStatement",
|
|
144
|
+
44: "AttributeStatement",
|
|
145
|
+
45: "IdEqualsIdStatement",
|
|
146
|
+
46: "SubGraph",
|
|
147
|
+
47: "SubGraphStatement",
|
|
148
|
+
48: "EdgeRhs",
|
|
149
|
+
49: "AttributeContainer",
|
|
150
|
+
50: "Assignment",
|
|
151
|
+
51: "NormalPortDeclaration",
|
|
152
|
+
52: "CompassPortDeclaration",
|
|
153
|
+
53: "NodeId",
|
|
154
|
+
54: "Count"
|
|
157
155
|
};
|
|
158
156
|
const syntaxNodeFlags = {
|
|
159
157
|
None: 0,
|
|
@@ -359,7 +357,6 @@ const textToToken = createMapFromTemplate({
|
|
|
359
357
|
"]": syntaxKind.CloseBracketToken,
|
|
360
358
|
";": syntaxKind.SemicolonToken,
|
|
361
359
|
":": syntaxKind.ColonToken,
|
|
362
|
-
_: syntaxKind.UnderscoreToken,
|
|
363
360
|
",": syntaxKind.CommaToken,
|
|
364
361
|
"<": syntaxKind.LessThan,
|
|
365
362
|
">": syntaxKind.GreaterThan
|
|
@@ -519,9 +516,6 @@ var DefaultScanner = class {
|
|
|
519
516
|
}
|
|
520
517
|
this.pos++;
|
|
521
518
|
break;
|
|
522
|
-
case characterCodes._:
|
|
523
|
-
this.pos++;
|
|
524
|
-
return this.token = syntaxKind.UnderscoreToken;
|
|
525
519
|
case characterCodes.semicolon:
|
|
526
520
|
this.pos++;
|
|
527
521
|
return this.token = syntaxKind.SemicolonToken;
|
|
@@ -740,10 +734,10 @@ var DefaultScanner = class {
|
|
|
740
734
|
}
|
|
741
735
|
};
|
|
742
736
|
function isIdentifierStart(ch) {
|
|
743
|
-
return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes.
|
|
737
|
+
return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= 128 && ch <= 255 || ch === characterCodes._ || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes.minus || ch === characterCodes.dot || ch === characterCodes.doubleQuote || ch === characterCodes.lessThan;
|
|
744
738
|
}
|
|
745
739
|
function isIdentifierPart(ch) {
|
|
746
|
-
return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes
|
|
740
|
+
return ch >= characterCodes.A && ch <= characterCodes.Z || ch >= characterCodes.a && ch <= characterCodes.z || ch >= characterCodes._0 && ch <= characterCodes._9 || ch === characterCodes._ || ch >= 128 && ch <= 255;
|
|
747
741
|
}
|
|
748
742
|
function skipTrivia(text, pos) {
|
|
749
743
|
while (true) {
|
|
@@ -836,9 +830,6 @@ var Parser = class {
|
|
|
836
830
|
#token() {
|
|
837
831
|
return this.currentToken;
|
|
838
832
|
}
|
|
839
|
-
#getLinesFromFile(sourceText) {
|
|
840
|
-
return sourceText.split(/\r?\n/);
|
|
841
|
-
}
|
|
842
833
|
parse(sourceText) {
|
|
843
834
|
this.sourceText = sourceText;
|
|
844
835
|
this.scanner.setText(this.sourceText);
|
|
@@ -2704,8 +2695,8 @@ function createBinder() {
|
|
|
2704
2695
|
if (node.compassPt) bind(node.compassPt);
|
|
2705
2696
|
}
|
|
2706
2697
|
function bindNodeId(node) {
|
|
2707
|
-
ensureGlobalSymbol(node.id);
|
|
2708
2698
|
bind(node.id);
|
|
2699
|
+
ensureGlobalSymbol(node.id);
|
|
2709
2700
|
if (node.port) bind(node.port);
|
|
2710
2701
|
}
|
|
2711
2702
|
function bindChildren(nodes) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dot-language-support",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Parser and language service for graphviz (dot) files",
|
|
5
5
|
"author": "Niklas Mollenhauer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@biomejs/biome": "^2.3.11",
|
|
39
39
|
"expect": "^30.2.0",
|
|
40
|
-
"tsdown": "^0.
|
|
40
|
+
"tsdown": "^0.19.0",
|
|
41
41
|
"typescript": "^5.9.3"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|