dot-language-support 2.2.2 → 2.2.4
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/.github/workflows/CD.yml +5 -2
- package/.github/workflows/CI.yml +5 -2
- package/.github/workflows/auto-merge.yaml +1 -1
- package/biome.json +50 -0
- package/lib/cjs/binder.d.ts +1 -1
- package/lib/cjs/binder.js +2 -5
- package/lib/cjs/checker.d.ts +1 -1
- package/lib/cjs/checker.js +34 -30
- package/lib/cjs/core.js +2 -3
- package/lib/cjs/error.js +3 -5
- package/lib/cjs/parser.d.ts +4 -61
- package/lib/cjs/parser.js +580 -616
- package/lib/cjs/scanner.d.ts +2 -13
- package/lib/cjs/scanner.js +316 -317
- package/lib/cjs/service/codeAction.d.ts +3 -3
- package/lib/cjs/service/codeAction.js +45 -39
- package/lib/cjs/service/colorProvider.d.ts +3 -3
- package/lib/cjs/service/colorProvider.js +30 -31
- package/lib/cjs/service/command/ChangeAllOtherEdgeOpsAndFixGraphCommand.d.ts +4 -4
- package/lib/cjs/service/command/ChangeAllOtherEdgeOpsAndFixGraphCommand.js +5 -6
- package/lib/cjs/service/command/ChangeEdgeOpCommand.d.ts +3 -3
- package/lib/cjs/service/command/ChangeEdgeOpCommand.js +22 -15
- package/lib/cjs/service/command/ConsolidateDescendantsCommand.d.ts +4 -4
- package/lib/cjs/service/command/ConsolidateDescendantsCommand.js +12 -13
- package/lib/cjs/service/command/RemoveSemicolons.d.ts +4 -4
- package/lib/cjs/service/command/RemoveSemicolons.js +8 -11
- package/lib/cjs/service/command/common.d.ts +4 -4
- package/lib/cjs/service/command/common.js +12 -10
- package/lib/cjs/service/completion.d.ts +2 -2
- package/lib/cjs/service/completion.js +34 -25
- package/lib/cjs/service/hover.d.ts +2 -2
- package/lib/cjs/service/hover.js +12 -16
- package/lib/cjs/service/languageFacts.js +1 -6
- package/lib/cjs/service/reference.d.ts +2 -2
- package/lib/cjs/service/reference.js +4 -8
- package/lib/cjs/service/rename.d.ts +3 -3
- package/lib/cjs/service/rename.js +10 -8
- package/lib/cjs/service/service.d.ts +3 -3
- package/lib/cjs/service/service.js +7 -8
- package/lib/cjs/service/util.d.ts +1 -1
- package/lib/cjs/service/util.js +10 -13
- package/lib/cjs/service/validation.d.ts +3 -3
- package/lib/cjs/service/validation.js +1 -2
- package/lib/cjs/tester.js +1 -1
- package/lib/cjs/visitor.d.ts +1 -1
- package/lib/cjs/visitor.js +32 -34
- package/lib/esm/binder.d.ts +1 -1
- package/lib/esm/binder.js +1 -3
- package/lib/esm/checker.d.ts +1 -1
- package/lib/esm/checker.js +21 -16
- package/lib/esm/core.js +1 -1
- package/lib/esm/error.js +1 -3
- package/lib/esm/parser.d.ts +4 -61
- package/lib/esm/parser.js +320 -306
- package/lib/esm/scanner.d.ts +2 -13
- package/lib/esm/scanner.js +153 -152
- package/lib/esm/service/codeAction.d.ts +3 -3
- package/lib/esm/service/codeAction.js +26 -29
- package/lib/esm/service/colorProvider.d.ts +3 -3
- package/lib/esm/service/colorProvider.js +11 -21
- package/lib/esm/service/command/ChangeAllOtherEdgeOpsAndFixGraphCommand.d.ts +4 -4
- package/lib/esm/service/command/ChangeAllOtherEdgeOpsAndFixGraphCommand.js +4 -4
- package/lib/esm/service/command/ChangeEdgeOpCommand.d.ts +3 -3
- package/lib/esm/service/command/ChangeEdgeOpCommand.js +3 -5
- package/lib/esm/service/command/ConsolidateDescendantsCommand.d.ts +4 -4
- package/lib/esm/service/command/ConsolidateDescendantsCommand.js +11 -11
- package/lib/esm/service/command/RemoveSemicolons.d.ts +4 -4
- package/lib/esm/service/command/RemoveSemicolons.js +6 -8
- package/lib/esm/service/command/common.d.ts +4 -4
- package/lib/esm/service/command/common.js +7 -4
- package/lib/esm/service/completion.d.ts +2 -2
- package/lib/esm/service/completion.js +16 -16
- package/lib/esm/service/hover.d.ts +2 -2
- package/lib/esm/service/hover.js +8 -14
- package/lib/esm/service/languageFacts.js +1 -6
- package/lib/esm/service/reference.d.ts +2 -2
- package/lib/esm/service/reference.js +3 -6
- package/lib/esm/service/rename.d.ts +3 -3
- package/lib/esm/service/rename.js +9 -6
- package/lib/esm/service/service.d.ts +3 -3
- package/lib/esm/service/service.js +7 -7
- package/lib/esm/service/util.d.ts +1 -1
- package/lib/esm/service/util.js +5 -7
- package/lib/esm/service/validation.d.ts +3 -3
- package/lib/esm/service/validation.js +1 -1
- package/lib/esm/tester.js +1 -1
- package/lib/esm/visitor.d.ts +1 -1
- package/lib/esm/visitor.js +32 -33
- package/package.json +15 -10
package/.github/workflows/CD.yml
CHANGED
|
@@ -17,15 +17,18 @@ jobs:
|
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
show-progress: false
|
|
20
22
|
|
|
21
23
|
- uses: actions/setup-node@v4
|
|
22
24
|
with:
|
|
23
|
-
node-version:
|
|
25
|
+
node-version: 23
|
|
24
26
|
cache: npm
|
|
25
27
|
registry-url: https://registry.npmjs.org
|
|
26
28
|
|
|
27
29
|
- run: npm ci
|
|
28
|
-
- run: npm run
|
|
30
|
+
- run: npm run ci
|
|
31
|
+
- run: npm run build
|
|
29
32
|
- run: npm test
|
|
30
33
|
env:
|
|
31
34
|
CI: true
|
package/.github/workflows/CI.yml
CHANGED
|
@@ -8,10 +8,12 @@ jobs:
|
|
|
8
8
|
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
|
-
node-version: [
|
|
11
|
+
node-version: [20.x, 21.x, 22.x, 23.x]
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
show-progress: false
|
|
15
17
|
|
|
16
18
|
- uses: actions/setup-node@v4
|
|
17
19
|
with:
|
|
@@ -19,7 +21,8 @@ jobs:
|
|
|
19
21
|
cache: npm
|
|
20
22
|
|
|
21
23
|
- run: npm ci
|
|
22
|
-
- run: npm run
|
|
24
|
+
- run: npm run ci
|
|
25
|
+
- run: npm run build
|
|
23
26
|
- run: npm test
|
|
24
27
|
env:
|
|
25
28
|
CI: true
|
package/biome.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/1.5.0/schema.json",
|
|
3
|
+
"formatter": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"indentWidth": 4,
|
|
6
|
+
"indentStyle": "tab",
|
|
7
|
+
"lineWidth": 100
|
|
8
|
+
},
|
|
9
|
+
"vcs": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"clientKind": "git",
|
|
12
|
+
"defaultBranch": "master",
|
|
13
|
+
"root": "."
|
|
14
|
+
},
|
|
15
|
+
"linter": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"rules": {
|
|
18
|
+
"recommended": true,
|
|
19
|
+
"suspicious": {
|
|
20
|
+
"noConstEnum": "off",
|
|
21
|
+
"noDebugger": "off"
|
|
22
|
+
},
|
|
23
|
+
"correctness": {
|
|
24
|
+
"noVoidTypeReturn": "off"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"javascript": {
|
|
29
|
+
"formatter": {
|
|
30
|
+
"arrowParentheses": "asNeeded"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"overrides": [
|
|
34
|
+
{
|
|
35
|
+
"include": [
|
|
36
|
+
"src/scanner.ts"
|
|
37
|
+
],
|
|
38
|
+
"linter": {
|
|
39
|
+
"rules": {
|
|
40
|
+
"suspicious": {
|
|
41
|
+
"noAssignInExpressions": "off"
|
|
42
|
+
},
|
|
43
|
+
"style": {
|
|
44
|
+
"noParameterAssign": "off"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
package/lib/cjs/binder.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SourceFile } from "./types.js";
|
|
1
|
+
import { type SourceFile } from "./types.js";
|
|
2
2
|
export declare function bindSourceFile(file: SourceFile): void;
|
package/lib/cjs/binder.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bindSourceFile =
|
|
4
|
-
const types_js_1 = require("./types.js");
|
|
3
|
+
exports.bindSourceFile = bindSourceFile;
|
|
5
4
|
const checker_js_1 = require("./checker.js");
|
|
6
5
|
const parser_js_1 = require("./parser.js");
|
|
6
|
+
const types_js_1 = require("./types.js");
|
|
7
7
|
const binder = createBinder();
|
|
8
8
|
function bindSourceFile(file) {
|
|
9
9
|
binder.bind(file);
|
|
10
10
|
}
|
|
11
|
-
exports.bindSourceFile = bindSourceFile;
|
|
12
11
|
function createBinder() {
|
|
13
12
|
let parent = undefined;
|
|
14
13
|
let symbolTable = undefined;
|
|
@@ -78,7 +77,6 @@ function createBinder() {
|
|
|
78
77
|
ensureGlobalSymbol(node.id);
|
|
79
78
|
bind(node.id);
|
|
80
79
|
}
|
|
81
|
-
;
|
|
82
80
|
if (node.strict)
|
|
83
81
|
bind(node.strict);
|
|
84
82
|
bindChildren(node.statements);
|
|
@@ -106,7 +104,6 @@ function createBinder() {
|
|
|
106
104
|
if (node.id) {
|
|
107
105
|
bind(node.id);
|
|
108
106
|
}
|
|
109
|
-
;
|
|
110
107
|
bindChildren(node.statements);
|
|
111
108
|
}
|
|
112
109
|
function bindSubGraphStatement(node) {
|
package/lib/cjs/checker.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type AttributeStatement, type EdgeRhs, type EdgeStatement, type Graph, type Identifier, type NodeId, type SourceFile, type Statement, type StatementOf, type SubGraphStatement, SyntaxKind, type SyntaxNode, type Token } from "./types.js";
|
|
2
2
|
export declare function checkSourceFile(file: SourceFile): void;
|
|
3
3
|
export declare function findNodeAtOffset(root: SyntaxNode, offset: number, inclusiveEnd?: boolean): SyntaxNode | undefined;
|
|
4
4
|
export declare function getAllowedEdgeOperation(graph: Graph): SyntaxKind.DirectedEdgeOp | SyntaxKind.UndirectedEdgeOp;
|
package/lib/cjs/checker.js
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.checkSourceFile = checkSourceFile;
|
|
4
|
+
exports.findNodeAtOffset = findNodeAtOffset;
|
|
5
|
+
exports.getAllowedEdgeOperation = getAllowedEdgeOperation;
|
|
6
|
+
exports.findAllEdges = findAllEdges;
|
|
7
|
+
exports.findOptionalSemicolons = findOptionalSemicolons;
|
|
8
|
+
exports.findAllStatements = findAllStatements;
|
|
9
|
+
exports.isAttrStatement = isAttrStatement;
|
|
10
|
+
exports.isEdgeStatement = isEdgeStatement;
|
|
11
|
+
exports.isSubGraphStatement = isSubGraphStatement;
|
|
12
|
+
exports.isNodeId = isNodeId;
|
|
13
|
+
exports.edgeStatementHasAttributes = edgeStatementHasAttributes;
|
|
14
|
+
exports.getIdentifierText = getIdentifierText;
|
|
15
|
+
exports.nodeContainsErrors = nodeContainsErrors;
|
|
16
|
+
const languageFacts_js_1 = require("./service/languageFacts.js");
|
|
5
17
|
const util_js_1 = require("./service/util.js");
|
|
18
|
+
const types_js_1 = require("./types.js");
|
|
6
19
|
const visitor_js_1 = require("./visitor.js");
|
|
7
|
-
const languageFacts_js_1 = require("./service/languageFacts.js");
|
|
8
20
|
function checkSourceFile(file) {
|
|
9
21
|
const g = file.graph;
|
|
10
22
|
if (g) {
|
|
@@ -14,11 +26,10 @@ function checkSourceFile(file) {
|
|
|
14
26
|
}
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
|
-
exports.checkSourceFile = checkSourceFile;
|
|
18
29
|
function getNarrowerNode(offset, prev, toCheck) {
|
|
19
30
|
const prevRange = prev.end - prev.pos;
|
|
20
31
|
if (toCheck.pos <= offset && offset <= toCheck.end) {
|
|
21
|
-
|
|
32
|
+
const nrange = toCheck.end - toCheck.pos;
|
|
22
33
|
if (nrange < prevRange) {
|
|
23
34
|
return toCheck;
|
|
24
35
|
}
|
|
@@ -39,18 +50,16 @@ function findNodeAtOffset(root, offset, inclusiveEnd = false) {
|
|
|
39
50
|
}
|
|
40
51
|
return undefined;
|
|
41
52
|
}
|
|
42
|
-
exports.findNodeAtOffset = findNodeAtOffset;
|
|
43
53
|
function getAllowedEdgeOperation(graph) {
|
|
44
54
|
return graph.kind === types_js_1.SyntaxKind.DirectedGraph
|
|
45
55
|
? types_js_1.SyntaxKind.DirectedEdgeOp
|
|
46
56
|
: types_js_1.SyntaxKind.UndirectedEdgeOp;
|
|
47
57
|
}
|
|
48
|
-
exports.getAllowedEdgeOperation = getAllowedEdgeOperation;
|
|
49
58
|
function checkGraphSemantics(file, root) {
|
|
50
59
|
const expectedEdgeOp = getAllowedEdgeOperation(root);
|
|
51
60
|
const invalidEdgeRhses = findEdgeErrors(expectedEdgeOp, root);
|
|
52
61
|
const invalidShapes = checkShapeLabelValues(root);
|
|
53
|
-
const invalidEdgeDiagnostics = invalidEdgeRhses
|
|
62
|
+
const invalidEdgeDiagnostics = invalidEdgeRhses === undefined || invalidEdgeRhses.length === 0
|
|
54
63
|
? []
|
|
55
64
|
: createEdgeViolationDiagnostics(file, expectedEdgeOp, invalidEdgeRhses);
|
|
56
65
|
return [...invalidEdgeDiagnostics, ...invalidShapes];
|
|
@@ -68,7 +77,8 @@ function checkShapeLabelValues(root) {
|
|
|
68
77
|
const invalidShapes = [];
|
|
69
78
|
forEachAssignmentTransitive(root, assignment => {
|
|
70
79
|
const { leftId, rightId } = assignment;
|
|
71
|
-
if (leftId.kind !== types_js_1.SyntaxKind.TextIdentifier ||
|
|
80
|
+
if (leftId.kind !== types_js_1.SyntaxKind.TextIdentifier ||
|
|
81
|
+
rightId.kind !== types_js_1.SyntaxKind.TextIdentifier) {
|
|
72
82
|
return;
|
|
73
83
|
}
|
|
74
84
|
const leftText = leftId.text.trim();
|
|
@@ -105,24 +115,22 @@ function findAllEdges(node) {
|
|
|
105
115
|
});
|
|
106
116
|
return allEdges;
|
|
107
117
|
}
|
|
108
|
-
exports.findAllEdges = findAllEdges;
|
|
109
118
|
function findOptionalSemicolons(node) {
|
|
110
119
|
const statements = findAllStatements(node);
|
|
111
120
|
const terminators = statements.map(p => p.terminator);
|
|
112
121
|
return terminators.filter(t => !!t);
|
|
113
122
|
}
|
|
114
|
-
exports.findOptionalSemicolons = findOptionalSemicolons;
|
|
115
123
|
function isStatement(node) {
|
|
116
|
-
return node.kind === types_js_1.SyntaxKind.SubGraphStatement
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
return (node.kind === types_js_1.SyntaxKind.SubGraphStatement ||
|
|
125
|
+
node.kind === types_js_1.SyntaxKind.EdgeStatement ||
|
|
126
|
+
node.kind === types_js_1.SyntaxKind.NodeStatement ||
|
|
127
|
+
node.kind === types_js_1.SyntaxKind.IdEqualsIdStatement ||
|
|
128
|
+
node.kind === types_js_1.SyntaxKind.AttributeStatement);
|
|
121
129
|
}
|
|
122
130
|
function findAllStatements(node, kind) {
|
|
123
131
|
const allStatements = [];
|
|
124
132
|
(0, visitor_js_1.forEachChild)(node, child => {
|
|
125
|
-
if ((kind === undefined && isStatement(child)) ||
|
|
133
|
+
if ((kind === undefined && isStatement(child)) || child.kind === kind) {
|
|
126
134
|
allStatements.push(child);
|
|
127
135
|
}
|
|
128
136
|
const childStatements = findAllStatements(child, kind);
|
|
@@ -131,14 +139,15 @@ function findAllStatements(node, kind) {
|
|
|
131
139
|
});
|
|
132
140
|
return allStatements;
|
|
133
141
|
}
|
|
134
|
-
exports.findAllStatements = findAllStatements;
|
|
135
142
|
function findEdgeErrors(expectedEdgeOp, node) {
|
|
136
143
|
const edges = findAllEdges(node);
|
|
137
144
|
const wrongEdges = edges && edges.length > 0
|
|
138
145
|
? edges.filter(e => e.operation.kind !== expectedEdgeOp)
|
|
139
146
|
: undefined;
|
|
140
147
|
if (wrongEdges && wrongEdges.length > 0) {
|
|
141
|
-
|
|
148
|
+
for (const edge of wrongEdges) {
|
|
149
|
+
edge.operation.flags |= 2;
|
|
150
|
+
}
|
|
142
151
|
return wrongEdges;
|
|
143
152
|
}
|
|
144
153
|
return undefined;
|
|
@@ -149,7 +158,9 @@ function createEdgeViolationDiagnostics(file, expectedEdgeOp, violators) {
|
|
|
149
158
|
const message = `Invalid edge operation, use "${op}" in ${graphType} graph`;
|
|
150
159
|
const code = createCheckerError(0);
|
|
151
160
|
const category = types_js_1.DiagnosticCategory.Error;
|
|
152
|
-
|
|
161
|
+
for (const edge of violators) {
|
|
162
|
+
edge.operation.flags |= 2;
|
|
163
|
+
}
|
|
153
164
|
return violators.map(edge => {
|
|
154
165
|
const start = (0, util_js_1.getStart)(file, edge.operation);
|
|
155
166
|
const end = edge.operation.end;
|
|
@@ -173,28 +184,23 @@ function getInvalidEdgeRhs(allowedOp, edges) {
|
|
|
173
184
|
function isAttrStatement(node) {
|
|
174
185
|
return node.kind === types_js_1.SyntaxKind.AttributeStatement;
|
|
175
186
|
}
|
|
176
|
-
exports.isAttrStatement = isAttrStatement;
|
|
177
187
|
function isEdgeStatement(node) {
|
|
178
188
|
return node.kind === types_js_1.SyntaxKind.EdgeStatement;
|
|
179
189
|
}
|
|
180
|
-
exports.isEdgeStatement = isEdgeStatement;
|
|
181
190
|
function isSubGraphStatement(node) {
|
|
182
191
|
return node.kind === types_js_1.SyntaxKind.SubGraphStatement;
|
|
183
192
|
}
|
|
184
|
-
exports.isSubGraphStatement = isSubGraphStatement;
|
|
185
193
|
function isGraph(node) {
|
|
186
194
|
return node.kind === types_js_1.SyntaxKind.DirectedGraph || node.kind === types_js_1.SyntaxKind.UndirectedGraph;
|
|
187
195
|
}
|
|
188
196
|
function isNodeId(node) {
|
|
189
197
|
return node.kind === types_js_1.SyntaxKind.NodeId;
|
|
190
198
|
}
|
|
191
|
-
exports.isNodeId = isNodeId;
|
|
192
199
|
function edgeStatementHasAttributes(es) {
|
|
193
|
-
return es.attributes
|
|
194
|
-
|
|
195
|
-
|
|
200
|
+
return (es.attributes &&
|
|
201
|
+
es.attributes.length > 0 &&
|
|
202
|
+
es.attributes.some(a => a.assignments && a.assignments.length > 0));
|
|
196
203
|
}
|
|
197
|
-
exports.edgeStatementHasAttributes = edgeStatementHasAttributes;
|
|
198
204
|
function getIdentifierText(n) {
|
|
199
205
|
switch (n.kind) {
|
|
200
206
|
case types_js_1.SyntaxKind.HtmlIdentifier:
|
|
@@ -209,7 +215,6 @@ function getIdentifierText(n) {
|
|
|
209
215
|
return (0, util_js_1.assertNever)(n);
|
|
210
216
|
}
|
|
211
217
|
}
|
|
212
|
-
exports.getIdentifierText = getIdentifierText;
|
|
213
218
|
function createCheckerError(sub) {
|
|
214
219
|
return {
|
|
215
220
|
source: 4,
|
|
@@ -219,5 +224,4 @@ function createCheckerError(sub) {
|
|
|
219
224
|
function nodeContainsErrors(node) {
|
|
220
225
|
return (node.flags & 2) === 2;
|
|
221
226
|
}
|
|
222
|
-
exports.nodeContainsErrors = nodeContainsErrors;
|
|
223
227
|
//# sourceMappingURL=checker.js.map
|
package/lib/cjs/core.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMapFromTemplate =
|
|
3
|
+
exports.createMapFromTemplate = createMapFromTemplate;
|
|
4
4
|
function createMapFromTemplate(template) {
|
|
5
5
|
const map = new Map();
|
|
6
6
|
for (const key in template) {
|
|
7
|
-
if (template
|
|
7
|
+
if (key in template) {
|
|
8
8
|
map.set(key, template[key]);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
return map;
|
|
12
12
|
}
|
|
13
|
-
exports.createMapFromTemplate = createMapFromTemplate;
|
|
14
13
|
//# sourceMappingURL=core.js.map
|
package/lib/cjs/error.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.diagnosicSource = void 0;
|
|
4
|
+
exports.formatError = formatError;
|
|
4
5
|
exports.diagnosicSource = "DOT";
|
|
5
6
|
const errorCodeLength = 4;
|
|
6
7
|
const subErrorCodeLength = errorCodeLength - 1;
|
|
7
8
|
function formatError(error) {
|
|
8
|
-
const subCode = (error.sub | 0)
|
|
9
|
-
.toString()
|
|
10
|
-
.padStart(subErrorCodeLength, "0");
|
|
9
|
+
const subCode = (error.sub | 0).toString().padStart(subErrorCodeLength, "0");
|
|
11
10
|
return exports.diagnosicSource + error.source + subCode;
|
|
12
11
|
}
|
|
13
|
-
exports.formatError = formatError;
|
|
14
12
|
//# sourceMappingURL=error.js.map
|
package/lib/cjs/parser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Scanner } from "./scanner.js";
|
|
2
|
-
import {
|
|
1
|
+
import { type Scanner } from "./scanner.js";
|
|
2
|
+
import { type DiagnosticMessage, type Identifier, type SourceFile, SyntaxKind, type SyntaxNode } from "./types";
|
|
3
3
|
export declare enum ParsingContext {
|
|
4
4
|
None = 0,
|
|
5
5
|
StatementList = 1,
|
|
@@ -10,6 +10,7 @@ export declare enum ParsingContext {
|
|
|
10
10
|
Count = 6
|
|
11
11
|
}
|
|
12
12
|
export declare class Parser {
|
|
13
|
+
#private;
|
|
13
14
|
currentToken: SyntaxKind;
|
|
14
15
|
nodeCount: number;
|
|
15
16
|
identifiers: Set<string>;
|
|
@@ -20,65 +21,7 @@ export declare class Parser {
|
|
|
20
21
|
currentContext: ParsingContext;
|
|
21
22
|
diagnostics: DiagnosticMessage[];
|
|
22
23
|
constructor();
|
|
23
|
-
private resetState;
|
|
24
|
-
private nextToken;
|
|
25
|
-
private token;
|
|
26
|
-
private getLinesFromFile;
|
|
27
24
|
parse(sourceText: string): SourceFile;
|
|
28
|
-
private parseGraph;
|
|
29
|
-
private parseIdentifier;
|
|
30
|
-
private registerIdentifier;
|
|
31
|
-
private parseTextIdentifier;
|
|
32
|
-
private parseQuotedTextIdentifierConcatenation;
|
|
33
|
-
private parseQuotedTextIdentifier;
|
|
34
|
-
private isQuotedStringFollowing;
|
|
35
|
-
private parseHtmlIdentifier;
|
|
36
|
-
private parseNumericIdentifier;
|
|
37
|
-
private parseStatement;
|
|
38
|
-
private parseAttributeStatement;
|
|
39
|
-
private parseAttributeContainer;
|
|
40
|
-
private isAssignmentStart;
|
|
41
|
-
private parseIdEqualsIdStatement;
|
|
42
|
-
private isIdEqualsIdStatement;
|
|
43
|
-
private parseNodeStatement;
|
|
44
|
-
private parseEdgeStatement;
|
|
45
|
-
private parseEdgeRhs;
|
|
46
|
-
private createMissingNode;
|
|
47
|
-
private parseAssignment;
|
|
48
|
-
private parseSubGraph;
|
|
49
|
-
private parseNodeId;
|
|
50
|
-
private parseCompassPortDeclaration;
|
|
51
|
-
private parseNormalPortDeclaration;
|
|
52
|
-
private parsePortDeclaration;
|
|
53
|
-
private isCompassPort;
|
|
54
|
-
private parseList;
|
|
55
|
-
private getContextParseError;
|
|
56
|
-
private isInSomeParsingContext;
|
|
57
|
-
private abortListParsing;
|
|
58
|
-
private isListElement;
|
|
59
|
-
private isListTerminator;
|
|
60
|
-
private createEmptyArray;
|
|
61
|
-
private finishNode;
|
|
62
|
-
private createNode;
|
|
63
|
-
private createNodeArray;
|
|
64
|
-
private parseTokenNode;
|
|
65
|
-
private getLastError;
|
|
66
|
-
private parseErrorAtPosition;
|
|
67
|
-
private parseErrorAtCurrentToken;
|
|
68
|
-
private scanError;
|
|
69
|
-
private reportExpectedError;
|
|
70
|
-
private parseExpectedOneOf;
|
|
71
|
-
private parseExpectedTokenOneOf;
|
|
72
|
-
private parseExpectedToken;
|
|
73
|
-
private parseExpected;
|
|
74
|
-
private parseOptionalToken;
|
|
75
|
-
private parseOptional;
|
|
76
|
-
private isEdgeOp;
|
|
77
|
-
private isIdentifier;
|
|
78
|
-
private isCompassPortKind;
|
|
79
|
-
private speculationHelper;
|
|
80
|
-
private lookAhead;
|
|
81
|
-
private tryParse;
|
|
82
25
|
}
|
|
83
|
-
export declare function isIdentifier(kind: SyntaxKind):
|
|
26
|
+
export declare function isIdentifier(kind: SyntaxKind): kind is SyntaxKind.HtmlIdentifier | SyntaxKind.TextIdentifier | SyntaxKind.QuotedTextIdentifier | SyntaxKind.NumericIdentifier;
|
|
84
27
|
export declare function isIdentifierNode(node: SyntaxNode): node is Identifier;
|