@speclynx/apidom-parser-adapter-asyncapi-yaml-2 2.11.0 → 2.12.1
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.
|
@@ -12060,6 +12060,53 @@ var both = /*#__PURE__*/(0,_internal_curry2_js__WEBPACK_IMPORTED_MODULE_0__["def
|
|
|
12060
12060
|
|
|
12061
12061
|
/***/ },
|
|
12062
12062
|
|
|
12063
|
+
/***/ 8138
|
|
12064
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
12065
|
+
|
|
12066
|
+
"use strict";
|
|
12067
|
+
__webpack_require__.r(__webpack_exports__);
|
|
12068
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12069
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12070
|
+
/* harmony export */ });
|
|
12071
|
+
/* harmony import */ var _internal_clone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8575);
|
|
12072
|
+
/* harmony import */ var _internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18938);
|
|
12073
|
+
|
|
12074
|
+
|
|
12075
|
+
|
|
12076
|
+
/**
|
|
12077
|
+
* Creates a deep copy of the source that can be used in place of the source
|
|
12078
|
+
* object without retaining any references to it.
|
|
12079
|
+
* The source object may contain (nested) `Array`s and `Object`s,
|
|
12080
|
+
* `Number`s, `String`s, `Boolean`s and `Date`s.
|
|
12081
|
+
* `Function`s are assigned by reference rather than copied.
|
|
12082
|
+
*
|
|
12083
|
+
* Dispatches to a `clone` method if present.
|
|
12084
|
+
*
|
|
12085
|
+
* Note that if the source object has multiple nodes that share a reference,
|
|
12086
|
+
* the returned object will have the same structure, but the references will
|
|
12087
|
+
* be pointed to the location within the cloned value.
|
|
12088
|
+
*
|
|
12089
|
+
* @func
|
|
12090
|
+
* @memberOf R
|
|
12091
|
+
* @since v0.1.0
|
|
12092
|
+
* @category Object
|
|
12093
|
+
* @sig {*} -> {*}
|
|
12094
|
+
* @param {*} value The object or array to clone
|
|
12095
|
+
* @return {*} A deeply cloned copy of `val`
|
|
12096
|
+
* @example
|
|
12097
|
+
*
|
|
12098
|
+
* const objects = [{}, {}, {}];
|
|
12099
|
+
* const objectsClone = R.clone(objects);
|
|
12100
|
+
* objects === objectsClone; //=> false
|
|
12101
|
+
* objects[0] === objectsClone[0]; //=> false
|
|
12102
|
+
*/
|
|
12103
|
+
var clone = /*#__PURE__*/(0,_internal_curry1_js__WEBPACK_IMPORTED_MODULE_1__["default"])(function clone(value) {
|
|
12104
|
+
return value != null && typeof value.clone === 'function' ? value.clone() : (0,_internal_clone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, true);
|
|
12105
|
+
});
|
|
12106
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clone);
|
|
12107
|
+
|
|
12108
|
+
/***/ },
|
|
12109
|
+
|
|
12063
12110
|
/***/ 68199
|
|
12064
12111
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
12065
12112
|
|
|
@@ -13505,6 +13552,132 @@ function _checkForMethod(methodname, fn) {
|
|
|
13505
13552
|
|
|
13506
13553
|
/***/ },
|
|
13507
13554
|
|
|
13555
|
+
/***/ 8575
|
|
13556
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
13557
|
+
|
|
13558
|
+
"use strict";
|
|
13559
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13560
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13561
|
+
/* harmony export */ "default": () => (/* binding */ _clone)
|
|
13562
|
+
/* harmony export */ });
|
|
13563
|
+
/* harmony import */ var _cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(31254);
|
|
13564
|
+
/* harmony import */ var _type_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(60963);
|
|
13565
|
+
|
|
13566
|
+
|
|
13567
|
+
|
|
13568
|
+
/**
|
|
13569
|
+
* Copies an object.
|
|
13570
|
+
*
|
|
13571
|
+
* @private
|
|
13572
|
+
* @param {*} value The value to be copied
|
|
13573
|
+
* @param {Boolean} deep Whether or not to perform deep cloning.
|
|
13574
|
+
* @return {*} The copied value.
|
|
13575
|
+
*/
|
|
13576
|
+
function _clone(value, deep, map) {
|
|
13577
|
+
map || (map = new _ObjectMap());
|
|
13578
|
+
|
|
13579
|
+
// this avoids the slower switch with a quick if decision removing some milliseconds in each run.
|
|
13580
|
+
if (_isPrimitive(value)) {
|
|
13581
|
+
return value;
|
|
13582
|
+
}
|
|
13583
|
+
var copy = function copy(copiedValue) {
|
|
13584
|
+
// Check for circular and same references on the object graph and return its corresponding clone.
|
|
13585
|
+
var cachedCopy = map.get(value);
|
|
13586
|
+
if (cachedCopy) {
|
|
13587
|
+
return cachedCopy;
|
|
13588
|
+
}
|
|
13589
|
+
map.set(value, copiedValue);
|
|
13590
|
+
for (var key in value) {
|
|
13591
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
13592
|
+
copiedValue[key] = deep ? _clone(value[key], true, map) : value[key];
|
|
13593
|
+
}
|
|
13594
|
+
}
|
|
13595
|
+
return copiedValue;
|
|
13596
|
+
};
|
|
13597
|
+
switch ((0,_type_js__WEBPACK_IMPORTED_MODULE_1__["default"])(value)) {
|
|
13598
|
+
case 'Object':
|
|
13599
|
+
return copy(Object.create(Object.getPrototypeOf(value)));
|
|
13600
|
+
case 'Array':
|
|
13601
|
+
return copy(Array(value.length));
|
|
13602
|
+
case 'Date':
|
|
13603
|
+
return new Date(value.valueOf());
|
|
13604
|
+
case 'RegExp':
|
|
13605
|
+
return (0,_cloneRegExp_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value);
|
|
13606
|
+
case 'Int8Array':
|
|
13607
|
+
case 'Uint8Array':
|
|
13608
|
+
case 'Uint8ClampedArray':
|
|
13609
|
+
case 'Int16Array':
|
|
13610
|
+
case 'Uint16Array':
|
|
13611
|
+
case 'Int32Array':
|
|
13612
|
+
case 'Uint32Array':
|
|
13613
|
+
case 'Float32Array':
|
|
13614
|
+
case 'Float64Array':
|
|
13615
|
+
case 'BigInt64Array':
|
|
13616
|
+
case 'BigUint64Array':
|
|
13617
|
+
return value.slice();
|
|
13618
|
+
default:
|
|
13619
|
+
return value;
|
|
13620
|
+
}
|
|
13621
|
+
}
|
|
13622
|
+
function _isPrimitive(param) {
|
|
13623
|
+
var type = typeof param;
|
|
13624
|
+
return param == null || type != 'object' && type != 'function';
|
|
13625
|
+
}
|
|
13626
|
+
var _ObjectMap = /*#__PURE__*/function () {
|
|
13627
|
+
function _ObjectMap() {
|
|
13628
|
+
this.map = {};
|
|
13629
|
+
this.length = 0;
|
|
13630
|
+
}
|
|
13631
|
+
_ObjectMap.prototype.set = function (key, value) {
|
|
13632
|
+
var hashedKey = this.hash(key);
|
|
13633
|
+
var bucket = this.map[hashedKey];
|
|
13634
|
+
if (!bucket) {
|
|
13635
|
+
this.map[hashedKey] = bucket = [];
|
|
13636
|
+
}
|
|
13637
|
+
bucket.push([key, value]);
|
|
13638
|
+
this.length += 1;
|
|
13639
|
+
};
|
|
13640
|
+
_ObjectMap.prototype.hash = function (key) {
|
|
13641
|
+
var hashedKey = [];
|
|
13642
|
+
for (var value in key) {
|
|
13643
|
+
hashedKey.push(Object.prototype.toString.call(key[value]));
|
|
13644
|
+
}
|
|
13645
|
+
return hashedKey.join();
|
|
13646
|
+
};
|
|
13647
|
+
_ObjectMap.prototype.get = function (key) {
|
|
13648
|
+
/**
|
|
13649
|
+
* depending on the number of objects to be cloned is faster to just iterate over the items in the map just because the hash function is so costly,
|
|
13650
|
+
* on my tests this number is 180, anything above that using the hash function is faster.
|
|
13651
|
+
*/
|
|
13652
|
+
if (this.length <= 180) {
|
|
13653
|
+
for (var p in this.map) {
|
|
13654
|
+
var bucket = this.map[p];
|
|
13655
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
|
13656
|
+
var element = bucket[i];
|
|
13657
|
+
if (element[0] === key) {
|
|
13658
|
+
return element[1];
|
|
13659
|
+
}
|
|
13660
|
+
}
|
|
13661
|
+
}
|
|
13662
|
+
return;
|
|
13663
|
+
}
|
|
13664
|
+
var hashedKey = this.hash(key);
|
|
13665
|
+
var bucket = this.map[hashedKey];
|
|
13666
|
+
if (!bucket) {
|
|
13667
|
+
return;
|
|
13668
|
+
}
|
|
13669
|
+
for (var i = 0; i < bucket.length; i += 1) {
|
|
13670
|
+
var element = bucket[i];
|
|
13671
|
+
if (element[0] === key) {
|
|
13672
|
+
return element[1];
|
|
13673
|
+
}
|
|
13674
|
+
}
|
|
13675
|
+
};
|
|
13676
|
+
return _ObjectMap;
|
|
13677
|
+
}();
|
|
13678
|
+
|
|
13679
|
+
/***/ },
|
|
13680
|
+
|
|
13508
13681
|
/***/ 31254
|
|
13509
13682
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
13510
13683
|
|
|
@@ -30526,6 +30699,7 @@ const predicates = {
|
|
|
30526
30699
|
isCommentElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isCommentElement,
|
|
30527
30700
|
isParseResultElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isParseResultElement,
|
|
30528
30701
|
isSourceMapElement: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__.isSourceMapElement,
|
|
30702
|
+
hasElementStyle: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementStyle,
|
|
30529
30703
|
hasElementSourceMap: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.hasElementSourceMap,
|
|
30530
30704
|
includesSymbols: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesSymbols,
|
|
30531
30705
|
includesClasses: _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__.includesClasses
|
|
@@ -30597,7 +30771,19 @@ const resolveSpecification = specification => {
|
|
|
30597
30771
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(val) && (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])('$ref', val) && (0,ramda__WEBPACK_IMPORTED_MODULE_3__["default"])(ramda_adjunct__WEBPACK_IMPORTED_MODULE_4__["default"], '$ref', val)) {
|
|
30598
30772
|
const $ref = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(['$ref'], val);
|
|
30599
30773
|
const pointer = (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_6__["default"])('#/', $ref);
|
|
30600
|
-
|
|
30774
|
+
const resolved = (0,ramda__WEBPACK_IMPORTED_MODULE_2__["default"])(pointer.split('/'), root);
|
|
30775
|
+
// merge extra properties (e.g. alias) from the $ref object into the resolved value
|
|
30776
|
+
const {
|
|
30777
|
+
$ref: _,
|
|
30778
|
+
...rest
|
|
30779
|
+
} = val;
|
|
30780
|
+
if (Object.keys(rest).length > 0 && (0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(resolved)) {
|
|
30781
|
+
return {
|
|
30782
|
+
...resolved,
|
|
30783
|
+
...rest
|
|
30784
|
+
};
|
|
30785
|
+
}
|
|
30786
|
+
return resolved;
|
|
30601
30787
|
}
|
|
30602
30788
|
if ((0,ramda_adjunct__WEBPACK_IMPORTED_MODULE_5__["default"])(val)) {
|
|
30603
30789
|
return traverse(val, root, newPath);
|
|
@@ -31220,20 +31406,22 @@ class ShallowCloneError extends _CloneError_mjs__WEBPACK_IMPORTED_MODULE_0__["de
|
|
|
31220
31406
|
"use strict";
|
|
31221
31407
|
__webpack_require__.r(__webpack_exports__);
|
|
31222
31408
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31223
|
-
/* harmony export */ CloneError: () => (/* reexport safe */
|
|
31224
|
-
/* harmony export */ DeepCloneError: () => (/* reexport safe */
|
|
31225
|
-
/* harmony export */ ShallowCloneError: () => (/* reexport safe */
|
|
31409
|
+
/* harmony export */ CloneError: () => (/* reexport safe */ _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
31410
|
+
/* harmony export */ DeepCloneError: () => (/* reexport safe */ _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]),
|
|
31411
|
+
/* harmony export */ ShallowCloneError: () => (/* reexport safe */ _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
31226
31412
|
/* harmony export */ cloneDeep: () => (/* binding */ cloneDeep),
|
|
31227
31413
|
/* harmony export */ cloneShallow: () => (/* binding */ cloneShallow)
|
|
31228
31414
|
/* harmony export */ });
|
|
31229
|
-
/* harmony import */ var
|
|
31230
|
-
/* harmony import */ var
|
|
31231
|
-
/* harmony import */ var
|
|
31232
|
-
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
|
|
31233
|
-
/* harmony import */ var
|
|
31234
|
-
/* harmony import */ var
|
|
31235
|
-
/* harmony import */ var
|
|
31236
|
-
/* harmony import */ var
|
|
31415
|
+
/* harmony import */ var ramda__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8138);
|
|
31416
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38504);
|
|
31417
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36663);
|
|
31418
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18252);
|
|
31419
|
+
/* harmony import */ var _predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(25162);
|
|
31420
|
+
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25810);
|
|
31421
|
+
/* harmony import */ var _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(95018);
|
|
31422
|
+
/* harmony import */ var _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3686);
|
|
31423
|
+
/* harmony import */ var _errors_CloneError_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3772);
|
|
31424
|
+
|
|
31237
31425
|
|
|
31238
31426
|
|
|
31239
31427
|
|
|
@@ -31266,9 +31454,9 @@ const cloneDeepElement = (element, options) => {
|
|
|
31266
31454
|
} = element;
|
|
31267
31455
|
if (Array.isArray(content)) {
|
|
31268
31456
|
copy.content = content.map(el => cloneDeepElement(el, passThroughOptions));
|
|
31269
|
-
} else if ((0,
|
|
31457
|
+
} else if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
|
|
31270
31458
|
copy.content = cloneDeepElement(content, passThroughOptions);
|
|
31271
|
-
} else if (content instanceof
|
|
31459
|
+
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
31272
31460
|
copy.content = cloneDeepKeyValuePair(content, passThroughOptions);
|
|
31273
31461
|
} else {
|
|
31274
31462
|
copy.content = content;
|
|
@@ -31292,7 +31480,7 @@ const cloneDeepKeyValuePair = (kvp, options) => {
|
|
|
31292
31480
|
} = kvp;
|
|
31293
31481
|
const keyCopy = key !== undefined ? cloneDeepElement(key, passThroughOptions) : undefined;
|
|
31294
31482
|
const valueCopy = value !== undefined ? cloneDeepElement(value, passThroughOptions) : undefined;
|
|
31295
|
-
const copy = new
|
|
31483
|
+
const copy = new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](keyCopy, valueCopy);
|
|
31296
31484
|
visited.set(kvp, copy);
|
|
31297
31485
|
return copy;
|
|
31298
31486
|
};
|
|
@@ -31308,7 +31496,7 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
31308
31496
|
return visited.get(slice);
|
|
31309
31497
|
}
|
|
31310
31498
|
const items = [...slice].map(element => cloneDeepElement(element, passThroughOptions));
|
|
31311
|
-
const copy = new
|
|
31499
|
+
const copy = new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
|
|
31312
31500
|
visited.set(slice, copy);
|
|
31313
31501
|
return copy;
|
|
31314
31502
|
};
|
|
@@ -31319,16 +31507,16 @@ const cloneDeepObjectSlice = (slice, options) => {
|
|
|
31319
31507
|
* @public
|
|
31320
31508
|
*/
|
|
31321
31509
|
const cloneDeep = (value, options = {}) => {
|
|
31322
|
-
if (value instanceof
|
|
31510
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
31323
31511
|
return cloneDeepKeyValuePair(value, options);
|
|
31324
31512
|
}
|
|
31325
|
-
if (value instanceof
|
|
31513
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
31326
31514
|
return cloneDeepObjectSlice(value, options);
|
|
31327
31515
|
}
|
|
31328
|
-
if ((0,
|
|
31516
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
|
|
31329
31517
|
return cloneDeepElement(value, options);
|
|
31330
31518
|
}
|
|
31331
|
-
throw new
|
|
31519
|
+
throw new _errors_DeepCloneError_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]("Value provided to cloneDeep function couldn't be cloned", {
|
|
31332
31520
|
value
|
|
31333
31521
|
});
|
|
31334
31522
|
};
|
|
@@ -31344,11 +31532,11 @@ const cloneShallowKeyValuePair = keyValuePair => {
|
|
|
31344
31532
|
key,
|
|
31345
31533
|
value
|
|
31346
31534
|
} = keyValuePair;
|
|
31347
|
-
return new
|
|
31535
|
+
return new _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"](key, value);
|
|
31348
31536
|
};
|
|
31349
31537
|
const cloneShallowObjectSlice = objectSlice => {
|
|
31350
31538
|
const items = [...objectSlice];
|
|
31351
|
-
return new
|
|
31539
|
+
return new _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"](items);
|
|
31352
31540
|
};
|
|
31353
31541
|
const cloneShallowElement = element => {
|
|
31354
31542
|
const Ctor = element.constructor;
|
|
@@ -31360,17 +31548,20 @@ const cloneShallowElement = element => {
|
|
|
31360
31548
|
if (!element.isAttributesEmpty) {
|
|
31361
31549
|
copy.attributes = cloneDeep(element.attributes);
|
|
31362
31550
|
}
|
|
31363
|
-
if ((0,
|
|
31364
|
-
|
|
31551
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementSourceMap)(element)) {
|
|
31552
|
+
_elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_5__["default"].transfer(element, copy);
|
|
31553
|
+
}
|
|
31554
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_3__.hasElementStyle)(element)) {
|
|
31555
|
+
copy.style = (0,ramda__WEBPACK_IMPORTED_MODULE_0__["default"])(element.style);
|
|
31365
31556
|
}
|
|
31366
31557
|
const {
|
|
31367
31558
|
content
|
|
31368
31559
|
} = element;
|
|
31369
|
-
if ((0,
|
|
31560
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(content)) {
|
|
31370
31561
|
copy.content = cloneShallowElement(content);
|
|
31371
31562
|
} else if (Array.isArray(content)) {
|
|
31372
31563
|
copy.content = [...content];
|
|
31373
|
-
} else if (content instanceof
|
|
31564
|
+
} else if (content instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
31374
31565
|
copy.content = cloneShallowKeyValuePair(content);
|
|
31375
31566
|
} else {
|
|
31376
31567
|
copy.content = content;
|
|
@@ -31385,16 +31576,16 @@ const cloneShallowElement = element => {
|
|
|
31385
31576
|
* @public
|
|
31386
31577
|
*/
|
|
31387
31578
|
const cloneShallow = value => {
|
|
31388
|
-
if (value instanceof
|
|
31579
|
+
if (value instanceof _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]) {
|
|
31389
31580
|
return cloneShallowKeyValuePair(value);
|
|
31390
31581
|
}
|
|
31391
|
-
if (value instanceof
|
|
31582
|
+
if (value instanceof _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]) {
|
|
31392
31583
|
return cloneShallowObjectSlice(value);
|
|
31393
31584
|
}
|
|
31394
|
-
if ((0,
|
|
31585
|
+
if ((0,_predicates_index_mjs__WEBPACK_IMPORTED_MODULE_4__.isElement)(value)) {
|
|
31395
31586
|
return cloneShallowElement(value);
|
|
31396
31587
|
}
|
|
31397
|
-
throw new
|
|
31588
|
+
throw new _errors_ShallowCloneError_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]("Value provided to cloneShallow function couldn't be cloned", {
|
|
31398
31589
|
value
|
|
31399
31590
|
});
|
|
31400
31591
|
};
|
|
@@ -31821,6 +32012,66 @@ function unpackSourceMap(packed) {
|
|
|
31821
32012
|
|
|
31822
32013
|
/***/ },
|
|
31823
32014
|
|
|
32015
|
+
/***/ 49686
|
|
32016
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
32017
|
+
|
|
32018
|
+
"use strict";
|
|
32019
|
+
__webpack_require__.r(__webpack_exports__);
|
|
32020
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
32021
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
32022
|
+
/* harmony export */ });
|
|
32023
|
+
/* harmony import */ var _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(97071);
|
|
32024
|
+
|
|
32025
|
+
/**
|
|
32026
|
+
* Shape with optional style property.
|
|
32027
|
+
* @public
|
|
32028
|
+
*/
|
|
32029
|
+
/**
|
|
32030
|
+
* StyleElement stores format-specific style information for round-trip preservation.
|
|
32031
|
+
*
|
|
32032
|
+
* The style data is stored as a plain object with format-specific namespaces
|
|
32033
|
+
* (e.g., `yaml`, `json`). This element exists only during serialization/deserialization
|
|
32034
|
+
* (refract format) - in memory, style lives directly on `element.style`.
|
|
32035
|
+
*
|
|
32036
|
+
* Follows the same pattern as SourceMapElement with __mappings__.
|
|
32037
|
+
*
|
|
32038
|
+
* @public
|
|
32039
|
+
*/
|
|
32040
|
+
class StyleElement extends _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
32041
|
+
constructor(content, meta, attributes) {
|
|
32042
|
+
super(content, meta, attributes);
|
|
32043
|
+
this.element = '__styles__';
|
|
32044
|
+
}
|
|
32045
|
+
|
|
32046
|
+
/**
|
|
32047
|
+
* Transfers style property from one element to another.
|
|
32048
|
+
*/
|
|
32049
|
+
static transfer(from, to) {
|
|
32050
|
+
to.style = from.style;
|
|
32051
|
+
}
|
|
32052
|
+
|
|
32053
|
+
/**
|
|
32054
|
+
* Creates a StyleElement from an element's style property.
|
|
32055
|
+
* Returns undefined if the element has no style.
|
|
32056
|
+
*/
|
|
32057
|
+
static from(source) {
|
|
32058
|
+
if (!source.style) {
|
|
32059
|
+
return undefined;
|
|
32060
|
+
}
|
|
32061
|
+
return new StyleElement(source.style);
|
|
32062
|
+
}
|
|
32063
|
+
|
|
32064
|
+
/**
|
|
32065
|
+
* Restores the style property on the target element from this StyleElement.
|
|
32066
|
+
*/
|
|
32067
|
+
applyTo(target) {
|
|
32068
|
+
target.style = this.toValue();
|
|
32069
|
+
}
|
|
32070
|
+
}
|
|
32071
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StyleElement);
|
|
32072
|
+
|
|
32073
|
+
/***/ },
|
|
32074
|
+
|
|
31824
32075
|
/***/ 96911
|
|
31825
32076
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
31826
32077
|
|
|
@@ -31885,6 +32136,7 @@ const isSourceMapElement = element => element instanceof _elements_SourceMap_mjs
|
|
|
31885
32136
|
__webpack_require__.r(__webpack_exports__);
|
|
31886
32137
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
31887
32138
|
/* harmony export */ hasElementSourceMap: () => (/* binding */ hasElementSourceMap),
|
|
32139
|
+
/* harmony export */ hasElementStyle: () => (/* binding */ hasElementStyle),
|
|
31888
32140
|
/* harmony export */ includesClasses: () => (/* binding */ includesClasses),
|
|
31889
32141
|
/* harmony export */ includesSymbols: () => (/* binding */ includesSymbols),
|
|
31890
32142
|
/* harmony export */ isAnnotationElement: () => (/* reexport safe */ _elements_mjs__WEBPACK_IMPORTED_MODULE_1__.isAnnotationElement),
|
|
@@ -31909,6 +32161,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
31909
32161
|
|
|
31910
32162
|
|
|
31911
32163
|
|
|
32164
|
+
/**
|
|
32165
|
+
* Checks if an element has format-specific style information.
|
|
32166
|
+
* @public
|
|
32167
|
+
*/
|
|
32168
|
+
const hasElementStyle = element => {
|
|
32169
|
+
return element.style !== undefined;
|
|
32170
|
+
};
|
|
32171
|
+
|
|
31912
32172
|
/**
|
|
31913
32173
|
* Checks if an element has complete source position information.
|
|
31914
32174
|
* Returns true only if all 6 position properties are numbers.
|
|
@@ -32450,6 +32710,12 @@ class Element {
|
|
|
32450
32710
|
*/
|
|
32451
32711
|
parent;
|
|
32452
32712
|
|
|
32713
|
+
/**
|
|
32714
|
+
* Format-specific style information for round-trip preservation.
|
|
32715
|
+
* Each format owns its own namespace (e.g., `yaml`, `json`).
|
|
32716
|
+
*/
|
|
32717
|
+
style;
|
|
32718
|
+
|
|
32453
32719
|
// ============================================================================
|
|
32454
32720
|
// Source Position (LSP-compatible, TextDocument-compatible, UTF-16 code units)
|
|
32455
32721
|
// web-tree-sitter automatically provides position data in UTF-16 code units.
|
|
@@ -33339,17 +33605,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33339
33605
|
/* harmony export */ CollectionElement: () => (/* reexport safe */ _primitives_CollectionElement_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]),
|
|
33340
33606
|
/* harmony export */ CommentElement: () => (/* reexport safe */ _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]),
|
|
33341
33607
|
/* harmony export */ Element: () => (/* reexport safe */ _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]),
|
|
33342
|
-
/* harmony export */ KeyValuePair: () => (/* reexport safe */
|
|
33608
|
+
/* harmony export */ KeyValuePair: () => (/* reexport safe */ _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__["default"]),
|
|
33343
33609
|
/* harmony export */ LinkElement: () => (/* reexport safe */ _elements_LinkElement_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]),
|
|
33344
33610
|
/* harmony export */ MemberElement: () => (/* reexport safe */ _primitives_MemberElement_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]),
|
|
33345
33611
|
/* harmony export */ NullElement: () => (/* reexport safe */ _primitives_NullElement_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]),
|
|
33346
33612
|
/* harmony export */ NumberElement: () => (/* reexport safe */ _primitives_NumberElement_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]),
|
|
33347
33613
|
/* harmony export */ ObjectElement: () => (/* reexport safe */ _primitives_ObjectElement_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]),
|
|
33348
|
-
/* harmony export */ ObjectSlice: () => (/* reexport safe */
|
|
33614
|
+
/* harmony export */ ObjectSlice: () => (/* reexport safe */ _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__["default"]),
|
|
33349
33615
|
/* harmony export */ ParseResultElement: () => (/* reexport safe */ _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]),
|
|
33350
33616
|
/* harmony export */ RefElement: () => (/* reexport safe */ _elements_RefElement_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]),
|
|
33351
33617
|
/* harmony export */ SourceMapElement: () => (/* reexport safe */ _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]),
|
|
33352
33618
|
/* harmony export */ StringElement: () => (/* reexport safe */ _primitives_StringElement_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
33619
|
+
/* harmony export */ StyleElement: () => (/* reexport safe */ _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__["default"]),
|
|
33353
33620
|
/* harmony export */ refract: () => (/* binding */ refract)
|
|
33354
33621
|
/* harmony export */ });
|
|
33355
33622
|
/* harmony import */ var _primitives_Element_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60728);
|
|
@@ -33367,8 +33634,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33367
33634
|
/* harmony import */ var _elements_Comment_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(40094);
|
|
33368
33635
|
/* harmony import */ var _elements_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4823);
|
|
33369
33636
|
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(25810);
|
|
33370
|
-
/* harmony import */ var
|
|
33371
|
-
/* harmony import */ var
|
|
33637
|
+
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(49686);
|
|
33638
|
+
/* harmony import */ var _ObjectSlice_mjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(38504);
|
|
33639
|
+
/* harmony import */ var _KeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(36663);
|
|
33640
|
+
|
|
33372
33641
|
|
|
33373
33642
|
|
|
33374
33643
|
|
|
@@ -33455,6 +33724,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33455
33724
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
33456
33725
|
/* harmony export */ });
|
|
33457
33726
|
/* harmony import */ var _elements_SourceMap_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25810);
|
|
33727
|
+
/* harmony import */ var _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49686);
|
|
33728
|
+
|
|
33458
33729
|
|
|
33459
33730
|
/**
|
|
33460
33731
|
* Serialized representation of an Element in JSON Refract format.
|
|
@@ -33513,6 +33784,17 @@ class JSONSerialiser {
|
|
|
33513
33784
|
payload.meta.__mappings__ = this.serialise(sourceMap);
|
|
33514
33785
|
}
|
|
33515
33786
|
}
|
|
33787
|
+
|
|
33788
|
+
// Serialize style as __styles__ in meta (skip for StyleElement itself)
|
|
33789
|
+
if (!(element instanceof _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])) {
|
|
33790
|
+
const styleElement = _elements_Style_mjs__WEBPACK_IMPORTED_MODULE_1__["default"].from(element);
|
|
33791
|
+
if (styleElement) {
|
|
33792
|
+
if (!payload.meta) {
|
|
33793
|
+
payload.meta = {};
|
|
33794
|
+
}
|
|
33795
|
+
payload.meta.__styles__ = this.serialise(styleElement);
|
|
33796
|
+
}
|
|
33797
|
+
}
|
|
33516
33798
|
const content = this.serialiseContent(element.content);
|
|
33517
33799
|
if (content !== undefined) {
|
|
33518
33800
|
payload.content = content;
|
|
@@ -33533,15 +33815,18 @@ class JSONSerialiser {
|
|
|
33533
33815
|
element.element = value.element;
|
|
33534
33816
|
}
|
|
33535
33817
|
|
|
33536
|
-
// Extract __mappings__ without mutating input, filter remaining meta
|
|
33818
|
+
// Extract __mappings__ and __styles__ without mutating input, filter remaining meta
|
|
33537
33819
|
let mappingsDoc;
|
|
33820
|
+
let stylesDoc;
|
|
33538
33821
|
let metaToDeserialize = value.meta;
|
|
33539
|
-
if (value.meta?.__mappings__) {
|
|
33822
|
+
if (value.meta?.__mappings__ || value.meta?.__styles__) {
|
|
33540
33823
|
const {
|
|
33541
33824
|
__mappings__,
|
|
33825
|
+
__styles__,
|
|
33542
33826
|
...rest
|
|
33543
33827
|
} = value.meta;
|
|
33544
33828
|
mappingsDoc = __mappings__;
|
|
33829
|
+
stylesDoc = __styles__;
|
|
33545
33830
|
metaToDeserialize = Object.keys(rest).length > 0 ? rest : undefined;
|
|
33546
33831
|
}
|
|
33547
33832
|
if (metaToDeserialize) {
|
|
@@ -33553,6 +33838,12 @@ class JSONSerialiser {
|
|
|
33553
33838
|
const sourceMap = this.deserialise(mappingsDoc);
|
|
33554
33839
|
sourceMap.applyTo(element);
|
|
33555
33840
|
}
|
|
33841
|
+
|
|
33842
|
+
// Restore style from __styles__
|
|
33843
|
+
if (stylesDoc) {
|
|
33844
|
+
const styleElement = this.deserialise(stylesDoc);
|
|
33845
|
+
styleElement.applyTo(element);
|
|
33846
|
+
}
|
|
33556
33847
|
if (value.attributes) {
|
|
33557
33848
|
this.deserialiseObject(value.attributes, element.attributes);
|
|
33558
33849
|
}
|
|
@@ -42430,7 +42721,7 @@ const specification = {
|
|
|
42430
42721
|
$ref: '#/visitors/value'
|
|
42431
42722
|
},
|
|
42432
42723
|
attributes: {
|
|
42433
|
-
$
|
|
42724
|
+
$ref: '#/visitors/value',
|
|
42434
42725
|
alias: 'attributesField'
|
|
42435
42726
|
},
|
|
42436
42727
|
orderingKey: {
|
|
@@ -42720,6 +43011,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
42720
43011
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
42721
43012
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
42722
43013
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
43014
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
42723
43015
|
|
|
42724
43016
|
|
|
42725
43017
|
|
|
@@ -42747,6 +43039,7 @@ class Visitor {
|
|
|
42747
43039
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
42748
43040
|
}
|
|
42749
43041
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
43042
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
42750
43043
|
}
|
|
42751
43044
|
}
|
|
42752
43045
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -49292,7 +49585,7 @@ const specification = {
|
|
|
49292
49585
|
fixedFields: {
|
|
49293
49586
|
// core vocabulary
|
|
49294
49587
|
id: {
|
|
49295
|
-
$
|
|
49588
|
+
$ref: '#/visitors/value',
|
|
49296
49589
|
alias: 'idField'
|
|
49297
49590
|
},
|
|
49298
49591
|
$schema: {
|
|
@@ -49574,6 +49867,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49574
49867
|
/* harmony import */ var _speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(28400);
|
|
49575
49868
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97071);
|
|
49576
49869
|
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(25810);
|
|
49870
|
+
/* harmony import */ var _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49686);
|
|
49577
49871
|
|
|
49578
49872
|
|
|
49579
49873
|
|
|
@@ -49601,6 +49895,7 @@ class Visitor {
|
|
|
49601
49895
|
to.attributes = (0,_speclynx_apidom_core__WEBPACK_IMPORTED_MODULE_0__["default"])(target, source);
|
|
49602
49896
|
}
|
|
49603
49897
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"].transfer(from, to);
|
|
49898
|
+
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_3__["default"].transfer(from, to);
|
|
49604
49899
|
}
|
|
49605
49900
|
}
|
|
49606
49901
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Visitor);
|
|
@@ -51492,16 +51787,21 @@ const detect = async (source, {
|
|
|
51492
51787
|
*/
|
|
51493
51788
|
const parse = async (source, {
|
|
51494
51789
|
sourceMap = false,
|
|
51790
|
+
style = false,
|
|
51495
51791
|
strict = false
|
|
51496
51792
|
} = {}) => {
|
|
51497
51793
|
if (strict && sourceMap) {
|
|
51498
51794
|
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use sourceMap with strict parsing. Strict parsing does not support source maps.');
|
|
51499
51795
|
}
|
|
51796
|
+
if (strict && style) {
|
|
51797
|
+
throw new _speclynx_apidom_error__WEBPACK_IMPORTED_MODULE_1__["default"]('Cannot use style with strict parsing. Strict parsing does not support style preservation.');
|
|
51798
|
+
}
|
|
51500
51799
|
if (strict) {
|
|
51501
51800
|
return _yaml_index_mjs__WEBPACK_IMPORTED_MODULE_2__.parse(source);
|
|
51502
51801
|
}
|
|
51503
51802
|
return _tree_sitter_index_mjs__WEBPACK_IMPORTED_MODULE_3__.parse(source, {
|
|
51504
|
-
sourceMap
|
|
51803
|
+
sourceMap,
|
|
51804
|
+
style
|
|
51505
51805
|
});
|
|
51506
51806
|
};
|
|
51507
51807
|
|
|
@@ -51576,12 +51876,14 @@ const detect = async source => {
|
|
|
51576
51876
|
* @public
|
|
51577
51877
|
*/
|
|
51578
51878
|
const parse = async (source, {
|
|
51579
|
-
sourceMap = false
|
|
51879
|
+
sourceMap = false,
|
|
51880
|
+
style = false
|
|
51580
51881
|
} = {}) => {
|
|
51581
51882
|
const cst = await (0,_lexical_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"])(source);
|
|
51582
51883
|
try {
|
|
51583
51884
|
return (0,_syntactic_analysis_index_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])(cst, {
|
|
51584
|
-
sourceMap
|
|
51885
|
+
sourceMap,
|
|
51886
|
+
style
|
|
51585
51887
|
});
|
|
51586
51888
|
} finally {
|
|
51587
51889
|
cst.delete();
|
|
@@ -51655,18 +51957,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
51655
51957
|
/* harmony import */ var _ast_Error_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33240);
|
|
51656
51958
|
/* harmony import */ var _ast_Literal_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(86951);
|
|
51657
51959
|
/* harmony import */ var _ast_ParseResult_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(88912);
|
|
51658
|
-
/* harmony import */ var
|
|
51659
|
-
/* harmony import */ var
|
|
51660
|
-
/* harmony import */ var
|
|
51661
|
-
/* harmony import */ var
|
|
51662
|
-
/* harmony import */ var
|
|
51663
|
-
/* harmony import */ var
|
|
51664
|
-
/* harmony import */ var
|
|
51665
|
-
/* harmony import */ var
|
|
51666
|
-
/* harmony import */ var
|
|
51667
|
-
/* harmony import */ var
|
|
51668
|
-
/* harmony import */ var
|
|
51669
|
-
/* harmony import */ var
|
|
51960
|
+
/* harmony import */ var _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6821);
|
|
51961
|
+
/* harmony import */ var _ast_nodes_YamlAlias_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15103);
|
|
51962
|
+
/* harmony import */ var _ast_nodes_YamlAnchor_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2838);
|
|
51963
|
+
/* harmony import */ var _ast_nodes_YamlComment_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14120);
|
|
51964
|
+
/* harmony import */ var _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22532);
|
|
51965
|
+
/* harmony import */ var _ast_nodes_YamlDocument_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(17374);
|
|
51966
|
+
/* harmony import */ var _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39113);
|
|
51967
|
+
/* harmony import */ var _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(17373);
|
|
51968
|
+
/* harmony import */ var _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(20301);
|
|
51969
|
+
/* harmony import */ var _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(46794);
|
|
51970
|
+
/* harmony import */ var _ast_nodes_YamlStream_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(74213);
|
|
51971
|
+
/* harmony import */ var _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(48139);
|
|
51972
|
+
/* harmony import */ var _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(21544);
|
|
51973
|
+
|
|
51670
51974
|
|
|
51671
51975
|
|
|
51672
51976
|
|
|
@@ -51706,16 +52010,16 @@ const toPositionProps = info => ({
|
|
|
51706
52010
|
endOffset: info.endIndex
|
|
51707
52011
|
});
|
|
51708
52012
|
const toYamlAnchor = info => {
|
|
51709
|
-
return new
|
|
52013
|
+
return new _ast_nodes_YamlAnchor_mjs__WEBPACK_IMPORTED_MODULE_5__["default"]({
|
|
51710
52014
|
name: info.text,
|
|
51711
52015
|
...toPositionProps(info)
|
|
51712
52016
|
});
|
|
51713
52017
|
};
|
|
51714
52018
|
const toYamlTag = (info, tagInfo) => {
|
|
51715
52019
|
const explicitName = tagInfo?.text || (info.type === 'plain_scalar' ? '?' : '!');
|
|
51716
|
-
const kind = info.type.endsWith('mapping') ?
|
|
52020
|
+
const kind = info.type.endsWith('mapping') ? _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Mapping : info.type.endsWith('sequence') ? _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Sequence : _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar;
|
|
51717
52021
|
const positionProps = tagInfo ? toPositionProps(tagInfo) : undefined;
|
|
51718
|
-
return new
|
|
52022
|
+
return new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
51719
52023
|
explicitName,
|
|
51720
52024
|
kind,
|
|
51721
52025
|
...positionProps
|
|
@@ -51763,12 +52067,29 @@ const processChildren = (cursor, ctx, transformerMap) => {
|
|
|
51763
52067
|
return results;
|
|
51764
52068
|
};
|
|
51765
52069
|
|
|
52070
|
+
// strip leading '# ' (or bare '#') from comment text, keeping only the content
|
|
52071
|
+
const stripCommentHash = text => text.split('\n').map(line => line.replace(/^#\s?/, '')).join('\n');
|
|
52072
|
+
|
|
52073
|
+
// find the first YamlNode in a TransformResult (which may be an array from block_node)
|
|
52074
|
+
const findYamlNode = result => {
|
|
52075
|
+
if (result instanceof _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) return result;
|
|
52076
|
+
if (Array.isArray(result)) {
|
|
52077
|
+
for (const item of result.flat()) {
|
|
52078
|
+
if (item instanceof _ast_nodes_YamlNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]) return item;
|
|
52079
|
+
}
|
|
52080
|
+
}
|
|
52081
|
+
return null;
|
|
52082
|
+
};
|
|
51766
52083
|
// Helper to process key-value pair children
|
|
51767
52084
|
const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
51768
52085
|
let key = null;
|
|
51769
52086
|
let value = null;
|
|
51770
52087
|
const errors = [];
|
|
52088
|
+
const commentsBetweenKeyValue = [];
|
|
52089
|
+
const commentsAfterValue = [];
|
|
51771
52090
|
let siblings = {};
|
|
52091
|
+
let seenKey = false;
|
|
52092
|
+
let seenValue = false;
|
|
51772
52093
|
if (cursor.gotoFirstChild()) {
|
|
51773
52094
|
do {
|
|
51774
52095
|
const info = getCursorInfo(cursor);
|
|
@@ -51783,12 +52104,25 @@ const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
|
51783
52104
|
siblings.anchor = info;
|
|
51784
52105
|
continue;
|
|
51785
52106
|
}
|
|
52107
|
+
|
|
52108
|
+
// collect comment nodes (extras placed by tree-sitter between key/value)
|
|
52109
|
+
if (info.type === 'comment') {
|
|
52110
|
+
const commentText = stripCommentHash(info.text);
|
|
52111
|
+
if (seenValue) {
|
|
52112
|
+
commentsAfterValue.push(commentText);
|
|
52113
|
+
} else if (seenKey) {
|
|
52114
|
+
commentsBetweenKeyValue.push(commentText);
|
|
52115
|
+
}
|
|
52116
|
+
continue;
|
|
52117
|
+
}
|
|
51786
52118
|
if (fieldName === 'key') {
|
|
51787
52119
|
key = transform(cursor, ctx, transformerMap, siblings);
|
|
51788
52120
|
siblings = {};
|
|
52121
|
+
seenKey = true;
|
|
51789
52122
|
} else if (fieldName === 'value') {
|
|
51790
52123
|
value = transform(cursor, ctx, transformerMap, siblings);
|
|
51791
52124
|
siblings = {};
|
|
52125
|
+
seenValue = true;
|
|
51792
52126
|
} else if (info.type === 'ERROR') {
|
|
51793
52127
|
const errorResult = transform(cursor, ctx, transformerMap, siblings);
|
|
51794
52128
|
if (errorResult !== null) {
|
|
@@ -51801,7 +52135,9 @@ const processKeyValuePairChildren = (cursor, ctx, transformerMap) => {
|
|
|
51801
52135
|
return {
|
|
51802
52136
|
key,
|
|
51803
52137
|
value,
|
|
51804
|
-
errors
|
|
52138
|
+
errors,
|
|
52139
|
+
commentsBetweenKeyValue,
|
|
52140
|
+
commentsAfterValue
|
|
51805
52141
|
};
|
|
51806
52142
|
};
|
|
51807
52143
|
const transform = (cursor, ctx, transformerMap, siblings = {}) => {
|
|
@@ -51830,7 +52166,7 @@ const createTransformers = transformerMap => ({
|
|
|
51830
52166
|
stream(cursor, ctx) {
|
|
51831
52167
|
const info = getCursorInfo(cursor);
|
|
51832
52168
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
51833
|
-
const stream = new
|
|
52169
|
+
const stream = new _ast_nodes_YamlStream_mjs__WEBPACK_IMPORTED_MODULE_13__["default"]({
|
|
51834
52170
|
children: children.filter(c => c !== null),
|
|
51835
52171
|
...toPositionProps(info),
|
|
51836
52172
|
isMissing: info.isMissing
|
|
@@ -51853,7 +52189,7 @@ const createTransformers = transformerMap => ({
|
|
|
51853
52189
|
} while (cursor.gotoNextSibling());
|
|
51854
52190
|
cursor.gotoParent();
|
|
51855
52191
|
}
|
|
51856
|
-
return new
|
|
52192
|
+
return new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
51857
52193
|
...toPositionProps(info),
|
|
51858
52194
|
name: '%YAML',
|
|
51859
52195
|
parameters: {
|
|
@@ -51872,7 +52208,7 @@ const createTransformers = transformerMap => ({
|
|
|
51872
52208
|
} while (cursor.gotoNextSibling());
|
|
51873
52209
|
cursor.gotoParent();
|
|
51874
52210
|
}
|
|
51875
|
-
const tagDirective = new
|
|
52211
|
+
const tagDirective = new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
51876
52212
|
...toPositionProps(info),
|
|
51877
52213
|
name: '%TAG',
|
|
51878
52214
|
parameters: {
|
|
@@ -51894,7 +52230,7 @@ const createTransformers = transformerMap => ({
|
|
|
51894
52230
|
} while (cursor.gotoNextSibling());
|
|
51895
52231
|
cursor.gotoParent();
|
|
51896
52232
|
}
|
|
51897
|
-
return new
|
|
52233
|
+
return new _ast_nodes_YamlDirective_mjs__WEBPACK_IMPORTED_MODULE_7__["default"]({
|
|
51898
52234
|
...toPositionProps(info),
|
|
51899
52235
|
name: children[0],
|
|
51900
52236
|
parameters: {
|
|
@@ -51906,7 +52242,7 @@ const createTransformers = transformerMap => ({
|
|
|
51906
52242
|
document(cursor, ctx) {
|
|
51907
52243
|
const info = getCursorInfo(cursor);
|
|
51908
52244
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
51909
|
-
return new
|
|
52245
|
+
return new _ast_nodes_YamlDocument_mjs__WEBPACK_IMPORTED_MODULE_8__["default"]({
|
|
51910
52246
|
children: children.flat().filter(c => c !== null),
|
|
51911
52247
|
...toPositionProps(info),
|
|
51912
52248
|
isMissing: info.isMissing
|
|
@@ -51938,7 +52274,7 @@ const createTransformers = transformerMap => ({
|
|
|
51938
52274
|
|
|
51939
52275
|
// No kind node - create empty scalar
|
|
51940
52276
|
if (lastChildInfo) {
|
|
51941
|
-
const emptyScalarNode = new
|
|
52277
|
+
const emptyScalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
51942
52278
|
content: '',
|
|
51943
52279
|
anchor: siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined,
|
|
51944
52280
|
tag: toYamlTag(lastChildInfo, siblings.tag),
|
|
@@ -51948,8 +52284,8 @@ const createTransformers = transformerMap => ({
|
|
|
51948
52284
|
endLine: lastChildInfo.endPosition.row,
|
|
51949
52285
|
endCharacter: lastChildInfo.endPosition.column,
|
|
51950
52286
|
endOffset: lastChildInfo.endIndex,
|
|
51951
|
-
styleGroup:
|
|
51952
|
-
style:
|
|
52287
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52288
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
51953
52289
|
});
|
|
51954
52290
|
registerAnchor(emptyScalarNode, ctx);
|
|
51955
52291
|
return emptyScalarNode;
|
|
@@ -51961,13 +52297,13 @@ const createTransformers = transformerMap => ({
|
|
|
51961
52297
|
const tag = toYamlTag(info, siblings.tag);
|
|
51962
52298
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
51963
52299
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
51964
|
-
const mappingNode = new
|
|
52300
|
+
const mappingNode = new _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]({
|
|
51965
52301
|
children: children.filter(c => c !== null),
|
|
51966
52302
|
...toPositionProps(info),
|
|
51967
52303
|
anchor,
|
|
51968
52304
|
tag,
|
|
51969
|
-
styleGroup:
|
|
51970
|
-
style:
|
|
52305
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
52306
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.NextLine,
|
|
51971
52307
|
isMissing: info.isMissing
|
|
51972
52308
|
});
|
|
51973
52309
|
registerAnchor(mappingNode, ctx);
|
|
@@ -51978,13 +52314,15 @@ const createTransformers = transformerMap => ({
|
|
|
51978
52314
|
const {
|
|
51979
52315
|
key,
|
|
51980
52316
|
value,
|
|
51981
|
-
errors
|
|
52317
|
+
errors,
|
|
52318
|
+
commentsBetweenKeyValue,
|
|
52319
|
+
commentsAfterValue
|
|
51982
52320
|
} = processKeyValuePairChildren(cursor, ctx, transformerMap);
|
|
51983
52321
|
const children = [];
|
|
51984
52322
|
|
|
51985
52323
|
// Handle empty key
|
|
51986
52324
|
if (key === null) {
|
|
51987
|
-
const emptyKey = new
|
|
52325
|
+
const emptyKey = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
51988
52326
|
content: '',
|
|
51989
52327
|
startLine: info.startPosition.row,
|
|
51990
52328
|
startCharacter: info.startPosition.column,
|
|
@@ -51992,12 +52330,12 @@ const createTransformers = transformerMap => ({
|
|
|
51992
52330
|
endLine: info.startPosition.row,
|
|
51993
52331
|
endCharacter: info.startPosition.column,
|
|
51994
52332
|
endOffset: info.startIndex,
|
|
51995
|
-
tag: new
|
|
52333
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
51996
52334
|
explicitName: '?',
|
|
51997
|
-
kind:
|
|
52335
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
51998
52336
|
}),
|
|
51999
|
-
styleGroup:
|
|
52000
|
-
style:
|
|
52337
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52338
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52001
52339
|
});
|
|
52002
52340
|
children.push(emptyKey);
|
|
52003
52341
|
} else {
|
|
@@ -52006,7 +52344,7 @@ const createTransformers = transformerMap => ({
|
|
|
52006
52344
|
|
|
52007
52345
|
// Handle empty value
|
|
52008
52346
|
if (value === null) {
|
|
52009
|
-
const emptyValue = new
|
|
52347
|
+
const emptyValue = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52010
52348
|
content: '',
|
|
52011
52349
|
startLine: info.endPosition.row,
|
|
52012
52350
|
startCharacter: info.endPosition.column,
|
|
@@ -52014,22 +52352,37 @@ const createTransformers = transformerMap => ({
|
|
|
52014
52352
|
endLine: info.endPosition.row,
|
|
52015
52353
|
endCharacter: info.endPosition.column,
|
|
52016
52354
|
endOffset: info.endIndex,
|
|
52017
|
-
tag: new
|
|
52355
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
52018
52356
|
explicitName: '?',
|
|
52019
|
-
kind:
|
|
52357
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
52020
52358
|
}),
|
|
52021
|
-
styleGroup:
|
|
52022
|
-
style:
|
|
52359
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52360
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52023
52361
|
});
|
|
52024
52362
|
children.push(emptyValue);
|
|
52025
52363
|
} else {
|
|
52026
52364
|
children.push(value);
|
|
52027
52365
|
}
|
|
52366
|
+
|
|
52367
|
+
// attach comments found between key and value to the value node
|
|
52368
|
+
if (commentsBetweenKeyValue.length > 0) {
|
|
52369
|
+
const valueNode = findYamlNode(value);
|
|
52370
|
+
if (valueNode) {
|
|
52371
|
+
valueNode.commentBefore = commentsBetweenKeyValue.join('\n');
|
|
52372
|
+
}
|
|
52373
|
+
}
|
|
52374
|
+
// attach comments found after value to the value node
|
|
52375
|
+
if (commentsAfterValue.length > 0) {
|
|
52376
|
+
const valueNode = findYamlNode(value);
|
|
52377
|
+
if (valueNode) {
|
|
52378
|
+
valueNode.comment = commentsAfterValue.join('\n');
|
|
52379
|
+
}
|
|
52380
|
+
}
|
|
52028
52381
|
children.push(...errors);
|
|
52029
|
-
return new
|
|
52382
|
+
return new _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
52030
52383
|
children: children.flat().filter(c => c !== null),
|
|
52031
52384
|
...toPositionProps(info),
|
|
52032
|
-
styleGroup:
|
|
52385
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
52033
52386
|
isMissing: info.isMissing
|
|
52034
52387
|
});
|
|
52035
52388
|
},
|
|
@@ -52038,13 +52391,13 @@ const createTransformers = transformerMap => ({
|
|
|
52038
52391
|
const tag = toYamlTag(info, siblings.tag);
|
|
52039
52392
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52040
52393
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
52041
|
-
const mappingNode = new
|
|
52394
|
+
const mappingNode = new _ast_nodes_YamlMapping_mjs__WEBPACK_IMPORTED_MODULE_10__["default"]({
|
|
52042
52395
|
children: children.flat().filter(c => c !== null),
|
|
52043
52396
|
...toPositionProps(info),
|
|
52044
52397
|
anchor,
|
|
52045
52398
|
tag,
|
|
52046
|
-
styleGroup:
|
|
52047
|
-
style:
|
|
52399
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52400
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Explicit,
|
|
52048
52401
|
isMissing: info.isMissing
|
|
52049
52402
|
});
|
|
52050
52403
|
registerAnchor(mappingNode, ctx);
|
|
@@ -52055,13 +52408,15 @@ const createTransformers = transformerMap => ({
|
|
|
52055
52408
|
const {
|
|
52056
52409
|
key,
|
|
52057
52410
|
value,
|
|
52058
|
-
errors
|
|
52411
|
+
errors,
|
|
52412
|
+
commentsBetweenKeyValue,
|
|
52413
|
+
commentsAfterValue
|
|
52059
52414
|
} = processKeyValuePairChildren(cursor, ctx, transformerMap);
|
|
52060
52415
|
const children = [];
|
|
52061
52416
|
|
|
52062
52417
|
// Handle empty key
|
|
52063
52418
|
if (key === null) {
|
|
52064
|
-
const emptyKey = new
|
|
52419
|
+
const emptyKey = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52065
52420
|
content: '',
|
|
52066
52421
|
startLine: info.startPosition.row,
|
|
52067
52422
|
startCharacter: info.startPosition.column,
|
|
@@ -52069,12 +52424,12 @@ const createTransformers = transformerMap => ({
|
|
|
52069
52424
|
endLine: info.startPosition.row,
|
|
52070
52425
|
endCharacter: info.startPosition.column,
|
|
52071
52426
|
endOffset: info.startIndex,
|
|
52072
|
-
tag: new
|
|
52427
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
52073
52428
|
explicitName: '?',
|
|
52074
|
-
kind:
|
|
52429
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
52075
52430
|
}),
|
|
52076
|
-
styleGroup:
|
|
52077
|
-
style:
|
|
52431
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52432
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52078
52433
|
});
|
|
52079
52434
|
children.push(emptyKey);
|
|
52080
52435
|
} else {
|
|
@@ -52083,7 +52438,7 @@ const createTransformers = transformerMap => ({
|
|
|
52083
52438
|
|
|
52084
52439
|
// Handle empty value
|
|
52085
52440
|
if (value === null) {
|
|
52086
|
-
const emptyValue = new
|
|
52441
|
+
const emptyValue = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52087
52442
|
content: '',
|
|
52088
52443
|
startLine: info.endPosition.row,
|
|
52089
52444
|
startCharacter: info.endPosition.column,
|
|
@@ -52091,22 +52446,37 @@ const createTransformers = transformerMap => ({
|
|
|
52091
52446
|
endLine: info.endPosition.row,
|
|
52092
52447
|
endCharacter: info.endPosition.column,
|
|
52093
52448
|
endOffset: info.endIndex,
|
|
52094
|
-
tag: new
|
|
52449
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
52095
52450
|
explicitName: '?',
|
|
52096
|
-
kind:
|
|
52451
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
52097
52452
|
}),
|
|
52098
|
-
styleGroup:
|
|
52099
|
-
style:
|
|
52453
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52454
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52100
52455
|
});
|
|
52101
52456
|
children.push(emptyValue);
|
|
52102
52457
|
} else {
|
|
52103
52458
|
children.push(value);
|
|
52104
52459
|
}
|
|
52460
|
+
|
|
52461
|
+
// attach comments found between key and value to the value node
|
|
52462
|
+
if (commentsBetweenKeyValue.length > 0) {
|
|
52463
|
+
const valueNode = findYamlNode(value);
|
|
52464
|
+
if (valueNode) {
|
|
52465
|
+
valueNode.commentBefore = commentsBetweenKeyValue.join('\n');
|
|
52466
|
+
}
|
|
52467
|
+
}
|
|
52468
|
+
// attach comments found after value to the value node
|
|
52469
|
+
if (commentsAfterValue.length > 0) {
|
|
52470
|
+
const valueNode = findYamlNode(value);
|
|
52471
|
+
if (valueNode) {
|
|
52472
|
+
valueNode.comment = commentsAfterValue.join('\n');
|
|
52473
|
+
}
|
|
52474
|
+
}
|
|
52105
52475
|
children.push(...errors);
|
|
52106
|
-
return new
|
|
52476
|
+
return new _ast_nodes_YamlKeyValuePair_mjs__WEBPACK_IMPORTED_MODULE_9__["default"]({
|
|
52107
52477
|
children: children.flat().filter(c => c !== null),
|
|
52108
52478
|
...toPositionProps(info),
|
|
52109
|
-
styleGroup:
|
|
52479
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52110
52480
|
isMissing: info.isMissing
|
|
52111
52481
|
});
|
|
52112
52482
|
},
|
|
@@ -52115,13 +52485,13 @@ const createTransformers = transformerMap => ({
|
|
|
52115
52485
|
const tag = toYamlTag(info, siblings.tag);
|
|
52116
52486
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52117
52487
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
52118
|
-
const sequenceNode = new
|
|
52488
|
+
const sequenceNode = new _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
52119
52489
|
children: children.flat(Infinity).filter(c => c !== null),
|
|
52120
52490
|
...toPositionProps(info),
|
|
52121
52491
|
anchor,
|
|
52122
52492
|
tag,
|
|
52123
|
-
styleGroup:
|
|
52124
|
-
style:
|
|
52493
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
52494
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.NextLine
|
|
52125
52495
|
});
|
|
52126
52496
|
registerAnchor(sequenceNode, ctx);
|
|
52127
52497
|
return ctx.schema.resolve(sequenceNode);
|
|
@@ -52132,11 +52502,11 @@ const createTransformers = transformerMap => ({
|
|
|
52132
52502
|
|
|
52133
52503
|
// If only one child (the "-" literal), create empty node
|
|
52134
52504
|
if (children.length === 0) {
|
|
52135
|
-
const emptyScalarNode = new
|
|
52505
|
+
const emptyScalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52136
52506
|
content: '',
|
|
52137
|
-
tag: new
|
|
52507
|
+
tag: new _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__["default"]({
|
|
52138
52508
|
explicitName: '?',
|
|
52139
|
-
kind:
|
|
52509
|
+
kind: _ast_nodes_YamlTag_mjs__WEBPACK_IMPORTED_MODULE_14__.YamlNodeKind.Scalar
|
|
52140
52510
|
}),
|
|
52141
52511
|
startLine: info.endPosition.row,
|
|
52142
52512
|
startCharacter: info.endPosition.column,
|
|
@@ -52144,8 +52514,8 @@ const createTransformers = transformerMap => ({
|
|
|
52144
52514
|
endLine: info.endPosition.row,
|
|
52145
52515
|
endCharacter: info.endPosition.column,
|
|
52146
52516
|
endOffset: info.endIndex,
|
|
52147
|
-
styleGroup:
|
|
52148
|
-
style:
|
|
52517
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52518
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52149
52519
|
});
|
|
52150
52520
|
return [emptyScalarNode];
|
|
52151
52521
|
}
|
|
@@ -52156,13 +52526,13 @@ const createTransformers = transformerMap => ({
|
|
|
52156
52526
|
const tag = toYamlTag(info, siblings.tag);
|
|
52157
52527
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52158
52528
|
const children = processChildren(cursor, ctx, transformerMap);
|
|
52159
|
-
const sequenceNode = new
|
|
52529
|
+
const sequenceNode = new _ast_nodes_YamlSequence_mjs__WEBPACK_IMPORTED_MODULE_12__["default"]({
|
|
52160
52530
|
children: children.flat().filter(c => c !== null),
|
|
52161
52531
|
...toPositionProps(info),
|
|
52162
52532
|
anchor,
|
|
52163
52533
|
tag,
|
|
52164
|
-
styleGroup:
|
|
52165
|
-
style:
|
|
52534
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52535
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Explicit
|
|
52166
52536
|
});
|
|
52167
52537
|
registerAnchor(sequenceNode, ctx);
|
|
52168
52538
|
return ctx.schema.resolve(sequenceNode);
|
|
@@ -52171,14 +52541,15 @@ const createTransformers = transformerMap => ({
|
|
|
52171
52541
|
const info = getCursorInfo(cursor);
|
|
52172
52542
|
const tag = toYamlTag(info, siblings.tag);
|
|
52173
52543
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52174
|
-
const scalarNode = new
|
|
52544
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52175
52545
|
content: info.text,
|
|
52176
52546
|
anchor,
|
|
52177
52547
|
tag,
|
|
52178
52548
|
...toPositionProps(info),
|
|
52179
|
-
styleGroup:
|
|
52180
|
-
style:
|
|
52549
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52550
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain
|
|
52181
52551
|
});
|
|
52552
|
+
scalarNode.rawContent = info.text;
|
|
52182
52553
|
registerAnchor(scalarNode, ctx);
|
|
52183
52554
|
return ctx.schema.resolve(scalarNode);
|
|
52184
52555
|
},
|
|
@@ -52186,14 +52557,15 @@ const createTransformers = transformerMap => ({
|
|
|
52186
52557
|
const info = getCursorInfo(cursor);
|
|
52187
52558
|
const tag = toYamlTag(info, siblings.tag);
|
|
52188
52559
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52189
|
-
const scalarNode = new
|
|
52560
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52190
52561
|
content: info.text,
|
|
52191
52562
|
anchor,
|
|
52192
52563
|
tag,
|
|
52193
52564
|
...toPositionProps(info),
|
|
52194
|
-
styleGroup:
|
|
52195
|
-
style:
|
|
52565
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52566
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.SingleQuoted
|
|
52196
52567
|
});
|
|
52568
|
+
scalarNode.rawContent = info.text;
|
|
52197
52569
|
registerAnchor(scalarNode, ctx);
|
|
52198
52570
|
return ctx.schema.resolve(scalarNode);
|
|
52199
52571
|
},
|
|
@@ -52201,14 +52573,15 @@ const createTransformers = transformerMap => ({
|
|
|
52201
52573
|
const info = getCursorInfo(cursor);
|
|
52202
52574
|
const tag = toYamlTag(info, siblings.tag);
|
|
52203
52575
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52204
|
-
const scalarNode = new
|
|
52576
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52205
52577
|
content: info.text,
|
|
52206
52578
|
anchor,
|
|
52207
52579
|
tag,
|
|
52208
52580
|
...toPositionProps(info),
|
|
52209
|
-
styleGroup:
|
|
52210
|
-
style:
|
|
52581
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Flow,
|
|
52582
|
+
style: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.DoubleQuoted
|
|
52211
52583
|
});
|
|
52584
|
+
scalarNode.rawContent = info.text;
|
|
52212
52585
|
registerAnchor(scalarNode, ctx);
|
|
52213
52586
|
return ctx.schema.resolve(scalarNode);
|
|
52214
52587
|
},
|
|
@@ -52216,27 +52589,29 @@ const createTransformers = transformerMap => ({
|
|
|
52216
52589
|
const info = getCursorInfo(cursor);
|
|
52217
52590
|
const tag = toYamlTag(info, siblings.tag);
|
|
52218
52591
|
const anchor = siblings.anchor ? toYamlAnchor(siblings.anchor) : undefined;
|
|
52219
|
-
const style = info.text.startsWith('|') ?
|
|
52220
|
-
const scalarNode = new
|
|
52592
|
+
const style = info.text.startsWith('|') ? _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Literal : info.text.startsWith('>') ? _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Folded : _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyle.Plain;
|
|
52593
|
+
const scalarNode = new _ast_nodes_YamlScalar_mjs__WEBPACK_IMPORTED_MODULE_11__["default"]({
|
|
52221
52594
|
content: info.text,
|
|
52222
52595
|
anchor,
|
|
52223
52596
|
tag,
|
|
52224
52597
|
...toPositionProps(info),
|
|
52225
|
-
styleGroup:
|
|
52598
|
+
styleGroup: _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_15__.YamlStyleGroup.Block,
|
|
52226
52599
|
style
|
|
52227
52600
|
});
|
|
52601
|
+
scalarNode.rawContent = info.text;
|
|
52228
52602
|
registerAnchor(scalarNode, ctx);
|
|
52229
52603
|
return ctx.schema.resolve(scalarNode);
|
|
52230
52604
|
},
|
|
52231
52605
|
comment(cursor) {
|
|
52232
52606
|
const info = getCursorInfo(cursor);
|
|
52233
|
-
return new
|
|
52234
|
-
content: info.text
|
|
52607
|
+
return new _ast_nodes_YamlComment_mjs__WEBPACK_IMPORTED_MODULE_6__["default"]({
|
|
52608
|
+
content: info.text,
|
|
52609
|
+
...toPositionProps(info)
|
|
52235
52610
|
});
|
|
52236
52611
|
},
|
|
52237
52612
|
alias(cursor, ctx) {
|
|
52238
52613
|
const info = getCursorInfo(cursor);
|
|
52239
|
-
const alias = new
|
|
52614
|
+
const alias = new _ast_nodes_YamlAlias_mjs__WEBPACK_IMPORTED_MODULE_4__["default"]({
|
|
52240
52615
|
content: info.text
|
|
52241
52616
|
});
|
|
52242
52617
|
return ctx.referenceManager.resolveAlias(alias);
|
|
@@ -52318,6 +52693,147 @@ const maybeAddSourceMap = (node, element, ctx) => {
|
|
|
52318
52693
|
_speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_8__["default"].transfer(node, element);
|
|
52319
52694
|
};
|
|
52320
52695
|
|
|
52696
|
+
// find the first descendant matching a type path through the AST
|
|
52697
|
+
const findFirst = (node, path) => {
|
|
52698
|
+
if (path.length === 0) return node;
|
|
52699
|
+
const [type, ...rest] = path;
|
|
52700
|
+
for (const child of node.children || []) {
|
|
52701
|
+
if (child.type !== type) continue;
|
|
52702
|
+
const found = findFirst(child, rest);
|
|
52703
|
+
if (found) return found;
|
|
52704
|
+
}
|
|
52705
|
+
return undefined;
|
|
52706
|
+
};
|
|
52707
|
+
|
|
52708
|
+
// detect indent from first nested block mapping (stream > document > mapping > keyValuePair > mapping)
|
|
52709
|
+
const detectIndent = node => {
|
|
52710
|
+
const nested = findFirst(node, ['document', 'mapping', 'keyValuePair', 'mapping']);
|
|
52711
|
+
if (nested?.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_9__.YamlStyleGroup.Block && typeof nested.startCharacter === 'number' && nested.startCharacter > 0) {
|
|
52712
|
+
return nested.startCharacter;
|
|
52713
|
+
}
|
|
52714
|
+
return 2;
|
|
52715
|
+
};
|
|
52716
|
+
|
|
52717
|
+
// strip leading '#' from each line of comment text; yaml library adds '#' during stringification
|
|
52718
|
+
const stripCommentHash = text => text.split('\n').map(line => line.replace(/^#/, '')).join('\n');
|
|
52719
|
+
|
|
52720
|
+
// collect comment texts from raw AST children, indexed by position relative to non-comment siblings
|
|
52721
|
+
|
|
52722
|
+
// is the comment on the same line as the previous non-comment sibling?
|
|
52723
|
+
const isInlineComment = (child, lastEndLine, pending) => {
|
|
52724
|
+
return pending.length === 0 && lastEndLine !== undefined && child.startLine === lastEndLine;
|
|
52725
|
+
};
|
|
52726
|
+
|
|
52727
|
+
/**
|
|
52728
|
+
* @param children - raw AST children of a mapping/sequence
|
|
52729
|
+
* @param containerStartCol - the start column of the container node;
|
|
52730
|
+
* trailing comments whose startCharacter is less than this are out-of-scope
|
|
52731
|
+
* (tree-sitter may place them inside a nested block they don't belong to)
|
|
52732
|
+
*/
|
|
52733
|
+
const collectComments = (children, containerStartCol) => {
|
|
52734
|
+
const before = new Map();
|
|
52735
|
+
const after = new Map();
|
|
52736
|
+
const pending = [];
|
|
52737
|
+
let lastNonCommentEndLine;
|
|
52738
|
+
let elementIdx = 0;
|
|
52739
|
+
for (const child of children) {
|
|
52740
|
+
if (child?.type === 'comment') {
|
|
52741
|
+
const text = stripCommentHash(child.content || '');
|
|
52742
|
+
if (elementIdx > 0 && isInlineComment(child, lastNonCommentEndLine, pending)) {
|
|
52743
|
+
after.set(elementIdx - 1, text);
|
|
52744
|
+
} else {
|
|
52745
|
+
pending.push({
|
|
52746
|
+
text,
|
|
52747
|
+
startLine: child.startLine,
|
|
52748
|
+
startCharacter: child.startCharacter
|
|
52749
|
+
});
|
|
52750
|
+
}
|
|
52751
|
+
continue;
|
|
52752
|
+
}
|
|
52753
|
+
|
|
52754
|
+
// non-comment node: attach any pending comments as commentBefore
|
|
52755
|
+
if (pending.length > 0) {
|
|
52756
|
+
before.set(elementIdx, pending.map(c => c.text).join('\n'));
|
|
52757
|
+
pending.length = 0;
|
|
52758
|
+
}
|
|
52759
|
+
lastNonCommentEndLine = child.endLine;
|
|
52760
|
+
elementIdx++;
|
|
52761
|
+
}
|
|
52762
|
+
|
|
52763
|
+
// remaining pending comments are trailing — split into in-scope and out-of-scope
|
|
52764
|
+
let trailing = null;
|
|
52765
|
+
const outOfScope = [];
|
|
52766
|
+
for (const c of pending) {
|
|
52767
|
+
if (containerStartCol !== undefined && c.startCharacter !== undefined && c.startCharacter < containerStartCol) {
|
|
52768
|
+
outOfScope.push(c.text);
|
|
52769
|
+
} else {
|
|
52770
|
+
trailing = trailing ? `${trailing}\n${c.text}` : c.text;
|
|
52771
|
+
}
|
|
52772
|
+
}
|
|
52773
|
+
return {
|
|
52774
|
+
before,
|
|
52775
|
+
after,
|
|
52776
|
+
trailing,
|
|
52777
|
+
outOfScope
|
|
52778
|
+
};
|
|
52779
|
+
};
|
|
52780
|
+
|
|
52781
|
+
// set a yaml style property on an element, initializing style.yaml if needed
|
|
52782
|
+
const setYamlStyleProp = (element, key, value) => {
|
|
52783
|
+
if (!element.style) element.style = {};
|
|
52784
|
+
const yaml = element.style.yaml ?? {};
|
|
52785
|
+
yaml[key] = value;
|
|
52786
|
+
element.style.yaml = yaml;
|
|
52787
|
+
};
|
|
52788
|
+
|
|
52789
|
+
// apply collected comments to transformed ApiDOM elements
|
|
52790
|
+
const applyComments = (elements, comments) => {
|
|
52791
|
+
comments.before.forEach((text, idx) => {
|
|
52792
|
+
if (elements[idx]) setYamlStyleProp(elements[idx], 'commentBefore', text);
|
|
52793
|
+
});
|
|
52794
|
+
comments.after.forEach((text, idx) => {
|
|
52795
|
+
if (elements[idx]) setYamlStyleProp(elements[idx], 'comment', text);
|
|
52796
|
+
});
|
|
52797
|
+
};
|
|
52798
|
+
|
|
52799
|
+
// detect flow collection padding from node positions
|
|
52800
|
+
// gap of 1 between container start and first child start → no padding: [x
|
|
52801
|
+
// gap of 2+ → padding: [ x
|
|
52802
|
+
// gap of 1 between container start and first child start → no padding: {x
|
|
52803
|
+
// gap of 2+ → padding: { x
|
|
52804
|
+
const detectFlowPadding = node => {
|
|
52805
|
+
const firstChild = (node.children || [])[0];
|
|
52806
|
+
if (firstChild && typeof node.startCharacter === 'number' && typeof firstChild.startCharacter === 'number') {
|
|
52807
|
+
return firstChild.startCharacter - node.startCharacter > 1;
|
|
52808
|
+
}
|
|
52809
|
+
return true;
|
|
52810
|
+
};
|
|
52811
|
+
|
|
52812
|
+
// build yaml style object for an element
|
|
52813
|
+
const buildYamlStyle = (node, ctx, extras) => {
|
|
52814
|
+
const yamlStyle = {
|
|
52815
|
+
styleGroup: node.styleGroup,
|
|
52816
|
+
indent: ctx.indent
|
|
52817
|
+
};
|
|
52818
|
+
if (ctx.flowCollectionPadding !== null) {
|
|
52819
|
+
yamlStyle.flowCollectionPadding = ctx.flowCollectionPadding;
|
|
52820
|
+
}
|
|
52821
|
+
if (node.comment) {
|
|
52822
|
+
yamlStyle.comment = node.comment;
|
|
52823
|
+
}
|
|
52824
|
+
if (node.commentBefore) {
|
|
52825
|
+
yamlStyle.commentBefore = node.commentBefore;
|
|
52826
|
+
}
|
|
52827
|
+
if (extras) {
|
|
52828
|
+
for (const [key, value] of Object.entries(extras)) {
|
|
52829
|
+
if (value !== undefined) yamlStyle[key] = value;
|
|
52830
|
+
}
|
|
52831
|
+
}
|
|
52832
|
+
return {
|
|
52833
|
+
yaml: yamlStyle
|
|
52834
|
+
};
|
|
52835
|
+
};
|
|
52836
|
+
|
|
52321
52837
|
// Transform a single node based on its type
|
|
52322
52838
|
const transform = (node, ctx) => {
|
|
52323
52839
|
if (node === null || node === undefined) {
|
|
@@ -52353,22 +52869,58 @@ const transform = (node, ctx) => {
|
|
|
52353
52869
|
// Transform children array and flatten results
|
|
52354
52870
|
const transformChildren = (children, ctx) => {
|
|
52355
52871
|
const results = [];
|
|
52872
|
+
let pendingPromoted = [];
|
|
52356
52873
|
for (const child of children) {
|
|
52357
52874
|
const result = transform(child, ctx);
|
|
52358
52875
|
if (result === null) {
|
|
52876
|
+
// collect any promoted comments generated during this null transform
|
|
52877
|
+
if (ctx.style && ctx.promotedComments.length > 0) {
|
|
52878
|
+
pendingPromoted.push(...ctx.promotedComments);
|
|
52879
|
+
ctx.promotedComments = [];
|
|
52880
|
+
}
|
|
52359
52881
|
continue;
|
|
52360
52882
|
}
|
|
52883
|
+
|
|
52884
|
+
// apply promoted comments from PREVIOUS children as commentBefore on this element
|
|
52885
|
+
if (ctx.style && pendingPromoted.length > 0) {
|
|
52886
|
+
const target = Array.isArray(result) ? result[0] : result;
|
|
52887
|
+
if (target) {
|
|
52888
|
+
if (!target.style) target.style = {};
|
|
52889
|
+
const yaml = target.style.yaml ?? {};
|
|
52890
|
+
const existing = yaml.commentBefore;
|
|
52891
|
+
const promoted = pendingPromoted.join('\n');
|
|
52892
|
+
yaml.commentBefore = existing ? `${promoted}\n${existing}` : promoted;
|
|
52893
|
+
target.style.yaml = yaml;
|
|
52894
|
+
}
|
|
52895
|
+
pendingPromoted = [];
|
|
52896
|
+
}
|
|
52897
|
+
|
|
52898
|
+
// collect any promoted comments generated by this child's transform
|
|
52899
|
+
// (these will be applied to the NEXT sibling)
|
|
52900
|
+
if (ctx.style && ctx.promotedComments.length > 0) {
|
|
52901
|
+
pendingPromoted.push(...ctx.promotedComments);
|
|
52902
|
+
ctx.promotedComments = [];
|
|
52903
|
+
}
|
|
52361
52904
|
if (Array.isArray(result)) {
|
|
52362
52905
|
results.push(...result);
|
|
52363
52906
|
} else {
|
|
52364
52907
|
results.push(result);
|
|
52365
52908
|
}
|
|
52366
52909
|
}
|
|
52910
|
+
|
|
52911
|
+
// if promoted comments remain after all children, propagate up to parent scope
|
|
52912
|
+
if (pendingPromoted.length > 0) {
|
|
52913
|
+
ctx.promotedComments.push(...pendingPromoted);
|
|
52914
|
+
}
|
|
52367
52915
|
return results;
|
|
52368
52916
|
};
|
|
52369
52917
|
|
|
52370
52918
|
// Stream: Wraps transformed children in ParseResultElement
|
|
52371
52919
|
const transformStream = (node, ctx) => {
|
|
52920
|
+
// detect indent from the stream structure (only needed for style preservation)
|
|
52921
|
+
if (ctx.style) {
|
|
52922
|
+
ctx.indent = detectIndent(node);
|
|
52923
|
+
}
|
|
52372
52924
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_7__["default"]();
|
|
52373
52925
|
|
|
52374
52926
|
// Transform all children
|
|
@@ -52414,12 +52966,35 @@ const transformDocument = (node, ctx) => {
|
|
|
52414
52966
|
return transformChildren(node.children || [], ctx);
|
|
52415
52967
|
};
|
|
52416
52968
|
|
|
52969
|
+
// shared logic for transformMapping and transformSequence
|
|
52970
|
+
const transformCollection = (element, node, ctx) => {
|
|
52971
|
+
const typedNode = node;
|
|
52972
|
+
const children = node.children || [];
|
|
52973
|
+
if (ctx.style) {
|
|
52974
|
+
if (ctx.flowCollectionPadding === null && node.styleGroup === _ast_nodes_YamlStyle_mjs__WEBPACK_IMPORTED_MODULE_9__.YamlStyleGroup.Flow) {
|
|
52975
|
+
ctx.flowCollectionPadding = detectFlowPadding(typedNode);
|
|
52976
|
+
}
|
|
52977
|
+
const comments = collectComments(children, typedNode.startCharacter);
|
|
52978
|
+
const childElements = transformChildren(children, ctx);
|
|
52979
|
+
// bypass content setter to avoid re-refracting already-transformed elements
|
|
52980
|
+
element._content = childElements; // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
52981
|
+
applyComments(childElements, comments);
|
|
52982
|
+
element.style = buildYamlStyle(node, ctx, {
|
|
52983
|
+
comment: comments.trailing
|
|
52984
|
+
});
|
|
52985
|
+
if (comments.outOfScope.length > 0) {
|
|
52986
|
+
ctx.promotedComments.push(...comments.outOfScope);
|
|
52987
|
+
}
|
|
52988
|
+
} else {
|
|
52989
|
+
element._content = transformChildren(children, ctx); // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
52990
|
+
}
|
|
52991
|
+
maybeAddSourceMap(typedNode, element, ctx);
|
|
52992
|
+
};
|
|
52993
|
+
|
|
52417
52994
|
// Mapping: Transforms to ObjectElement
|
|
52418
52995
|
const transformMapping = (node, ctx) => {
|
|
52419
52996
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_4__["default"]();
|
|
52420
|
-
|
|
52421
|
-
element._content = transformChildren(node.children || [], ctx);
|
|
52422
|
-
maybeAddSourceMap(node, element, ctx);
|
|
52997
|
+
transformCollection(element, node, ctx);
|
|
52423
52998
|
return element;
|
|
52424
52999
|
};
|
|
52425
53000
|
|
|
@@ -52453,9 +53028,7 @@ const transformKeyValuePair = (node, ctx) => {
|
|
|
52453
53028
|
// Sequence: Transforms to ArrayElement
|
|
52454
53029
|
const transformSequence = (node, ctx) => {
|
|
52455
53030
|
const element = new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_2__["default"]();
|
|
52456
|
-
|
|
52457
|
-
element._content = transformChildren(node.children || [], ctx);
|
|
52458
|
-
maybeAddSourceMap(node, element, ctx);
|
|
53031
|
+
transformCollection(element, node, ctx);
|
|
52459
53032
|
return element;
|
|
52460
53033
|
};
|
|
52461
53034
|
|
|
@@ -52468,6 +53041,15 @@ const transformScalar = (node, ctx) => {
|
|
|
52468
53041
|
element.classes.push('yaml-e-node');
|
|
52469
53042
|
element.classes.push('yaml-e-scalar');
|
|
52470
53043
|
}
|
|
53044
|
+
if (ctx.style) {
|
|
53045
|
+
const extras = {
|
|
53046
|
+
scalarStyle: node.style
|
|
53047
|
+
};
|
|
53048
|
+
if (node.rawContent !== undefined) {
|
|
53049
|
+
extras.rawContent = node.rawContent;
|
|
53050
|
+
}
|
|
53051
|
+
element.style = buildYamlStyle(node, ctx, extras);
|
|
53052
|
+
}
|
|
52471
53053
|
maybeAddSourceMap(node, element, ctx);
|
|
52472
53054
|
return element;
|
|
52473
53055
|
};
|
|
@@ -52532,13 +53114,18 @@ const transformRootError = (node, ctx) => {
|
|
|
52532
53114
|
* @public
|
|
52533
53115
|
*/
|
|
52534
53116
|
const transformYamlAstToApiDOM = (yamlAst, {
|
|
52535
|
-
sourceMap = false
|
|
53117
|
+
sourceMap = false,
|
|
53118
|
+
style = false
|
|
52536
53119
|
} = {}) => {
|
|
52537
53120
|
const ctx = {
|
|
52538
53121
|
sourceMap,
|
|
53122
|
+
style,
|
|
52539
53123
|
namespace: new _speclynx_apidom_datamodel__WEBPACK_IMPORTED_MODULE_0__["default"](),
|
|
52540
53124
|
annotations: [],
|
|
52541
|
-
processedDocumentCount: 0
|
|
53125
|
+
processedDocumentCount: 0,
|
|
53126
|
+
indent: 2,
|
|
53127
|
+
flowCollectionPadding: null,
|
|
53128
|
+
promotedComments: []
|
|
52542
53129
|
};
|
|
52543
53130
|
const rootNode = yamlAst.rootNode;
|
|
52544
53131
|
|
|
@@ -53137,6 +53724,8 @@ class YamlNode extends _Node_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
|
53137
53724
|
tag;
|
|
53138
53725
|
style;
|
|
53139
53726
|
styleGroup;
|
|
53727
|
+
comment;
|
|
53728
|
+
commentBefore;
|
|
53140
53729
|
constructor({
|
|
53141
53730
|
anchor,
|
|
53142
53731
|
tag,
|
|
@@ -53176,6 +53765,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53176
53765
|
class YamlScalar extends _YamlNode_mjs__WEBPACK_IMPORTED_MODULE_0__["default"] {
|
|
53177
53766
|
static type = 'scalar';
|
|
53178
53767
|
content;
|
|
53768
|
+
rawContent;
|
|
53179
53769
|
constructor({
|
|
53180
53770
|
content,
|
|
53181
53771
|
...rest
|
|
@@ -53973,7 +54563,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53973
54563
|
* @public
|
|
53974
54564
|
*/
|
|
53975
54565
|
const analyze = (cst, {
|
|
53976
|
-
sourceMap = false
|
|
54566
|
+
sourceMap = false,
|
|
54567
|
+
style = false
|
|
53977
54568
|
} = {}) => {
|
|
53978
54569
|
const cursor = cst.walk();
|
|
53979
54570
|
const schema = new _ast_schemas_json_index_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]();
|
|
@@ -53988,7 +54579,8 @@ const analyze = (cst, {
|
|
|
53988
54579
|
|
|
53989
54580
|
// Pass 2: YAML AST -> ApiDOM (direct transformation)
|
|
53990
54581
|
return (0,_YamlAstTransformer_mjs__WEBPACK_IMPORTED_MODULE_3__.transformYamlAstToApiDOM)(yamlAst, {
|
|
53991
|
-
sourceMap
|
|
54582
|
+
sourceMap,
|
|
54583
|
+
style
|
|
53992
54584
|
});
|
|
53993
54585
|
};
|
|
53994
54586
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (analyze);
|