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 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> | Token<typeof syntaxKind.UnderscoreToken>;
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 UnderscoreToken: 27;
201
- readonly StringLiteral: 28;
202
- readonly HtmlIdentifier: 29;
203
- readonly TextIdentifier: 30;
204
- readonly QuotedTextIdentifier: 31;
205
- readonly NumericIdentifier: 32;
206
- readonly GraphKeyword: 33;
207
- readonly DigraphKeyword: 34;
208
- readonly NodeKeyword: 35;
209
- readonly EdgeKeyword: 36;
210
- readonly SubgraphKeyword: 37;
211
- readonly StrictKeyword: 38;
212
- readonly DirectedEdgeOp: 39;
213
- readonly UndirectedEdgeOp: 40;
214
- readonly DirectedGraph: 41;
215
- readonly UndirectedGraph: 42;
216
- readonly NodeStatement: 43;
217
- readonly EdgeStatement: 44;
218
- readonly AttributeStatement: 45;
219
- readonly IdEqualsIdStatement: 46;
220
- readonly SubGraph: 47;
221
- readonly SubGraphStatement: 48;
222
- readonly EdgeRhs: 49;
223
- readonly AttributeContainer: 50;
224
- readonly Assignment: 51;
225
- readonly NormalPortDeclaration: 52;
226
- readonly CompassPortDeclaration: 53;
227
- readonly NodeId: 54;
228
- readonly Count: 55;
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: 27;
232
- readonly LastKeyword: 38;
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: "UnderscoreToken";
263
- readonly 28: "StringLiteral";
264
- readonly 29: "HtmlIdentifier";
265
- readonly 30: "TextIdentifier";
266
- readonly 31: "QuotedTextIdentifier";
267
- readonly 32: "NumericIdentifier";
268
- readonly 33: "GraphKeyword";
269
- readonly 34: "DigraphKeyword";
270
- readonly 35: "NodeKeyword";
271
- readonly 36: "EdgeKeyword";
272
- readonly 37: "SubgraphKeyword";
273
- readonly 38: "StrictKeyword";
274
- readonly 39: "DirectedEdgeOp";
275
- readonly 40: "UndirectedEdgeOp";
276
- readonly 41: "DirectedGraph";
277
- readonly 42: "UndirectedGraph";
278
- readonly 43: "NodeStatement";
279
- readonly 44: "EdgeStatement";
280
- readonly 45: "AttributeStatement";
281
- readonly 46: "IdEqualsIdStatement";
282
- readonly 47: "SubGraph";
283
- readonly 48: "SubGraphStatement";
284
- readonly 49: "EdgeRhs";
285
- readonly 50: "AttributeContainer";
286
- readonly 51: "Assignment";
287
- readonly 52: "NormalPortDeclaration";
288
- readonly 53: "CompassPortDeclaration";
289
- readonly 54: "NodeId";
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 | 32;
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
- UnderscoreToken: 27,
66
- StringLiteral: 28,
67
- HtmlIdentifier: 29,
68
- TextIdentifier: 30,
69
- QuotedTextIdentifier: 31,
70
- NumericIdentifier: 32,
71
- GraphKeyword: 33,
72
- DigraphKeyword: 34,
73
- NodeKeyword: 35,
74
- EdgeKeyword: 36,
75
- SubgraphKeyword: 37,
76
- StrictKeyword: 38,
77
- DirectedEdgeOp: 39,
78
- UndirectedEdgeOp: 40,
79
- DirectedGraph: 41,
80
- UndirectedGraph: 42,
81
- NodeStatement: 43,
82
- EdgeStatement: 44,
83
- AttributeStatement: 45,
84
- IdEqualsIdStatement: 46,
85
- SubGraph: 47,
86
- SubGraphStatement: 48,
87
- EdgeRhs: 49,
88
- AttributeContainer: 50,
89
- Assignment: 51,
90
- NormalPortDeclaration: 52,
91
- CompassPortDeclaration: 53,
92
- NodeId: 54,
93
- Count: 55,
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: 27,
97
- LastKeyword: 38
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: "UnderscoreToken",
129
- 28: "StringLiteral",
130
- 29: "HtmlIdentifier",
131
- 30: "TextIdentifier",
132
- 31: "QuotedTextIdentifier",
133
- 32: "NumericIdentifier",
134
- 33: "GraphKeyword",
135
- 34: "DigraphKeyword",
136
- 35: "NodeKeyword",
137
- 36: "EdgeKeyword",
138
- 37: "SubgraphKeyword",
139
- 38: "StrictKeyword",
140
- 39: "DirectedEdgeOp",
141
- 40: "UndirectedEdgeOp",
142
- 41: "DirectedGraph",
143
- 42: "UndirectedGraph",
144
- 43: "NodeStatement",
145
- 44: "EdgeStatement",
146
- 45: "AttributeStatement",
147
- 46: "IdEqualsIdStatement",
148
- 47: "SubGraph",
149
- 48: "SubGraphStatement",
150
- 49: "EdgeRhs",
151
- 50: "AttributeContainer",
152
- 51: "Assignment",
153
- 52: "NormalPortDeclaration",
154
- 53: "CompassPortDeclaration",
155
- 54: "NodeId",
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._ || ch === characterCodes.lessThan || ch === characterCodes.doubleQuote;
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.$ || ch === characterCodes._ || ch > characterCodes.maxAsciiCharacter;
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.4",
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.18.4",
40
+ "tsdown": "^0.19.0",
41
41
  "typescript": "^5.9.3"
42
42
  },
43
43
  "engines": {