@usearazzo/parser 1.0.1-alpha.17 → 1.0.1-alpha.19
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 +10 -0
- package/dist/arazzo-parser.browser.js +66 -50
- package/dist/arazzo-parser.browser.min.js +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.1-alpha.19](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.18...v1.0.1-alpha.19) (2026-10-31)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **validator:** accept in: querystring in Arazzo 1.1.0 documents ([#299](https://github.com/usearazzo/arazzo-toolkit/issues/299)) ([4d26bbb](https://github.com/usearazzo/arazzo-toolkit/commit/4d26bbb3fd9c08c1345c51d4d6aae99f4e359f28)), closes [speclynx/api-languageservice#97](https://github.com/speclynx/api-languageservice/issues/97) [#281](https://github.com/usearazzo/arazzo-toolkit/issues/281)
|
|
11
|
+
|
|
12
|
+
## [1.0.1-alpha.18](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.17...v1.0.1-alpha.18) (2026-10-30)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @usearazzo/parser
|
|
15
|
+
|
|
6
16
|
## [1.0.1-alpha.17](https://github.com/usearazzo/arazzo-toolkit/compare/v1.0.1-alpha.16...v1.0.1-alpha.17) (2026-10-29)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @usearazzo/parser
|
|
@@ -1662,11 +1662,8 @@ const resolveSpecification = specification => {
|
|
|
1662
1662
|
__webpack_require__.r(__webpack_exports__);
|
|
1663
1663
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(62823);
|
|
1664
1664
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(74918);
|
|
1665
|
-
/* harmony import */ var
|
|
1666
|
-
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69236);
|
|
1665
|
+
/* harmony import */ var _util_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69236);
|
|
1667
1666
|
|
|
1668
|
-
// an empty YAML node (YAML 1.2 §7.2) is a null parsed as an empty string with the yaml-e-node class
|
|
1669
|
-
const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) && element.toValue() === '' && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses)(element, ['yaml-e-node']);
|
|
1670
1667
|
|
|
1671
1668
|
/**
|
|
1672
1669
|
* Transforms the ApiDOM into JavaScript POJO.
|
|
@@ -1676,7 +1673,6 @@ const isEmptyNode = element => (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_M
|
|
|
1676
1673
|
*/
|
|
1677
1674
|
const serializer = element => {
|
|
1678
1675
|
if (!(0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isElement)(element)) return element;
|
|
1679
|
-
if (isEmptyNode(element)) return null;
|
|
1680
1676
|
|
|
1681
1677
|
// Shortcut optimization for primitive element types
|
|
1682
1678
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNumberElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isBooleanElement)(element) || (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isNullElement)(element)) {
|
|
@@ -1694,8 +1690,8 @@ const serializer = element => {
|
|
|
1694
1690
|
node.forEach((value, key) => {
|
|
1695
1691
|
const k = serialize(key);
|
|
1696
1692
|
const v = serialize(value);
|
|
1697
|
-
const name = (0,
|
|
1698
|
-
if (name !== undefined) (0,
|
|
1693
|
+
const name = (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__.toPropertyName)(k);
|
|
1694
|
+
if (name !== undefined) (0,_util_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])(obj, name, v);
|
|
1699
1695
|
});
|
|
1700
1696
|
return obj;
|
|
1701
1697
|
}
|
|
@@ -1710,7 +1706,6 @@ const serializer = element => {
|
|
|
1710
1706
|
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isLinkElement)(node)) {
|
|
1711
1707
|
return (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__.isStringElement)(node.href) ? node.href.toValue() : '';
|
|
1712
1708
|
}
|
|
1713
|
-
if (isEmptyNode(node)) return null;
|
|
1714
1709
|
return node.toValue();
|
|
1715
1710
|
};
|
|
1716
1711
|
return serialize(element);
|
|
@@ -34565,15 +34560,19 @@ const transformCstToYamlAst = (cursor, ctx) => {
|
|
|
34565
34560
|
__webpack_require__.r(__webpack_exports__);
|
|
34566
34561
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(81669);
|
|
34567
34562
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62823);
|
|
34568
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
|
|
34569
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
34570
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
34571
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(
|
|
34572
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(
|
|
34573
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(
|
|
34574
|
-
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
|
34575
|
-
/* harmony import */ var
|
|
34576
|
-
/* harmony import */ var
|
|
34563
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(61614);
|
|
34564
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27682);
|
|
34565
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25035);
|
|
34566
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23560);
|
|
34567
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(67533);
|
|
34568
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(32420);
|
|
34569
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(84149);
|
|
34570
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77093);
|
|
34571
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(52728);
|
|
34572
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6361);
|
|
34573
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(41821);
|
|
34574
|
+
/* harmony import */ var _ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7775);
|
|
34575
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2995);
|
|
34577
34576
|
|
|
34578
34577
|
|
|
34579
34578
|
// Transform context passed through transformation
|
|
@@ -34583,7 +34582,7 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
34583
34582
|
if (!ctx.sourceMap) {
|
|
34584
34583
|
return;
|
|
34585
34584
|
}
|
|
34586
|
-
|
|
34585
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(node, element);
|
|
34587
34586
|
};
|
|
34588
34587
|
|
|
34589
34588
|
// find the first descendant matching a type path through the AST
|
|
@@ -34601,7 +34600,7 @@ const findFirst = (node, path) => {
|
|
|
34601
34600
|
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
34602
34601
|
const detectIndent = node => {
|
|
34603
34602
|
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
34604
|
-
if (nested?.styleGroup ===
|
|
34603
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
34605
34604
|
return nested.startCharacter;
|
|
34606
34605
|
}
|
|
34607
34606
|
return 2;
|
|
@@ -34733,7 +34732,7 @@ const buildYamlStyle = (node, ctx, extras) => {
|
|
|
34733
34732
|
// an untagged node has the non-specific tag '?' when it's a plain scalar and '!' otherwise
|
|
34734
34733
|
// (YAML 1.2 §6.9.1); an explicit '!' on any other node means the same as no tag
|
|
34735
34734
|
const tag = node.tag?.explicitName;
|
|
34736
|
-
if (tag !== undefined && tag !== (node.style ===
|
|
34735
|
+
if (tag !== undefined && tag !== (node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain ? '?' : '!')) {
|
|
34737
34736
|
yamlStyle.tag = tag;
|
|
34738
34737
|
}
|
|
34739
34738
|
// the anchor's name, without the & indicator
|
|
@@ -34847,17 +34846,17 @@ const collectStreamComments = node => {
|
|
|
34847
34846
|
if (!root) comments.before.push(text);else if (comment.startLine === root.endLine) comments.inline.push(text);else comments.after.push(text);
|
|
34848
34847
|
};
|
|
34849
34848
|
for (const child of node.children) {
|
|
34850
|
-
if ((0,
|
|
34849
|
+
if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isDocument)(child)) {
|
|
34851
34850
|
if (root) break;
|
|
34852
34851
|
// comments after an explicit document start (---) or before an explicit document end (...)
|
|
34853
34852
|
// are the document's own children, around its root node
|
|
34854
34853
|
const children = child.children || [];
|
|
34855
|
-
const rootIndex = children.findIndex(c => !(0,
|
|
34854
|
+
const rootIndex = children.findIndex(c => !(0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(c));
|
|
34856
34855
|
if (rootIndex === -1) break;
|
|
34857
|
-
children.slice(0, rootIndex).filter(
|
|
34856
|
+
children.slice(0, rootIndex).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
34858
34857
|
root = children[rootIndex];
|
|
34859
|
-
children.slice(rootIndex + 1).filter(
|
|
34860
|
-
} else if ((0,
|
|
34858
|
+
children.slice(rootIndex + 1).filter(_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment).forEach(collect);
|
|
34859
|
+
} else if ((0,_ast_nodes_predicates_mjs__WEBPACK_IMPORTED_MODULE_13__.isComment)(child)) {
|
|
34861
34860
|
collect(child);
|
|
34862
34861
|
}
|
|
34863
34862
|
}
|
|
@@ -34870,7 +34869,7 @@ const transformStream = (node, ctx) => {
|
|
|
34870
34869
|
if (ctx.style) {
|
|
34871
34870
|
ctx.indent = detectIndent(node);
|
|
34872
34871
|
}
|
|
34873
|
-
const element = new
|
|
34872
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
34874
34873
|
|
|
34875
34874
|
// Transform all children
|
|
34876
34875
|
const children = transformChildren(node.children || [], ctx);
|
|
@@ -34930,7 +34929,7 @@ const transformDocument = (node, ctx) => {
|
|
|
34930
34929
|
const shouldSkipVisitingMoreDocuments = ctx.processedDocumentCount >= 1;
|
|
34931
34930
|
if (shouldWarnAboutMoreDocuments) {
|
|
34932
34931
|
const message = 'Only first document within YAML stream will be used. Rest will be discarded.';
|
|
34933
|
-
const element = new
|
|
34932
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
34934
34933
|
element.classes.push('warning');
|
|
34935
34934
|
maybeAddSourceMap(node, element, ctx);
|
|
34936
34935
|
ctx.annotations.push(element);
|
|
@@ -34949,7 +34948,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
34949
34948
|
const typedNode = node;
|
|
34950
34949
|
const children = node.children || [];
|
|
34951
34950
|
if (ctx.style) {
|
|
34952
|
-
if (ctx.flowCollectionPadding === null && node.styleGroup ===
|
|
34951
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Flow) {
|
|
34953
34952
|
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
34954
34953
|
}
|
|
34955
34954
|
const comments = collectComments(children, typedNode.startCharacter);
|
|
@@ -34960,7 +34959,7 @@ const transformCollection = (element, node, ctx) => {
|
|
|
34960
34959
|
element.style = buildYamlStyle(node, ctx, {
|
|
34961
34960
|
comment: comments.trailing,
|
|
34962
34961
|
// a single pair written directly in a flow sequence (e.g. [a: 1])
|
|
34963
|
-
singlePair: node.style ===
|
|
34962
|
+
singlePair: node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.SinglePair || undefined
|
|
34964
34963
|
});
|
|
34965
34964
|
if (comments.outOfScope.length > 0) {
|
|
34966
34965
|
ctx.promotedComments.push(...comments.outOfScope);
|
|
@@ -34973,14 +34972,14 @@ const transformCollection = (element, node, ctx) => {
|
|
|
34973
34972
|
|
|
34974
34973
|
// Mapping: Transforms to ObjectElement
|
|
34975
34974
|
const transformMapping = (node, ctx) => {
|
|
34976
|
-
const element = new
|
|
34975
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
34977
34976
|
transformCollection(element, node, ctx);
|
|
34978
34977
|
return element;
|
|
34979
34978
|
};
|
|
34980
34979
|
|
|
34981
34980
|
// KeyValuePair: Transforms to MemberElement
|
|
34982
34981
|
const transformKeyValuePair = (node, ctx) => {
|
|
34983
|
-
const element = new
|
|
34982
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_6__["default"]();
|
|
34984
34983
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34985
34984
|
const {
|
|
34986
34985
|
key,
|
|
@@ -34991,15 +34990,25 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
34991
34990
|
styleGroup,
|
|
34992
34991
|
startCharacter
|
|
34993
34992
|
} = value;
|
|
34994
|
-
if (styleGroup ===
|
|
34993
|
+
if (styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyleGroup.Block) {
|
|
34995
34994
|
ctx.indentSeq = startCharacter > node.startCharacter;
|
|
34996
34995
|
}
|
|
34997
34996
|
}
|
|
34998
34997
|
|
|
34999
34998
|
// Transform key and value (these are dynamically defined properties)
|
|
35000
|
-
|
|
34999
|
+
let keyResult = transform(key, ctx);
|
|
35001
35000
|
const valueResult = transform(value, ctx);
|
|
35002
35001
|
|
|
35002
|
+
// an empty key is a null in YAML, but a JavaScript property name can't be null, so it's the empty
|
|
35003
|
+
// string it's named by, marked as an empty key
|
|
35004
|
+
if ((0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isNullElement)(keyResult) && (0,_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__.includesClasses)(keyResult, ['yaml-e-node'])) {
|
|
35005
|
+
const emptyKey = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"]('', keyResult.meta, keyResult.attributes);
|
|
35006
|
+
emptyKey.classes.push('yaml-e-key');
|
|
35007
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_11__["default"].transfer(keyResult, emptyKey);
|
|
35008
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_12__["default"].transfer(keyResult, emptyKey);
|
|
35009
|
+
keyResult = emptyKey;
|
|
35010
|
+
}
|
|
35011
|
+
|
|
35003
35012
|
// @ts-ignore
|
|
35004
35013
|
element.content.key = keyResult;
|
|
35005
35014
|
// @ts-ignore
|
|
@@ -35019,19 +35028,18 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
35019
35028
|
|
|
35020
35029
|
// Sequence: Transforms to ArrayElement
|
|
35021
35030
|
const transformSequence = (node, ctx) => {
|
|
35022
|
-
const element = new
|
|
35031
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_5__["default"]();
|
|
35023
35032
|
transformCollection(element, node, ctx);
|
|
35024
35033
|
return element;
|
|
35025
35034
|
};
|
|
35026
35035
|
|
|
35027
35036
|
// Scalar: Converts to Element via namespace
|
|
35028
35037
|
const transformScalar = (node, ctx) => {
|
|
35029
|
-
|
|
35030
|
-
|
|
35031
|
-
// Translate style information about empty nodes; an empty node (YAML 1.2 §7.2) is a null unless
|
|
35032
|
-
// a tag other than the null tag makes it something else (e.g. !!str makes it an empty string)
|
|
35038
|
+
// an empty node (YAML 1.2 §7.2) is a null unless a tag other than the null tag makes it
|
|
35039
|
+
// something else (e.g. !!str makes it an empty string); its classes tell it from an explicit null
|
|
35033
35040
|
const tag = node.tag?.explicitName;
|
|
35034
|
-
const isEmptyNode = node.content === '' && node.style ===
|
|
35041
|
+
const isEmptyNode = node.content === '' && node.style === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlStyle.Plain && [undefined, '?', '!!null', '!<tag:yaml.org,2002:null>'].includes(tag);
|
|
35042
|
+
const element = isEmptyNode ? new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]() : ctx.namespace.toElement(node.content);
|
|
35035
35043
|
if (isEmptyNode) {
|
|
35036
35044
|
element.classes.push('yaml-e-node');
|
|
35037
35045
|
element.classes.push('yaml-e-scalar');
|
|
@@ -35059,7 +35067,7 @@ const transformComment = (node, ctx) => {
|
|
|
35059
35067
|
// Only interested in stream comments before the first document
|
|
35060
35068
|
if (isStreamComment) {
|
|
35061
35069
|
// @ts-ignore
|
|
35062
|
-
const element = new
|
|
35070
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_9__["default"](node.content);
|
|
35063
35071
|
maybeAddSourceMap(node, element, ctx);
|
|
35064
35072
|
return element;
|
|
35065
35073
|
}
|
|
@@ -35070,7 +35078,7 @@ const transformComment = (node, ctx) => {
|
|
|
35070
35078
|
const transformLiteral = (node, ctx) => {
|
|
35071
35079
|
if (node.isMissing) {
|
|
35072
35080
|
const message = `(Missing ${node.value})`;
|
|
35073
|
-
const element = new
|
|
35081
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
35074
35082
|
element.classes.push('warning');
|
|
35075
35083
|
maybeAddSourceMap(node, element, ctx);
|
|
35076
35084
|
ctx.annotations.push(element);
|
|
@@ -35081,7 +35089,7 @@ const transformLiteral = (node, ctx) => {
|
|
|
35081
35089
|
// Error as annotation (used by keyValuePair)
|
|
35082
35090
|
const transformErrorAsAnnotation = (node, ctx) => {
|
|
35083
35091
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
35084
|
-
const element = new
|
|
35092
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
35085
35093
|
element.classes.push('error');
|
|
35086
35094
|
maybeAddSourceMap(node, element, ctx);
|
|
35087
35095
|
ctx.annotations.push(element);
|
|
@@ -35090,7 +35098,7 @@ const transformErrorAsAnnotation = (node, ctx) => {
|
|
|
35090
35098
|
// Error: Creates error annotation (adds to annotations array)
|
|
35091
35099
|
const transformError = (node, ctx) => {
|
|
35092
35100
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
35093
|
-
const element = new
|
|
35101
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
35094
35102
|
element.classes.push('error');
|
|
35095
35103
|
maybeAddSourceMap(node, element, ctx);
|
|
35096
35104
|
ctx.annotations.push(element);
|
|
@@ -35100,10 +35108,10 @@ const transformError = (node, ctx) => {
|
|
|
35100
35108
|
// Error at root level: Creates ParseResultElement with error annotation
|
|
35101
35109
|
const transformRootError = (node, ctx) => {
|
|
35102
35110
|
const message = node.isUnexpected ? '(Unexpected YAML syntax error)' : '(Error YAML syntax error)';
|
|
35103
|
-
const element = new
|
|
35111
|
+
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"](message);
|
|
35104
35112
|
element.classes.push('error');
|
|
35105
35113
|
maybeAddSourceMap(node, element, ctx);
|
|
35106
|
-
const parseResultElement = new
|
|
35114
|
+
const parseResultElement = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
35107
35115
|
parseResultElement.push(element);
|
|
35108
35116
|
return parseResultElement;
|
|
35109
35117
|
};
|
|
@@ -35130,7 +35138,7 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
35130
35138
|
|
|
35131
35139
|
// Handle empty parse result
|
|
35132
35140
|
if (!rootNode) {
|
|
35133
|
-
return new
|
|
35141
|
+
return new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
35134
35142
|
}
|
|
35135
35143
|
|
|
35136
35144
|
// Handle root-level error (no valid stream, just an error node)
|
|
@@ -35140,12 +35148,12 @@ const transformYamlAstToApiDOM = (yamlAst, {
|
|
|
35140
35148
|
const result = transform(rootNode, ctx);
|
|
35141
35149
|
|
|
35142
35150
|
// Result should be a ParseResultElement from transformStream
|
|
35143
|
-
if (result instanceof
|
|
35151
|
+
if (result instanceof _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]) {
|
|
35144
35152
|
return result;
|
|
35145
35153
|
}
|
|
35146
35154
|
|
|
35147
35155
|
// Fallback: wrap in ParseResultElement
|
|
35148
|
-
const parseResult = new
|
|
35156
|
+
const parseResult = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_10__["default"]();
|
|
35149
35157
|
if (result !== null) {
|
|
35150
35158
|
if (Array.isArray(result)) {
|
|
35151
35159
|
result.forEach(el => parseResult.push(el));
|
|
@@ -54264,7 +54272,7 @@ const Ast = function fnast() {
|
|
|
54264
54272
|
xml += `<root nodes="${records.length / 2}" characters="${chars.length}">\n`;
|
|
54265
54273
|
xml += `<!-- input string -->\n`;
|
|
54266
54274
|
xml += indent(depth + 2);
|
|
54267
|
-
xml += utils.
|
|
54275
|
+
xml += utils.charsToXmlString(chars);
|
|
54268
54276
|
xml += '\n';
|
|
54269
54277
|
records.forEach((rec) => {
|
|
54270
54278
|
if (rec.state === id.SEM_PRE) {
|
|
@@ -54272,7 +54280,7 @@ const Ast = function fnast() {
|
|
|
54272
54280
|
xml += indent(depth);
|
|
54273
54281
|
xml += `<node name="${rec.name}" index="${rec.phraseIndex}" length="${rec.phraseLength}">\n`;
|
|
54274
54282
|
xml += indent(depth + 2);
|
|
54275
|
-
xml += utils.
|
|
54283
|
+
xml += utils.charsToXmlString(chars, rec.phraseIndex, rec.phraseLength);
|
|
54276
54284
|
xml += '\n';
|
|
54277
54285
|
} else {
|
|
54278
54286
|
xml += indent(depth);
|
|
@@ -54654,6 +54662,14 @@ const utilities = {
|
|
|
54654
54662
|
}
|
|
54655
54663
|
return String.fromCodePoint(...subChars);
|
|
54656
54664
|
},
|
|
54665
|
+
charsToXmlString: (chars, beg, len) =>
|
|
54666
|
+
utilities
|
|
54667
|
+
.charsToString(chars, beg, len)
|
|
54668
|
+
.replace(/&/g, '&')
|
|
54669
|
+
.replace(/</g, '<')
|
|
54670
|
+
.replace(/>/g, '>')
|
|
54671
|
+
.replace(/'/g, ''')
|
|
54672
|
+
.replace(/"/g, '"'),
|
|
54657
54673
|
};
|
|
54658
54674
|
|
|
54659
54675
|
const identifiers = {
|