@swagger-api/apidom-parser-adapter-openapi-json-3-0 0.90.0 → 0.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29230,7 +29230,7 @@ const isNode = element => (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1
29230
29230
  const analyze = (cst, {
29231
29231
  sourceMap = false
29232
29232
  } = {}) => {
29233
- const visitor = (0,_visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_3__["default"])();
29233
+ const visitor = new _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
29234
29234
  const cursor = cst.walk();
29235
29235
  const iterator = new _TreeCursorIterator_mjs__WEBPACK_IMPORTED_MODULE_4__["default"](cursor);
29236
29236
  const [rootNode] = Array.from(iterator);
@@ -29256,175 +29256,161 @@ __webpack_require__.r(__webpack_exports__);
29256
29256
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29257
29257
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
29258
29258
  /* harmony export */ });
29259
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
29260
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48355);
29261
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36903);
29262
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67952);
29259
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48355);
29260
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36903);
29261
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67952);
29263
29262
  /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1288);
29264
29263
 
29265
29264
 
29266
-
29267
29265
  /* eslint-disable no-underscore-dangle */
29268
- const CstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
29269
- props: {
29270
- sourceMap: false,
29271
- annotations: []
29272
- },
29273
- init() {
29274
- /**
29275
- * Private API.
29276
- */
29266
+ class CstVisitor {
29267
+ static toPosition(node) {
29268
+ const start = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement([node.startPosition.row, node.startPosition.column, node.startIndex]);
29269
+ const end = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement([node.endPosition.row, node.endPosition.column, node.endIndex]);
29270
+ start.classes.push('position');
29271
+ end.classes.push('position');
29272
+ return [start, end];
29273
+ }
29274
+ sourceMap = false;
29275
+ ParseResultElement = {
29276
+ leave: element => {
29277
+ // mark first-non Annotation element as result
29278
+ // @ts-ignore
29279
+ const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement);
29280
+ if (elements.length > 0) {
29281
+ const resultElement = elements[0];
29282
+ resultElement.classes.push('result');
29283
+ }
29277
29284
 
29285
+ // provide annotations
29286
+ this.annotations.forEach(annotationElement => {
29287
+ element.push(annotationElement);
29288
+ });
29289
+ this.annotations = [];
29290
+ }
29291
+ };
29292
+ constructor() {
29278
29293
  this.annotations = [];
29279
- const toPosition = node => {
29280
- const start = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement([node.startPosition.row, node.startPosition.column, node.startIndex]);
29281
- const end = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement([node.endPosition.row, node.endPosition.column, node.endIndex]);
29282
- start.classes.push('position');
29283
- end.classes.push('position');
29284
- return [start, end];
29285
- };
29286
- const maybeAddSourceMap = (node, element) => {
29287
- if (!this.sourceMap) {
29288
- return;
29289
- }
29290
- const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.SourceMapElement();
29291
- const position = toPosition(node);
29292
- if (position !== null) {
29293
- const [start, end] = position;
29294
- sourceMap.push(start);
29295
- sourceMap.push(end);
29296
- }
29297
- // @ts-ignore
29298
- sourceMap.astNode = node;
29299
- element.meta.set('sourceMap', sourceMap);
29300
- };
29294
+ }
29295
+ enter(node) {
29296
+ // missing anonymous literals from CST transformed into AnnotationElements.
29297
+ if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed && node.isMissing) {
29298
+ // collect annotations from missing literals
29299
+ const value = node.type || node.text;
29300
+ const message = `(Missing ${value})`;
29301
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.AnnotationElement(message);
29302
+ element.classes.push('warning');
29303
+ this.maybeAddSourceMap(node, element);
29304
+ this.annotations.push(element);
29305
+ }
29306
+ return null; // remove everything unrecognized
29307
+ }
29308
+ document(node) {
29309
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ParseResultElement();
29310
+ // @ts-ignore
29311
+ element._content = node.children;
29312
+ this.maybeAddSourceMap(node, element);
29313
+ return element;
29314
+ }
29315
+ object(node) {
29316
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ObjectElement();
29317
+ // @ts-ignore
29318
+ element._content = node.children;
29319
+ this.maybeAddSourceMap(node, element);
29320
+ return element;
29321
+ }
29322
+ array(node) {
29323
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement();
29324
+ // @ts-ignore
29325
+ element._content = node.children;
29326
+ this.maybeAddSourceMap(node, element);
29327
+ return element;
29328
+ }
29329
+ pair(node) {
29330
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.MemberElement();
29331
+ // @ts-ignore
29332
+ element.content.key = node.keyNode;
29333
+ // @ts-ignore
29334
+ element.content.value = node.valueNode;
29335
+ this.maybeAddSourceMap(node, element);
29301
29336
 
29302
29337
  /**
29303
- * Public API.
29338
+ * Process possible errors here that may be present in pair node children as we're using direct field access.
29339
+ * There are usually 3 children here found: "key", ":", "value".
29304
29340
  */
29341
+ if (node.children.length > 3) {
29342
+ node.children.filter(child => child.type === 'ERROR').forEach(errorNode => {
29343
+ this.ERROR(errorNode, node, [], [node]);
29344
+ });
29345
+ }
29346
+ return element;
29347
+ }
29348
+ string(node) {
29349
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.StringElement(JSON.parse(node.text));
29350
+ this.maybeAddSourceMap(node, element);
29351
+ return element;
29352
+ }
29353
+ number(node) {
29354
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.NumberElement(Number(node.text));
29355
+ this.maybeAddSourceMap(node, element);
29356
+ return element;
29357
+ }
29305
29358
 
29306
- this.enter = function enter(node) {
29307
- // missing anonymous literals from CST transformed into AnnotationElements.
29308
- if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed && node.isMissing) {
29309
- // collect annotations from missing literals
29310
- const value = node.type || node.text;
29311
- const message = `(Missing ${value})`;
29312
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.AnnotationElement(message);
29313
- element.classes.push('warning');
29314
- maybeAddSourceMap(node, element);
29315
- this.annotations.push(element);
29316
- }
29317
- return null; // remove everything unrecognized
29318
- };
29319
- this.document = function document(node) {
29320
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ParseResultElement();
29321
- // @ts-ignore
29322
- element._content = node.children;
29323
- maybeAddSourceMap(node, element);
29324
- return element;
29325
- };
29326
- this.ParseResultElement = {
29327
- leave(element) {
29328
- // mark first-non Annotation element as result
29329
- // @ts-ignore
29330
- const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isPrimitiveElement);
29331
- if (elements.length > 0) {
29332
- const resultElement = elements[0];
29333
- resultElement.classes.push('result');
29334
- }
29335
-
29336
- // provide annotations
29337
- this.annotations.forEach(annotationElement => {
29338
- element.push(annotationElement);
29339
- });
29340
- this.annotations = [];
29341
- }
29342
- };
29343
- this.object = function object(node) {
29344
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ObjectElement();
29345
- // @ts-ignore
29346
- element._content = node.children;
29347
- maybeAddSourceMap(node, element);
29348
- return element;
29349
- };
29350
- this.array = function array(node) {
29351
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement();
29352
- // @ts-ignore
29353
- element._content = node.children;
29354
- maybeAddSourceMap(node, element);
29355
- return element;
29356
- };
29357
- this.pair = function pair(node) {
29358
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.MemberElement();
29359
- // @ts-ignore
29360
- element.content.key = node.keyNode;
29361
- // @ts-ignore
29362
- element.content.value = node.valueNode;
29363
- maybeAddSourceMap(node, element);
29364
-
29365
- /**
29366
- * Process possible errors here that may be present in pair node children as we're using direct field access.
29367
- * There are usually 3 children here found: "key", ":", "value".
29368
- */
29369
- if (node.children.length > 3) {
29370
- node.children.filter(child => child.type === 'ERROR').forEach(errorNode => {
29371
- this.ERROR(errorNode, node, [], [node]);
29372
- });
29373
- }
29374
- return element;
29375
- };
29376
- this.string = function string(node) {
29377
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.StringElement(JSON.parse(node.text));
29378
- maybeAddSourceMap(node, element);
29379
- return element;
29380
- };
29381
- this.number = function number(node) {
29382
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.NumberElement(Number(node.text));
29383
- maybeAddSourceMap(node, element);
29384
- return element;
29385
- };
29386
-
29387
- // eslint-disable-next-line @typescript-eslint/naming-convention
29388
- this.null = function _null(node) {
29389
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.NullElement();
29390
- maybeAddSourceMap(node, element);
29391
- return element;
29392
- };
29393
-
29394
- // eslint-disable-next-line @typescript-eslint/naming-convention
29395
- this.true = function _true(node) {
29396
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.BooleanElement(true);
29397
- maybeAddSourceMap(node, element);
29398
- return element;
29399
- };
29359
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29360
+ null(node) {
29361
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.NullElement();
29362
+ this.maybeAddSourceMap(node, element);
29363
+ return element;
29364
+ }
29400
29365
 
29401
- // eslint-disable-next-line @typescript-eslint/naming-convention
29402
- this.false = function _false(node) {
29403
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.BooleanElement(false);
29404
- maybeAddSourceMap(node, element);
29405
- return element;
29406
- };
29407
- this.ERROR = function ERROR(node, key, parent, path) {
29408
- // collect errors as annotations
29409
- const isUnexpected = !node.hasError;
29410
- const value = node.text;
29411
- const message = isUnexpected ? `(Unexpected ${value})` : `(Error ${value})`;
29412
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.AnnotationElement(message);
29413
- element.classes.push('error');
29414
- maybeAddSourceMap(node, element);
29415
- if (path.length === 0) {
29416
- // no document to visit, only error is present in CST
29417
- const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ParseResultElement();
29418
- parseResultElement.push(element);
29419
- return parseResultElement;
29420
- }
29366
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29367
+ true(node) {
29368
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.BooleanElement(true);
29369
+ this.maybeAddSourceMap(node, element);
29370
+ return element;
29371
+ }
29421
29372
 
29422
- // we have CST node for document
29423
- this.annotations.push(element);
29424
- return null;
29425
- };
29373
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29374
+ false(node) {
29375
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.BooleanElement(false);
29376
+ this.maybeAddSourceMap(node, element);
29377
+ return element;
29426
29378
  }
29427
- });
29379
+ ERROR(node, key, parent, path) {
29380
+ // collect errors as annotations
29381
+ const isUnexpected = !node.hasError;
29382
+ const value = node.text;
29383
+ const message = isUnexpected ? `(Unexpected ${value})` : `(Error ${value})`;
29384
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.AnnotationElement(message);
29385
+ element.classes.push('error');
29386
+ this.maybeAddSourceMap(node, element);
29387
+ if (path.length === 0) {
29388
+ // no document to visit, only error is present in CST
29389
+ const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ParseResultElement();
29390
+ parseResultElement.push(element);
29391
+ return parseResultElement;
29392
+ }
29393
+
29394
+ // we have CST node for document
29395
+ this.annotations.push(element);
29396
+ return null;
29397
+ }
29398
+ maybeAddSourceMap(node, element) {
29399
+ if (!this.sourceMap) {
29400
+ return;
29401
+ }
29402
+ const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.SourceMapElement();
29403
+ const position = CstVisitor.toPosition(node);
29404
+ if (position !== null) {
29405
+ const [start, end] = position;
29406
+ sourceMap.push(start);
29407
+ sourceMap.push(end);
29408
+ }
29409
+ // @ts-ignore
29410
+ sourceMap.astNode = node;
29411
+ element.meta.set('sourceMap', sourceMap);
29412
+ }
29413
+ }
29428
29414
 
29429
29415
  /* eslint-enable no-underscore-dangle */
29430
29416
 
@@ -29469,8 +29455,8 @@ const analyze = (cst, {
29469
29455
  const cursor = cst.walk();
29470
29456
  const iterator = new _TreeCursorIterator_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](cursor);
29471
29457
  const [rootNode] = Array.from(iterator);
29472
- const cstVisitor = (0,_visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])();
29473
- const astVisitor = (0,_visitors_JsonAstVisitor_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])();
29458
+ const cstVisitor = new _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
29459
+ const astVisitor = new _visitors_JsonAstVisitor_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]();
29474
29460
  const jsonAst = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__.visit)(rootNode, cstVisitor, {
29475
29461
  // @ts-ignore
29476
29462
  keyMap: _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__.keyMap,
@@ -29501,24 +29487,22 @@ __webpack_require__.r(__webpack_exports__);
29501
29487
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
29502
29488
  /* harmony export */ keyMap: () => (/* binding */ keyMap)
29503
29489
  /* harmony export */ });
29504
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
29505
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87127);
29506
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78681);
29507
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28529);
29508
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69348);
29509
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30451);
29510
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33278);
29511
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57418);
29512
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57087);
29513
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40891);
29514
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81846);
29515
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29974);
29516
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6227);
29517
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57073);
29518
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(93094);
29519
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(5773);
29520
- /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1288);
29521
-
29490
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87127);
29491
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28529);
29492
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69348);
29493
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78681);
29494
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30451);
29495
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33278);
29496
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57418);
29497
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57087);
29498
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40891);
29499
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(81846);
29500
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29974);
29501
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6227);
29502
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(57073);
29503
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(93094);
29504
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5773);
29505
+ /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1288);
29522
29506
 
29523
29507
 
29524
29508
  const keyMap = {
@@ -29530,168 +29514,160 @@ const keyMap = {
29530
29514
  key: ['children'],
29531
29515
  error: ['children']
29532
29516
  };
29533
- const CstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
29534
- init() {
29535
- /**
29536
- * Private API.
29537
- */
29538
29517
 
29539
- const toPosition = node => {
29540
- const start = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.Point)({
29541
- row: node.startPosition.row,
29542
- column: node.startPosition.column,
29543
- char: node.startIndex
29544
- });
29545
- const end = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.Point)({
29546
- row: node.endPosition.row,
29547
- column: node.endPosition.column,
29548
- char: node.endIndex
29549
- });
29550
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"])({
29551
- start,
29552
- end
29553
- });
29554
- };
29555
-
29556
- /**
29557
- * Public API.
29558
- */
29518
+ /* eslint-disable class-methods-use-this */
29559
29519
 
29560
- this.enter = function enter(node) {
29561
- // anonymous literals from CST transformed into AST literal nodes
29562
- if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed) {
29563
- const position = toPosition(node);
29564
- const value = node.type || node.text;
29565
- const {
29566
- isMissing
29567
- } = node;
29568
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__["default"])({
29569
- value,
29570
- position,
29571
- isMissing
29572
- });
29573
- }
29574
- return undefined;
29575
- };
29576
- this.document = {
29577
- enter(node) {
29578
- const position = toPosition(node);
29579
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"])({
29580
- children: node.children,
29581
- position,
29582
- isMissing: node.isMissing
29583
- });
29584
- },
29585
- leave(document) {
29586
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
29587
- children: [document]
29588
- });
29589
- }
29590
- };
29591
- this.object = function object(node) {
29592
- const position = toPosition(node);
29593
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"])({
29520
+ class CstVisitor {
29521
+ static toPosition(node) {
29522
+ const start = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__.Point)({
29523
+ row: node.startPosition.row,
29524
+ column: node.startPosition.column,
29525
+ char: node.startIndex
29526
+ });
29527
+ const end = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__.Point)({
29528
+ row: node.endPosition.row,
29529
+ column: node.endPosition.column,
29530
+ char: node.endIndex
29531
+ });
29532
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__["default"])({
29533
+ start,
29534
+ end
29535
+ });
29536
+ }
29537
+ document = {
29538
+ enter: node => {
29539
+ const position = CstVisitor.toPosition(node);
29540
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"])({
29594
29541
  children: node.children,
29595
29542
  position,
29596
29543
  isMissing: node.isMissing
29597
29544
  });
29598
- };
29599
- this.pair = function pair(node) {
29600
- const position = toPosition(node);
29601
- const children = node.children.slice(1);
29545
+ },
29546
+ leave: document => {
29547
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__["default"])({
29548
+ children: [document]
29549
+ });
29550
+ }
29551
+ };
29552
+ enter(node) {
29553
+ // anonymous literals from CST transformed into AST literal nodes
29554
+ if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"] && !node.isNamed) {
29555
+ const position = CstVisitor.toPosition(node);
29556
+ const value = node.type || node.text;
29602
29557
  const {
29603
- keyNode
29558
+ isMissing
29604
29559
  } = node;
29605
- const key = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__["default"])({
29606
- children: (keyNode === null || keyNode === void 0 ? void 0 : keyNode.children) || [],
29607
- position: keyNode != null ? toPosition(keyNode) : null,
29608
- isMissing: keyNode != null ? keyNode.isMissing : false
29609
- });
29610
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__["default"])({
29611
- children: [key, ...children],
29612
- position,
29613
- isMissing: node.isMissing
29614
- });
29615
- };
29616
- this.array = function array(node) {
29617
- const position = toPosition(node);
29618
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__["default"])({
29619
- children: node.children,
29620
- position,
29621
- isMissing: node.isMissing
29622
- });
29623
- };
29624
- this.string = function string(node) {
29625
- const position = toPosition(node);
29626
- const content = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__["default"])({
29627
- value: JSON.parse(node.text)
29628
- });
29629
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__["default"])({
29630
- children: [content],
29631
- position,
29632
- isMissing: node.isMissing
29633
- });
29634
- };
29635
- this.number = function number(node) {
29636
- const position = toPosition(node);
29637
- const value = node.text;
29638
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__["default"])({
29560
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"])({
29639
29561
  value,
29640
29562
  position,
29641
- isMissing: node.isMissing
29563
+ isMissing
29642
29564
  });
29643
- };
29565
+ }
29566
+ return undefined;
29567
+ }
29568
+ object(node) {
29569
+ const position = CstVisitor.toPosition(node);
29570
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
29571
+ children: node.children,
29572
+ position,
29573
+ isMissing: node.isMissing
29574
+ });
29575
+ }
29576
+ pair(node) {
29577
+ const position = CstVisitor.toPosition(node);
29578
+ const children = node.children.slice(1);
29579
+ const {
29580
+ keyNode
29581
+ } = node;
29582
+ const key = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"])({
29583
+ children: (keyNode === null || keyNode === void 0 ? void 0 : keyNode.children) || [],
29584
+ position: keyNode != null ? CstVisitor.toPosition(keyNode) : null,
29585
+ isMissing: keyNode != null ? keyNode.isMissing : false
29586
+ });
29587
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__["default"])({
29588
+ children: [key, ...children],
29589
+ position,
29590
+ isMissing: node.isMissing
29591
+ });
29592
+ }
29593
+ array(node) {
29594
+ const position = CstVisitor.toPosition(node);
29595
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__["default"])({
29596
+ children: node.children,
29597
+ position,
29598
+ isMissing: node.isMissing
29599
+ });
29600
+ }
29601
+ string(node) {
29602
+ const position = CstVisitor.toPosition(node);
29603
+ const content = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__["default"])({
29604
+ value: JSON.parse(node.text)
29605
+ });
29606
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__["default"])({
29607
+ children: [content],
29608
+ position,
29609
+ isMissing: node.isMissing
29610
+ });
29611
+ }
29612
+ number(node) {
29613
+ const position = CstVisitor.toPosition(node);
29614
+ const value = node.text;
29615
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__["default"])({
29616
+ value,
29617
+ position,
29618
+ isMissing: node.isMissing
29619
+ });
29620
+ }
29644
29621
 
29645
- // eslint-disable-next-line @typescript-eslint/naming-convention
29646
- this.null = function _null(node) {
29647
- const position = toPosition(node);
29648
- const value = node.text;
29649
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__["default"])({
29650
- value,
29651
- position,
29652
- isMissing: node.isMissing
29653
- });
29654
- };
29622
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29623
+ null(node) {
29624
+ const position = CstVisitor.toPosition(node);
29625
+ const value = node.text;
29626
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__["default"])({
29627
+ value,
29628
+ position,
29629
+ isMissing: node.isMissing
29630
+ });
29631
+ }
29655
29632
 
29656
- // eslint-disable-next-line @typescript-eslint/naming-convention
29657
- this.true = function _true(node) {
29658
- const position = toPosition(node);
29659
- const value = node.text;
29660
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__["default"])({
29661
- value,
29662
- position,
29663
- isMissing: node.isMissing
29664
- });
29665
- };
29633
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29634
+ true(node) {
29635
+ const position = CstVisitor.toPosition(node);
29636
+ const value = node.text;
29637
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__["default"])({
29638
+ value,
29639
+ position,
29640
+ isMissing: node.isMissing
29641
+ });
29642
+ }
29666
29643
 
29667
- // eslint-disable-next-line @typescript-eslint/naming-convention
29668
- this.false = function _false(node) {
29669
- const position = toPosition(node);
29670
- const value = node.text;
29671
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__["default"])({
29672
- value,
29673
- position,
29674
- isMissing: node.isMissing
29675
- });
29676
- };
29677
- this.ERROR = function ERROR(node, key, parent, path) {
29678
- const position = toPosition(node);
29679
- const errorNode = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_16__["default"])({
29680
- children: node.children,
29681
- position,
29682
- isUnexpected: !node.hasError,
29683
- isMissing: node.isMissing,
29684
- value: node.text
29644
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29645
+ false(node) {
29646
+ const position = CstVisitor.toPosition(node);
29647
+ const value = node.text;
29648
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__["default"])({
29649
+ value,
29650
+ position,
29651
+ isMissing: node.isMissing
29652
+ });
29653
+ }
29654
+ ERROR(node, key, parent, path) {
29655
+ const position = CstVisitor.toPosition(node);
29656
+ const errorNode = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__["default"])({
29657
+ children: node.children,
29658
+ position,
29659
+ isUnexpected: !node.hasError,
29660
+ isMissing: node.isMissing,
29661
+ value: node.text
29662
+ });
29663
+ if (path.length === 0) {
29664
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__["default"])({
29665
+ children: [errorNode]
29685
29666
  });
29686
- if (path.length === 0) {
29687
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
29688
- children: [errorNode]
29689
- });
29690
- }
29691
- return errorNode;
29692
- };
29667
+ }
29668
+ return errorNode;
29693
29669
  }
29694
- });
29670
+ }
29695
29671
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CstVisitor);
29696
29672
 
29697
29673
  /***/ }),
@@ -29707,22 +29683,22 @@ __webpack_require__.r(__webpack_exports__);
29707
29683
  /* harmony export */ isNode: () => (/* binding */ isNode),
29708
29684
  /* harmony export */ keyMap: () => (/* binding */ keyMap)
29709
29685
  /* harmony export */ });
29710
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
29711
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69348);
29712
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28529);
29713
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30451);
29714
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57418);
29715
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57087);
29716
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5773);
29717
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(51394);
29718
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50821);
29719
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(36903);
29720
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(48355);
29721
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(67952);
29722
-
29686
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69348);
29687
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28529);
29688
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30451);
29689
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57418);
29690
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57087);
29691
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5773);
29692
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51394);
29693
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50821);
29694
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(36903);
29695
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(48355);
29696
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67952);
29723
29697
 
29724
29698
 
29725
29699
  const keyMap = {
29700
+ // @ts-ignore
29701
+ [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__["default"].type]: ['children'],
29726
29702
  // @ts-ignore
29727
29703
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"].type]: ['children'],
29728
29704
  // @ts-ignore
@@ -29733,169 +29709,161 @@ const keyMap = {
29733
29709
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"].type]: ['children'],
29734
29710
  // @ts-ignore
29735
29711
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"].type]: ['children'],
29736
- // @ts-ignore
29737
- [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"].type]: ['children'],
29738
- ..._swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.keyMapDefault
29712
+ ..._swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__.keyMapDefault
29739
29713
  };
29740
29714
  const getNodeType = node => {
29741
- if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isParseResultElement)(node)) {
29715
+ if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isParseResultElement)(node)) {
29742
29716
  return 'ParseResultElement';
29743
29717
  }
29744
- if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isElement)(node)) {
29745
- return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.getNodeType)(node);
29718
+ if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isElement)(node)) {
29719
+ return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__.getNodeType)(node);
29746
29720
  }
29747
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__.getNodeType)(node);
29721
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__.getNodeType)(node);
29748
29722
  };
29749
- const isNode = element => (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isElement)(element) || (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__.isNode)(element);
29723
+ const isNode = element => (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isElement)(element) || (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__.isNode)(element);
29750
29724
 
29751
29725
  /* eslint-disable no-underscore-dangle */
29752
29726
 
29753
- const JsonAstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
29754
- props: {
29755
- sourceMap: false,
29756
- annotations: []
29757
- },
29758
- init() {
29759
- /**
29760
- * Private API.
29761
- */
29762
-
29763
- this.annotation = [];
29764
- const maybeAddSourceMap = (node, element) => {
29765
- if (!this.sourceMap) {
29766
- return;
29767
- }
29768
- const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.SourceMapElement();
29727
+ class JsonAstVisitor {
29728
+ sourceMap = false;
29729
+ ParseResultElement = {
29730
+ leave: element => {
29731
+ // mark first-non Annotation element as result
29769
29732
  // @ts-ignore
29770
- sourceMap.position = node.position;
29771
- // @ts-ignore
29772
- sourceMap.astNode = node;
29773
- element.meta.set('sourceMap', sourceMap);
29774
- };
29775
-
29776
- /**
29777
- * Public API.
29778
- */
29733
+ const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isPrimitiveElement);
29734
+ if (elements.length > 0) {
29735
+ const resultElement = elements[0];
29736
+ resultElement.classes.push('result');
29737
+ }
29779
29738
 
29780
- this.document = function document(node) {
29781
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ParseResultElement();
29782
- // @ts-ignore
29783
- element._content = node.children;
29784
- return element;
29785
- };
29786
- this.ParseResultElement = {
29787
- leave(element) {
29788
- // mark first-non Annotation element as result
29789
- // @ts-ignore
29790
- const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isPrimitiveElement);
29791
- if (elements.length > 0) {
29792
- const resultElement = elements[0];
29793
- resultElement.classes.push('result');
29794
- }
29739
+ // provide annotations
29740
+ this.annotations.forEach(annotationElement => {
29741
+ element.push(annotationElement);
29742
+ });
29743
+ this.annotations = [];
29744
+ }
29745
+ };
29746
+ constructor() {
29747
+ this.annotations = [];
29748
+ }
29795
29749
 
29796
- // provide annotations
29797
- this.annotations.forEach(annotationElement => {
29798
- element.push(annotationElement);
29799
- });
29800
- this.annotations = [];
29801
- }
29802
- };
29803
- this.object = function object(node) {
29804
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ObjectElement();
29805
- // @ts-ignore
29806
- element._content = node.children;
29807
- maybeAddSourceMap(node, element);
29808
- return element;
29809
- };
29810
- this.property = function property(node) {
29811
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_11__.MemberElement();
29750
+ // eslint-disable-next-line class-methods-use-this
29751
+ document(node) {
29752
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ParseResultElement();
29753
+ // @ts-ignore
29754
+ element._content = node.children;
29755
+ return element;
29756
+ }
29757
+ object(node) {
29758
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ObjectElement();
29759
+ // @ts-ignore
29760
+ element._content = node.children;
29761
+ this.maybeAddSourceMap(node, element);
29762
+ return element;
29763
+ }
29764
+ property(node) {
29765
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.MemberElement();
29812
29766
 
29813
- // @ts-ignore
29814
- element.content.key = node.key;
29815
- // @ts-ignore
29816
- element.content.value = node.value;
29817
- maybeAddSourceMap(node, element);
29767
+ // @ts-ignore
29768
+ element.content.key = node.key;
29769
+ // @ts-ignore
29770
+ element.content.value = node.value;
29771
+ this.maybeAddSourceMap(node, element);
29818
29772
 
29819
- /**
29820
- * Process possible errors here that may be present in pair node children as we're using direct field access.
29821
- * There are usually 3 children here found: "key", ":", "value".
29822
- */
29823
- if (node.children.length > 3) {
29824
- node.children.filter(child => child.type === 'error').forEach(errorNode => {
29825
- this.error(errorNode, node, [], [node]);
29826
- });
29827
- }
29828
- return element;
29829
- };
29830
- this.key = function key(node) {
29831
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.StringElement(node.value);
29832
- maybeAddSourceMap(node, element);
29833
- return element;
29834
- };
29835
- this.array = function array(node) {
29836
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ArrayElement();
29837
- // @ts-ignore
29838
- element._content = node.children;
29839
- maybeAddSourceMap(node, element);
29840
- return element;
29841
- };
29842
- this.string = function string(node) {
29843
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.StringElement(node.value);
29844
- maybeAddSourceMap(node, element);
29845
- return element;
29846
- };
29847
- this.number = function number(node) {
29848
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.NumberElement(Number(node.value));
29849
- maybeAddSourceMap(node, element);
29850
- return element;
29851
- };
29773
+ /**
29774
+ * Process possible errors here that may be present in pair node children as we're using direct field access.
29775
+ * There are usually 3 children here found: "key", ":", "value".
29776
+ */
29777
+ if (node.children.length > 3) {
29778
+ node.children
29779
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29780
+ .filter(child => child.type === 'error')
29781
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29782
+ .forEach(errorNode => {
29783
+ this.error(errorNode, node, [], [node]);
29784
+ });
29785
+ }
29786
+ return element;
29787
+ }
29788
+ key(node) {
29789
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.StringElement(node.value);
29790
+ this.maybeAddSourceMap(node, element);
29791
+ return element;
29792
+ }
29793
+ array(node) {
29794
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ArrayElement();
29795
+ // @ts-ignore
29796
+ element._content = node.children;
29797
+ this.maybeAddSourceMap(node, element);
29798
+ return element;
29799
+ }
29800
+ string(node) {
29801
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.StringElement(node.value);
29802
+ this.maybeAddSourceMap(node, element);
29803
+ return element;
29804
+ }
29805
+ number(node) {
29806
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.NumberElement(Number(node.value));
29807
+ this.maybeAddSourceMap(node, element);
29808
+ return element;
29809
+ }
29852
29810
 
29853
- // eslint-disable-next-line @typescript-eslint/naming-convention
29854
- this.null = function _null(node) {
29855
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.NullElement();
29856
- maybeAddSourceMap(node, element);
29857
- return element;
29858
- };
29811
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29812
+ null(node) {
29813
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.NullElement();
29814
+ this.maybeAddSourceMap(node, element);
29815
+ return element;
29816
+ }
29859
29817
 
29860
- // eslint-disable-next-line @typescript-eslint/naming-convention
29861
- this.true = function _true(node) {
29862
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.BooleanElement(true);
29863
- maybeAddSourceMap(node, element);
29864
- return element;
29865
- };
29818
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29819
+ true(node) {
29820
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.BooleanElement(true);
29821
+ this.maybeAddSourceMap(node, element);
29822
+ return element;
29823
+ }
29866
29824
 
29867
- // eslint-disable-next-line @typescript-eslint/naming-convention
29868
- this.false = function _false(node) {
29869
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.BooleanElement(false);
29870
- maybeAddSourceMap(node, element);
29871
- return element;
29872
- };
29873
- this.literal = function literal(node) {
29874
- if (node.isMissing) {
29875
- const message = `(Missing ${node.value})`;
29876
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.AnnotationElement(message);
29877
- element.classes.push('warning');
29878
- maybeAddSourceMap(node, element);
29879
- this.annotations.push(element);
29880
- }
29881
- return null;
29882
- };
29883
- this.error = function error(node, key, parent, path) {
29884
- const message = node.isUnexpected ? `(Unexpected ${node.value})` : `(Error ${node.value})`;
29885
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.AnnotationElement(message);
29886
- element.classes.push('error');
29887
- maybeAddSourceMap(node, element);
29888
- if (path.length === 0) {
29889
- // no document to visit, only error is present in CST
29890
- const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ParseResultElement();
29891
- parseResultElement.push(element);
29892
- return parseResultElement;
29893
- }
29825
+ // eslint-disable-next-line @typescript-eslint/naming-convention
29826
+ false(node) {
29827
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.BooleanElement(false);
29828
+ this.maybeAddSourceMap(node, element);
29829
+ return element;
29830
+ }
29831
+ literal(node) {
29832
+ if (node.isMissing) {
29833
+ const message = `(Missing ${node.value})`;
29834
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.AnnotationElement(message);
29835
+ element.classes.push('warning');
29836
+ this.maybeAddSourceMap(node, element);
29894
29837
  this.annotations.push(element);
29895
- return null;
29896
- };
29838
+ }
29839
+ return null;
29897
29840
  }
29898
- });
29841
+ error(node, key, parent, path) {
29842
+ const message = node.isUnexpected ? `(Unexpected ${node.value})` : `(Error ${node.value})`;
29843
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.AnnotationElement(message);
29844
+ element.classes.push('error');
29845
+ this.maybeAddSourceMap(node, element);
29846
+ if (path.length === 0) {
29847
+ // no document to visit, only error is present in CST
29848
+ const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ParseResultElement();
29849
+ parseResultElement.push(element);
29850
+ return parseResultElement;
29851
+ }
29852
+ this.annotations.push(element);
29853
+ return null;
29854
+ }
29855
+ maybeAddSourceMap(node, element) {
29856
+ if (!this.sourceMap) {
29857
+ return;
29858
+ }
29859
+ const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.SourceMapElement();
29860
+ // @ts-ignore
29861
+ sourceMap.position = node.position;
29862
+ // @ts-ignore
29863
+ sourceMap.astNode = node;
29864
+ element.meta.set('sourceMap', sourceMap);
29865
+ }
29866
+ }
29899
29867
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JsonAstVisitor);
29900
29868
 
29901
29869
  /***/ })