@swagger-api/apidom-parser-adapter-json 0.92.0 → 0.94.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/CHANGELOG.md +8 -0
- package/cjs/syntactic-analysis/TreeCursorIterator.cjs +1 -0
- package/cjs/syntactic-analysis/TreeCursorSyntaxNode.cjs +9 -0
- package/cjs/syntactic-analysis/direct/visitors/CstVisitor.cjs +1 -0
- package/cjs/syntactic-analysis/indirect/visitors/CstVisitor.cjs +19 -19
- package/cjs/syntactic-analysis/indirect/visitors/JsonAstVisitor.cjs +1 -0
- package/dist/64a30dfa8a51b6a090ebd363beeaad5d.wasm +0 -0
- package/dist/apidom-parser-adapter-json.browser.js +1490 -1607
- package/dist/apidom-parser-adapter-json.browser.min.js +1 -1
- package/es/syntactic-analysis/TreeCursorIterator.mjs +1 -0
- package/es/syntactic-analysis/TreeCursorSyntaxNode.mjs +9 -0
- package/es/syntactic-analysis/direct/visitors/CstVisitor.mjs +1 -0
- package/es/syntactic-analysis/indirect/visitors/CstVisitor.mjs +19 -19
- package/es/syntactic-analysis/indirect/visitors/JsonAstVisitor.mjs +1 -0
- package/package.json +6 -6
- package/wasm/tree-sitter-json.wasm +0 -0
- package/dist/13ee407b2f9bd26c94370902ddeb5bcf.wasm +0 -0
|
@@ -14,17 +14,17 @@ export const keyMap = {
|
|
|
14
14
|
|
|
15
15
|
class CstVisitor {
|
|
16
16
|
static toPosition(node) {
|
|
17
|
-
const start = Point({
|
|
17
|
+
const start = new Point({
|
|
18
18
|
row: node.startPosition.row,
|
|
19
19
|
column: node.startPosition.column,
|
|
20
20
|
char: node.startIndex
|
|
21
21
|
});
|
|
22
|
-
const end = Point({
|
|
22
|
+
const end = new Point({
|
|
23
23
|
row: node.endPosition.row,
|
|
24
24
|
column: node.endPosition.column,
|
|
25
25
|
char: node.endIndex
|
|
26
26
|
});
|
|
27
|
-
return Position({
|
|
27
|
+
return new Position({
|
|
28
28
|
start,
|
|
29
29
|
end
|
|
30
30
|
});
|
|
@@ -32,14 +32,14 @@ class CstVisitor {
|
|
|
32
32
|
document = {
|
|
33
33
|
enter: node => {
|
|
34
34
|
const position = CstVisitor.toPosition(node);
|
|
35
|
-
return JsonDocument({
|
|
35
|
+
return new JsonDocument({
|
|
36
36
|
children: node.children,
|
|
37
37
|
position,
|
|
38
38
|
isMissing: node.isMissing
|
|
39
39
|
});
|
|
40
40
|
},
|
|
41
41
|
leave: document => {
|
|
42
|
-
return ParseResult({
|
|
42
|
+
return new ParseResult({
|
|
43
43
|
children: [document]
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -52,7 +52,7 @@ class CstVisitor {
|
|
|
52
52
|
const {
|
|
53
53
|
isMissing
|
|
54
54
|
} = node;
|
|
55
|
-
return Literal({
|
|
55
|
+
return new Literal({
|
|
56
56
|
value,
|
|
57
57
|
position,
|
|
58
58
|
isMissing
|
|
@@ -62,7 +62,7 @@ class CstVisitor {
|
|
|
62
62
|
}
|
|
63
63
|
object(node) {
|
|
64
64
|
const position = CstVisitor.toPosition(node);
|
|
65
|
-
return JsonObject({
|
|
65
|
+
return new JsonObject({
|
|
66
66
|
children: node.children,
|
|
67
67
|
position,
|
|
68
68
|
isMissing: node.isMissing
|
|
@@ -74,12 +74,12 @@ class CstVisitor {
|
|
|
74
74
|
const {
|
|
75
75
|
keyNode
|
|
76
76
|
} = node;
|
|
77
|
-
const key = JsonKey({
|
|
77
|
+
const key = new JsonKey({
|
|
78
78
|
children: (keyNode === null || keyNode === void 0 ? void 0 : keyNode.children) || [],
|
|
79
|
-
position: keyNode != null ? CstVisitor.toPosition(keyNode) :
|
|
79
|
+
position: keyNode != null ? CstVisitor.toPosition(keyNode) : undefined,
|
|
80
80
|
isMissing: keyNode != null ? keyNode.isMissing : false
|
|
81
81
|
});
|
|
82
|
-
return JsonProperty({
|
|
82
|
+
return new JsonProperty({
|
|
83
83
|
children: [key, ...children],
|
|
84
84
|
position,
|
|
85
85
|
isMissing: node.isMissing
|
|
@@ -87,7 +87,7 @@ class CstVisitor {
|
|
|
87
87
|
}
|
|
88
88
|
array(node) {
|
|
89
89
|
const position = CstVisitor.toPosition(node);
|
|
90
|
-
return JsonArray({
|
|
90
|
+
return new JsonArray({
|
|
91
91
|
children: node.children,
|
|
92
92
|
position,
|
|
93
93
|
isMissing: node.isMissing
|
|
@@ -95,10 +95,10 @@ class CstVisitor {
|
|
|
95
95
|
}
|
|
96
96
|
string(node) {
|
|
97
97
|
const position = CstVisitor.toPosition(node);
|
|
98
|
-
const content = JsonStringContent({
|
|
98
|
+
const content = new JsonStringContent({
|
|
99
99
|
value: JSON.parse(node.text)
|
|
100
100
|
});
|
|
101
|
-
return JsonString({
|
|
101
|
+
return new JsonString({
|
|
102
102
|
children: [content],
|
|
103
103
|
position,
|
|
104
104
|
isMissing: node.isMissing
|
|
@@ -107,7 +107,7 @@ class CstVisitor {
|
|
|
107
107
|
number(node) {
|
|
108
108
|
const position = CstVisitor.toPosition(node);
|
|
109
109
|
const value = node.text;
|
|
110
|
-
return JsonNumber({
|
|
110
|
+
return new JsonNumber({
|
|
111
111
|
value,
|
|
112
112
|
position,
|
|
113
113
|
isMissing: node.isMissing
|
|
@@ -118,7 +118,7 @@ class CstVisitor {
|
|
|
118
118
|
null(node) {
|
|
119
119
|
const position = CstVisitor.toPosition(node);
|
|
120
120
|
const value = node.text;
|
|
121
|
-
return JsonNull({
|
|
121
|
+
return new JsonNull({
|
|
122
122
|
value,
|
|
123
123
|
position,
|
|
124
124
|
isMissing: node.isMissing
|
|
@@ -129,7 +129,7 @@ class CstVisitor {
|
|
|
129
129
|
true(node) {
|
|
130
130
|
const position = CstVisitor.toPosition(node);
|
|
131
131
|
const value = node.text;
|
|
132
|
-
return JsonTrue({
|
|
132
|
+
return new JsonTrue({
|
|
133
133
|
value,
|
|
134
134
|
position,
|
|
135
135
|
isMissing: node.isMissing
|
|
@@ -140,7 +140,7 @@ class CstVisitor {
|
|
|
140
140
|
false(node) {
|
|
141
141
|
const position = CstVisitor.toPosition(node);
|
|
142
142
|
const value = node.text;
|
|
143
|
-
return JsonFalse({
|
|
143
|
+
return new JsonFalse({
|
|
144
144
|
value,
|
|
145
145
|
position,
|
|
146
146
|
isMissing: node.isMissing
|
|
@@ -148,7 +148,7 @@ class CstVisitor {
|
|
|
148
148
|
}
|
|
149
149
|
ERROR(node, key, parent, path) {
|
|
150
150
|
const position = CstVisitor.toPosition(node);
|
|
151
|
-
const errorNode = Error({
|
|
151
|
+
const errorNode = new Error({
|
|
152
152
|
children: node.children,
|
|
153
153
|
position,
|
|
154
154
|
isUnexpected: !node.hasError,
|
|
@@ -156,7 +156,7 @@ class CstVisitor {
|
|
|
156
156
|
value: node.text
|
|
157
157
|
});
|
|
158
158
|
if (path.length === 0) {
|
|
159
|
-
return ParseResult({
|
|
159
|
+
return new ParseResult({
|
|
160
160
|
children: [errorNode]
|
|
161
161
|
});
|
|
162
162
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swagger-api/apidom-parser-adapter-json",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"description": "Parser adapter for parsing JSON documents into base namespace.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"license": "Apache-2.0",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/runtime-corejs3": "^7.20.7",
|
|
56
|
-
"@swagger-api/apidom-ast": "^0.
|
|
57
|
-
"@swagger-api/apidom-core": "^0.
|
|
58
|
-
"@swagger-api/apidom-error": "^0.
|
|
56
|
+
"@swagger-api/apidom-ast": "^0.94.0",
|
|
57
|
+
"@swagger-api/apidom-core": "^0.94.0",
|
|
58
|
+
"@swagger-api/apidom-error": "^0.94.0",
|
|
59
59
|
"@types/ramda": "~0.29.6",
|
|
60
60
|
"ramda": "~0.29.1",
|
|
61
61
|
"ramda-adjunct": "^4.1.1",
|
|
62
62
|
"tree-sitter": "=0.20.4",
|
|
63
|
-
"tree-sitter-json": "=0.20.
|
|
63
|
+
"tree-sitter-json": "=0.20.2",
|
|
64
64
|
"web-tree-sitter": "=0.20.3"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"README.md",
|
|
78
78
|
"CHANGELOG.md"
|
|
79
79
|
],
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "ad476d69176bc6246acad271c435fe3cfcdcd52c"
|
|
81
81
|
}
|
|
Binary file
|
|
Binary file
|