@swagger-api/apidom-parser-adapter-asyncapi-json-2 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.
@@ -36620,7 +36620,7 @@ const isNode = element => (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1
36620
36620
  const analyze = (cst, {
36621
36621
  sourceMap = false
36622
36622
  } = {}) => {
36623
- const visitor = (0,_visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_3__["default"])();
36623
+ const visitor = new _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_3__["default"]();
36624
36624
  const cursor = cst.walk();
36625
36625
  const iterator = new _TreeCursorIterator_mjs__WEBPACK_IMPORTED_MODULE_4__["default"](cursor);
36626
36626
  const [rootNode] = Array.from(iterator);
@@ -36646,175 +36646,161 @@ __webpack_require__.r(__webpack_exports__);
36646
36646
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36647
36647
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
36648
36648
  /* harmony export */ });
36649
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
36650
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(48355);
36651
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36903);
36652
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67952);
36649
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48355);
36650
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36903);
36651
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67952);
36653
36652
  /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1288);
36654
36653
 
36655
36654
 
36656
-
36657
36655
  /* eslint-disable no-underscore-dangle */
36658
- const CstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
36659
- props: {
36660
- sourceMap: false,
36661
- annotations: []
36662
- },
36663
- init() {
36664
- /**
36665
- * Private API.
36666
- */
36656
+ class CstVisitor {
36657
+ static toPosition(node) {
36658
+ const start = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement([node.startPosition.row, node.startPosition.column, node.startIndex]);
36659
+ const end = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement([node.endPosition.row, node.endPosition.column, node.endIndex]);
36660
+ start.classes.push('position');
36661
+ end.classes.push('position');
36662
+ return [start, end];
36663
+ }
36664
+ sourceMap = false;
36665
+ ParseResultElement = {
36666
+ leave: element => {
36667
+ // mark first-non Annotation element as result
36668
+ // @ts-ignore
36669
+ const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.isPrimitiveElement);
36670
+ if (elements.length > 0) {
36671
+ const resultElement = elements[0];
36672
+ resultElement.classes.push('result');
36673
+ }
36667
36674
 
36675
+ // provide annotations
36676
+ this.annotations.forEach(annotationElement => {
36677
+ element.push(annotationElement);
36678
+ });
36679
+ this.annotations = [];
36680
+ }
36681
+ };
36682
+ constructor() {
36668
36683
  this.annotations = [];
36669
- const toPosition = node => {
36670
- const start = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement([node.startPosition.row, node.startPosition.column, node.startIndex]);
36671
- const end = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement([node.endPosition.row, node.endPosition.column, node.endIndex]);
36672
- start.classes.push('position');
36673
- end.classes.push('position');
36674
- return [start, end];
36675
- };
36676
- const maybeAddSourceMap = (node, element) => {
36677
- if (!this.sourceMap) {
36678
- return;
36679
- }
36680
- const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.SourceMapElement();
36681
- const position = toPosition(node);
36682
- if (position !== null) {
36683
- const [start, end] = position;
36684
- sourceMap.push(start);
36685
- sourceMap.push(end);
36686
- }
36687
- // @ts-ignore
36688
- sourceMap.astNode = node;
36689
- element.meta.set('sourceMap', sourceMap);
36690
- };
36684
+ }
36685
+ enter(node) {
36686
+ // missing anonymous literals from CST transformed into AnnotationElements.
36687
+ if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed && node.isMissing) {
36688
+ // collect annotations from missing literals
36689
+ const value = node.type || node.text;
36690
+ const message = `(Missing ${value})`;
36691
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.AnnotationElement(message);
36692
+ element.classes.push('warning');
36693
+ this.maybeAddSourceMap(node, element);
36694
+ this.annotations.push(element);
36695
+ }
36696
+ return null; // remove everything unrecognized
36697
+ }
36698
+ document(node) {
36699
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ParseResultElement();
36700
+ // @ts-ignore
36701
+ element._content = node.children;
36702
+ this.maybeAddSourceMap(node, element);
36703
+ return element;
36704
+ }
36705
+ object(node) {
36706
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ObjectElement();
36707
+ // @ts-ignore
36708
+ element._content = node.children;
36709
+ this.maybeAddSourceMap(node, element);
36710
+ return element;
36711
+ }
36712
+ array(node) {
36713
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ArrayElement();
36714
+ // @ts-ignore
36715
+ element._content = node.children;
36716
+ this.maybeAddSourceMap(node, element);
36717
+ return element;
36718
+ }
36719
+ pair(node) {
36720
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.MemberElement();
36721
+ // @ts-ignore
36722
+ element.content.key = node.keyNode;
36723
+ // @ts-ignore
36724
+ element.content.value = node.valueNode;
36725
+ this.maybeAddSourceMap(node, element);
36691
36726
 
36692
36727
  /**
36693
- * Public API.
36728
+ * Process possible errors here that may be present in pair node children as we're using direct field access.
36729
+ * There are usually 3 children here found: "key", ":", "value".
36694
36730
  */
36731
+ if (node.children.length > 3) {
36732
+ node.children.filter(child => child.type === 'ERROR').forEach(errorNode => {
36733
+ this.ERROR(errorNode, node, [], [node]);
36734
+ });
36735
+ }
36736
+ return element;
36737
+ }
36738
+ string(node) {
36739
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.StringElement(JSON.parse(node.text));
36740
+ this.maybeAddSourceMap(node, element);
36741
+ return element;
36742
+ }
36743
+ number(node) {
36744
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.NumberElement(Number(node.text));
36745
+ this.maybeAddSourceMap(node, element);
36746
+ return element;
36747
+ }
36695
36748
 
36696
- this.enter = function enter(node) {
36697
- // missing anonymous literals from CST transformed into AnnotationElements.
36698
- if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed && node.isMissing) {
36699
- // collect annotations from missing literals
36700
- const value = node.type || node.text;
36701
- const message = `(Missing ${value})`;
36702
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.AnnotationElement(message);
36703
- element.classes.push('warning');
36704
- maybeAddSourceMap(node, element);
36705
- this.annotations.push(element);
36706
- }
36707
- return null; // remove everything unrecognized
36708
- };
36709
- this.document = function document(node) {
36710
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ParseResultElement();
36711
- // @ts-ignore
36712
- element._content = node.children;
36713
- maybeAddSourceMap(node, element);
36714
- return element;
36715
- };
36716
- this.ParseResultElement = {
36717
- leave(element) {
36718
- // mark first-non Annotation element as result
36719
- // @ts-ignore
36720
- const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_3__.isPrimitiveElement);
36721
- if (elements.length > 0) {
36722
- const resultElement = elements[0];
36723
- resultElement.classes.push('result');
36724
- }
36725
-
36726
- // provide annotations
36727
- this.annotations.forEach(annotationElement => {
36728
- element.push(annotationElement);
36729
- });
36730
- this.annotations = [];
36731
- }
36732
- };
36733
- this.object = function object(node) {
36734
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ObjectElement();
36735
- // @ts-ignore
36736
- element._content = node.children;
36737
- maybeAddSourceMap(node, element);
36738
- return element;
36739
- };
36740
- this.array = function array(node) {
36741
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ArrayElement();
36742
- // @ts-ignore
36743
- element._content = node.children;
36744
- maybeAddSourceMap(node, element);
36745
- return element;
36746
- };
36747
- this.pair = function pair(node) {
36748
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_4__.MemberElement();
36749
- // @ts-ignore
36750
- element.content.key = node.keyNode;
36751
- // @ts-ignore
36752
- element.content.value = node.valueNode;
36753
- maybeAddSourceMap(node, element);
36754
-
36755
- /**
36756
- * Process possible errors here that may be present in pair node children as we're using direct field access.
36757
- * There are usually 3 children here found: "key", ":", "value".
36758
- */
36759
- if (node.children.length > 3) {
36760
- node.children.filter(child => child.type === 'ERROR').forEach(errorNode => {
36761
- this.ERROR(errorNode, node, [], [node]);
36762
- });
36763
- }
36764
- return element;
36765
- };
36766
- this.string = function string(node) {
36767
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.StringElement(JSON.parse(node.text));
36768
- maybeAddSourceMap(node, element);
36769
- return element;
36770
- };
36771
- this.number = function number(node) {
36772
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.NumberElement(Number(node.text));
36773
- maybeAddSourceMap(node, element);
36774
- return element;
36775
- };
36776
-
36777
- // eslint-disable-next-line @typescript-eslint/naming-convention
36778
- this.null = function _null(node) {
36779
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.NullElement();
36780
- maybeAddSourceMap(node, element);
36781
- return element;
36782
- };
36783
-
36784
- // eslint-disable-next-line @typescript-eslint/naming-convention
36785
- this.true = function _true(node) {
36786
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.BooleanElement(true);
36787
- maybeAddSourceMap(node, element);
36788
- return element;
36789
- };
36749
+ // eslint-disable-next-line @typescript-eslint/naming-convention
36750
+ null(node) {
36751
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.NullElement();
36752
+ this.maybeAddSourceMap(node, element);
36753
+ return element;
36754
+ }
36790
36755
 
36791
- // eslint-disable-next-line @typescript-eslint/naming-convention
36792
- this.false = function _false(node) {
36793
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.BooleanElement(false);
36794
- maybeAddSourceMap(node, element);
36795
- return element;
36796
- };
36797
- this.ERROR = function ERROR(node, key, parent, path) {
36798
- // collect errors as annotations
36799
- const isUnexpected = !node.hasError;
36800
- const value = node.text;
36801
- const message = isUnexpected ? `(Unexpected ${value})` : `(Error ${value})`;
36802
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.AnnotationElement(message);
36803
- element.classes.push('error');
36804
- maybeAddSourceMap(node, element);
36805
- if (path.length === 0) {
36806
- // no document to visit, only error is present in CST
36807
- const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_1__.ParseResultElement();
36808
- parseResultElement.push(element);
36809
- return parseResultElement;
36810
- }
36756
+ // eslint-disable-next-line @typescript-eslint/naming-convention
36757
+ true(node) {
36758
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.BooleanElement(true);
36759
+ this.maybeAddSourceMap(node, element);
36760
+ return element;
36761
+ }
36811
36762
 
36812
- // we have CST node for document
36813
- this.annotations.push(element);
36814
- return null;
36815
- };
36763
+ // eslint-disable-next-line @typescript-eslint/naming-convention
36764
+ false(node) {
36765
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.BooleanElement(false);
36766
+ this.maybeAddSourceMap(node, element);
36767
+ return element;
36816
36768
  }
36817
- });
36769
+ ERROR(node, key, parent, path) {
36770
+ // collect errors as annotations
36771
+ const isUnexpected = !node.hasError;
36772
+ const value = node.text;
36773
+ const message = isUnexpected ? `(Unexpected ${value})` : `(Error ${value})`;
36774
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.AnnotationElement(message);
36775
+ element.classes.push('error');
36776
+ this.maybeAddSourceMap(node, element);
36777
+ if (path.length === 0) {
36778
+ // no document to visit, only error is present in CST
36779
+ const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.ParseResultElement();
36780
+ parseResultElement.push(element);
36781
+ return parseResultElement;
36782
+ }
36783
+
36784
+ // we have CST node for document
36785
+ this.annotations.push(element);
36786
+ return null;
36787
+ }
36788
+ maybeAddSourceMap(node, element) {
36789
+ if (!this.sourceMap) {
36790
+ return;
36791
+ }
36792
+ const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_0__.SourceMapElement();
36793
+ const position = CstVisitor.toPosition(node);
36794
+ if (position !== null) {
36795
+ const [start, end] = position;
36796
+ sourceMap.push(start);
36797
+ sourceMap.push(end);
36798
+ }
36799
+ // @ts-ignore
36800
+ sourceMap.astNode = node;
36801
+ element.meta.set('sourceMap', sourceMap);
36802
+ }
36803
+ }
36818
36804
 
36819
36805
  /* eslint-enable no-underscore-dangle */
36820
36806
 
@@ -36859,8 +36845,8 @@ const analyze = (cst, {
36859
36845
  const cursor = cst.walk();
36860
36846
  const iterator = new _TreeCursorIterator_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](cursor);
36861
36847
  const [rootNode] = Array.from(iterator);
36862
- const cstVisitor = (0,_visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"])();
36863
- const astVisitor = (0,_visitors_JsonAstVisitor_mjs__WEBPACK_IMPORTED_MODULE_2__["default"])();
36848
+ const cstVisitor = new _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__["default"]();
36849
+ const astVisitor = new _visitors_JsonAstVisitor_mjs__WEBPACK_IMPORTED_MODULE_2__["default"]();
36864
36850
  const jsonAst = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__.visit)(rootNode, cstVisitor, {
36865
36851
  // @ts-ignore
36866
36852
  keyMap: _visitors_CstVisitor_mjs__WEBPACK_IMPORTED_MODULE_1__.keyMap,
@@ -36891,24 +36877,22 @@ __webpack_require__.r(__webpack_exports__);
36891
36877
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
36892
36878
  /* harmony export */ keyMap: () => (/* binding */ keyMap)
36893
36879
  /* harmony export */ });
36894
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
36895
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87127);
36896
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(78681);
36897
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28529);
36898
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(69348);
36899
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30451);
36900
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33278);
36901
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57418);
36902
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57087);
36903
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(40891);
36904
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(81846);
36905
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(29974);
36906
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6227);
36907
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(57073);
36908
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(93094);
36909
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(5773);
36910
- /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1288);
36911
-
36880
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87127);
36881
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28529);
36882
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69348);
36883
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78681);
36884
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(30451);
36885
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33278);
36886
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(57418);
36887
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57087);
36888
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(40891);
36889
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(81846);
36890
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(29974);
36891
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6227);
36892
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(57073);
36893
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(93094);
36894
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(5773);
36895
+ /* harmony import */ var _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1288);
36912
36896
 
36913
36897
 
36914
36898
  const keyMap = {
@@ -36920,168 +36904,160 @@ const keyMap = {
36920
36904
  key: ['children'],
36921
36905
  error: ['children']
36922
36906
  };
36923
- const CstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
36924
- init() {
36925
- /**
36926
- * Private API.
36927
- */
36928
36907
 
36929
- const toPosition = node => {
36930
- const start = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.Point)({
36931
- row: node.startPosition.row,
36932
- column: node.startPosition.column,
36933
- char: node.startIndex
36934
- });
36935
- const end = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__.Point)({
36936
- row: node.endPosition.row,
36937
- column: node.endPosition.column,
36938
- char: node.endIndex
36939
- });
36940
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"])({
36941
- start,
36942
- end
36943
- });
36944
- };
36945
-
36946
- /**
36947
- * Public API.
36948
- */
36908
+ /* eslint-disable class-methods-use-this */
36949
36909
 
36950
- this.enter = function enter(node) {
36951
- // anonymous literals from CST transformed into AST literal nodes
36952
- if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_2__["default"] && !node.isNamed) {
36953
- const position = toPosition(node);
36954
- const value = node.type || node.text;
36955
- const {
36956
- isMissing
36957
- } = node;
36958
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__["default"])({
36959
- value,
36960
- position,
36961
- isMissing
36962
- });
36963
- }
36964
- return undefined;
36965
- };
36966
- this.document = {
36967
- enter(node) {
36968
- const position = toPosition(node);
36969
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"])({
36970
- children: node.children,
36971
- position,
36972
- isMissing: node.isMissing
36973
- });
36974
- },
36975
- leave(document) {
36976
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
36977
- children: [document]
36978
- });
36979
- }
36980
- };
36981
- this.object = function object(node) {
36982
- const position = toPosition(node);
36983
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"])({
36910
+ class CstVisitor {
36911
+ static toPosition(node) {
36912
+ const start = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__.Point)({
36913
+ row: node.startPosition.row,
36914
+ column: node.startPosition.column,
36915
+ char: node.startIndex
36916
+ });
36917
+ const end = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__.Point)({
36918
+ row: node.endPosition.row,
36919
+ column: node.endPosition.column,
36920
+ char: node.endIndex
36921
+ });
36922
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__["default"])({
36923
+ start,
36924
+ end
36925
+ });
36926
+ }
36927
+ document = {
36928
+ enter: node => {
36929
+ const position = CstVisitor.toPosition(node);
36930
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"])({
36984
36931
  children: node.children,
36985
36932
  position,
36986
36933
  isMissing: node.isMissing
36987
36934
  });
36988
- };
36989
- this.pair = function pair(node) {
36990
- const position = toPosition(node);
36991
- const children = node.children.slice(1);
36935
+ },
36936
+ leave: document => {
36937
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__["default"])({
36938
+ children: [document]
36939
+ });
36940
+ }
36941
+ };
36942
+ enter(node) {
36943
+ // anonymous literals from CST transformed into AST literal nodes
36944
+ if (node instanceof _TreeCursorSyntaxNode_mjs__WEBPACK_IMPORTED_MODULE_3__["default"] && !node.isNamed) {
36945
+ const position = CstVisitor.toPosition(node);
36946
+ const value = node.type || node.text;
36992
36947
  const {
36993
- keyNode
36948
+ isMissing
36994
36949
  } = node;
36995
- const key = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__["default"])({
36996
- children: (keyNode === null || keyNode === void 0 ? void 0 : keyNode.children) || [],
36997
- position: keyNode != null ? toPosition(keyNode) : null,
36998
- isMissing: keyNode != null ? keyNode.isMissing : false
36999
- });
37000
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__["default"])({
37001
- children: [key, ...children],
37002
- position,
37003
- isMissing: node.isMissing
37004
- });
37005
- };
37006
- this.array = function array(node) {
37007
- const position = toPosition(node);
37008
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__["default"])({
37009
- children: node.children,
37010
- position,
37011
- isMissing: node.isMissing
37012
- });
37013
- };
37014
- this.string = function string(node) {
37015
- const position = toPosition(node);
37016
- const content = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__["default"])({
37017
- value: JSON.parse(node.text)
37018
- });
37019
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__["default"])({
37020
- children: [content],
37021
- position,
37022
- isMissing: node.isMissing
37023
- });
37024
- };
37025
- this.number = function number(node) {
37026
- const position = toPosition(node);
37027
- const value = node.text;
37028
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__["default"])({
36950
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"])({
37029
36951
  value,
37030
36952
  position,
37031
- isMissing: node.isMissing
36953
+ isMissing
37032
36954
  });
37033
- };
36955
+ }
36956
+ return undefined;
36957
+ }
36958
+ object(node) {
36959
+ const position = CstVisitor.toPosition(node);
36960
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
36961
+ children: node.children,
36962
+ position,
36963
+ isMissing: node.isMissing
36964
+ });
36965
+ }
36966
+ pair(node) {
36967
+ const position = CstVisitor.toPosition(node);
36968
+ const children = node.children.slice(1);
36969
+ const {
36970
+ keyNode
36971
+ } = node;
36972
+ const key = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"])({
36973
+ children: (keyNode === null || keyNode === void 0 ? void 0 : keyNode.children) || [],
36974
+ position: keyNode != null ? CstVisitor.toPosition(keyNode) : null,
36975
+ isMissing: keyNode != null ? keyNode.isMissing : false
36976
+ });
36977
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_7__["default"])({
36978
+ children: [key, ...children],
36979
+ position,
36980
+ isMissing: node.isMissing
36981
+ });
36982
+ }
36983
+ array(node) {
36984
+ const position = CstVisitor.toPosition(node);
36985
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__["default"])({
36986
+ children: node.children,
36987
+ position,
36988
+ isMissing: node.isMissing
36989
+ });
36990
+ }
36991
+ string(node) {
36992
+ const position = CstVisitor.toPosition(node);
36993
+ const content = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__["default"])({
36994
+ value: JSON.parse(node.text)
36995
+ });
36996
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_10__["default"])({
36997
+ children: [content],
36998
+ position,
36999
+ isMissing: node.isMissing
37000
+ });
37001
+ }
37002
+ number(node) {
37003
+ const position = CstVisitor.toPosition(node);
37004
+ const value = node.text;
37005
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_11__["default"])({
37006
+ value,
37007
+ position,
37008
+ isMissing: node.isMissing
37009
+ });
37010
+ }
37034
37011
 
37035
- // eslint-disable-next-line @typescript-eslint/naming-convention
37036
- this.null = function _null(node) {
37037
- const position = toPosition(node);
37038
- const value = node.text;
37039
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__["default"])({
37040
- value,
37041
- position,
37042
- isMissing: node.isMissing
37043
- });
37044
- };
37012
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37013
+ null(node) {
37014
+ const position = CstVisitor.toPosition(node);
37015
+ const value = node.text;
37016
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_12__["default"])({
37017
+ value,
37018
+ position,
37019
+ isMissing: node.isMissing
37020
+ });
37021
+ }
37045
37022
 
37046
- // eslint-disable-next-line @typescript-eslint/naming-convention
37047
- this.true = function _true(node) {
37048
- const position = toPosition(node);
37049
- const value = node.text;
37050
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__["default"])({
37051
- value,
37052
- position,
37053
- isMissing: node.isMissing
37054
- });
37055
- };
37023
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37024
+ true(node) {
37025
+ const position = CstVisitor.toPosition(node);
37026
+ const value = node.text;
37027
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_13__["default"])({
37028
+ value,
37029
+ position,
37030
+ isMissing: node.isMissing
37031
+ });
37032
+ }
37056
37033
 
37057
- // eslint-disable-next-line @typescript-eslint/naming-convention
37058
- this.false = function _false(node) {
37059
- const position = toPosition(node);
37060
- const value = node.text;
37061
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__["default"])({
37062
- value,
37063
- position,
37064
- isMissing: node.isMissing
37065
- });
37066
- };
37067
- this.ERROR = function ERROR(node, key, parent, path) {
37068
- const position = toPosition(node);
37069
- const errorNode = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_16__["default"])({
37070
- children: node.children,
37071
- position,
37072
- isUnexpected: !node.hasError,
37073
- isMissing: node.isMissing,
37074
- value: node.text
37034
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37035
+ false(node) {
37036
+ const position = CstVisitor.toPosition(node);
37037
+ const value = node.text;
37038
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_14__["default"])({
37039
+ value,
37040
+ position,
37041
+ isMissing: node.isMissing
37042
+ });
37043
+ }
37044
+ ERROR(node, key, parent, path) {
37045
+ const position = CstVisitor.toPosition(node);
37046
+ const errorNode = (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_15__["default"])({
37047
+ children: node.children,
37048
+ position,
37049
+ isUnexpected: !node.hasError,
37050
+ isMissing: node.isMissing,
37051
+ value: node.text
37052
+ });
37053
+ if (path.length === 0) {
37054
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__["default"])({
37055
+ children: [errorNode]
37075
37056
  });
37076
- if (path.length === 0) {
37077
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"])({
37078
- children: [errorNode]
37079
- });
37080
- }
37081
- return errorNode;
37082
- };
37057
+ }
37058
+ return errorNode;
37083
37059
  }
37084
- });
37060
+ }
37085
37061
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CstVisitor);
37086
37062
 
37087
37063
  /***/ }),
@@ -37097,22 +37073,22 @@ __webpack_require__.r(__webpack_exports__);
37097
37073
  /* harmony export */ isNode: () => (/* binding */ isNode),
37098
37074
  /* harmony export */ keyMap: () => (/* binding */ keyMap)
37099
37075
  /* harmony export */ });
37100
- /* harmony import */ var stampit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(86591);
37101
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(69348);
37102
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(28529);
37103
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(30451);
37104
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57418);
37105
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(57087);
37106
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5773);
37107
- /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(51394);
37108
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(50821);
37109
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(36903);
37110
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(48355);
37111
- /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(67952);
37112
-
37076
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69348);
37077
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(28529);
37078
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30451);
37079
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57418);
37080
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(57087);
37081
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5773);
37082
+ /* harmony import */ var _swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(51394);
37083
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50821);
37084
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(36903);
37085
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(48355);
37086
+ /* harmony import */ var _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(67952);
37113
37087
 
37114
37088
 
37115
37089
  const keyMap = {
37090
+ // @ts-ignore
37091
+ [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_0__["default"].type]: ['children'],
37116
37092
  // @ts-ignore
37117
37093
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_1__["default"].type]: ['children'],
37118
37094
  // @ts-ignore
@@ -37123,169 +37099,161 @@ const keyMap = {
37123
37099
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_4__["default"].type]: ['children'],
37124
37100
  // @ts-ignore
37125
37101
  [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_5__["default"].type]: ['children'],
37126
- // @ts-ignore
37127
- [_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_6__["default"].type]: ['children'],
37128
- ..._swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.keyMapDefault
37102
+ ..._swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__.keyMapDefault
37129
37103
  };
37130
37104
  const getNodeType = node => {
37131
- if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isParseResultElement)(node)) {
37105
+ if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isParseResultElement)(node)) {
37132
37106
  return 'ParseResultElement';
37133
37107
  }
37134
- if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isElement)(node)) {
37135
- return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.getNodeType)(node);
37108
+ if ((0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isElement)(node)) {
37109
+ return (0,_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_6__.getNodeType)(node);
37136
37110
  }
37137
- return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_9__.getNodeType)(node);
37111
+ return (0,_swagger_api_apidom_ast__WEBPACK_IMPORTED_MODULE_8__.getNodeType)(node);
37138
37112
  };
37139
- 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);
37113
+ 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);
37140
37114
 
37141
37115
  /* eslint-disable no-underscore-dangle */
37142
37116
 
37143
- const JsonAstVisitor = stampit__WEBPACK_IMPORTED_MODULE_0__({
37144
- props: {
37145
- sourceMap: false,
37146
- annotations: []
37147
- },
37148
- init() {
37149
- /**
37150
- * Private API.
37151
- */
37152
-
37153
- this.annotation = [];
37154
- const maybeAddSourceMap = (node, element) => {
37155
- if (!this.sourceMap) {
37156
- return;
37157
- }
37158
- const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.SourceMapElement();
37117
+ class JsonAstVisitor {
37118
+ sourceMap = false;
37119
+ ParseResultElement = {
37120
+ leave: element => {
37121
+ // mark first-non Annotation element as result
37159
37122
  // @ts-ignore
37160
- sourceMap.position = node.position;
37161
- // @ts-ignore
37162
- sourceMap.astNode = node;
37163
- element.meta.set('sourceMap', sourceMap);
37164
- };
37165
-
37166
- /**
37167
- * Public API.
37168
- */
37123
+ const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_7__.isPrimitiveElement);
37124
+ if (elements.length > 0) {
37125
+ const resultElement = elements[0];
37126
+ resultElement.classes.push('result');
37127
+ }
37169
37128
 
37170
- this.document = function document(node) {
37171
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ParseResultElement();
37172
- // @ts-ignore
37173
- element._content = node.children;
37174
- return element;
37175
- };
37176
- this.ParseResultElement = {
37177
- leave(element) {
37178
- // mark first-non Annotation element as result
37179
- // @ts-ignore
37180
- const elements = element.findElements(_swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_8__.isPrimitiveElement);
37181
- if (elements.length > 0) {
37182
- const resultElement = elements[0];
37183
- resultElement.classes.push('result');
37184
- }
37129
+ // provide annotations
37130
+ this.annotations.forEach(annotationElement => {
37131
+ element.push(annotationElement);
37132
+ });
37133
+ this.annotations = [];
37134
+ }
37135
+ };
37136
+ constructor() {
37137
+ this.annotations = [];
37138
+ }
37185
37139
 
37186
- // provide annotations
37187
- this.annotations.forEach(annotationElement => {
37188
- element.push(annotationElement);
37189
- });
37190
- this.annotations = [];
37191
- }
37192
- };
37193
- this.object = function object(node) {
37194
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ObjectElement();
37195
- // @ts-ignore
37196
- element._content = node.children;
37197
- maybeAddSourceMap(node, element);
37198
- return element;
37199
- };
37200
- this.property = function property(node) {
37201
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_11__.MemberElement();
37140
+ // eslint-disable-next-line class-methods-use-this
37141
+ document(node) {
37142
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ParseResultElement();
37143
+ // @ts-ignore
37144
+ element._content = node.children;
37145
+ return element;
37146
+ }
37147
+ object(node) {
37148
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ObjectElement();
37149
+ // @ts-ignore
37150
+ element._content = node.children;
37151
+ this.maybeAddSourceMap(node, element);
37152
+ return element;
37153
+ }
37154
+ property(node) {
37155
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.MemberElement();
37202
37156
 
37203
- // @ts-ignore
37204
- element.content.key = node.key;
37205
- // @ts-ignore
37206
- element.content.value = node.value;
37207
- maybeAddSourceMap(node, element);
37157
+ // @ts-ignore
37158
+ element.content.key = node.key;
37159
+ // @ts-ignore
37160
+ element.content.value = node.value;
37161
+ this.maybeAddSourceMap(node, element);
37208
37162
 
37209
- /**
37210
- * Process possible errors here that may be present in pair node children as we're using direct field access.
37211
- * There are usually 3 children here found: "key", ":", "value".
37212
- */
37213
- if (node.children.length > 3) {
37214
- node.children.filter(child => child.type === 'error').forEach(errorNode => {
37215
- this.error(errorNode, node, [], [node]);
37216
- });
37217
- }
37218
- return element;
37219
- };
37220
- this.key = function key(node) {
37221
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.StringElement(node.value);
37222
- maybeAddSourceMap(node, element);
37223
- return element;
37224
- };
37225
- this.array = function array(node) {
37226
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ArrayElement();
37227
- // @ts-ignore
37228
- element._content = node.children;
37229
- maybeAddSourceMap(node, element);
37230
- return element;
37231
- };
37232
- this.string = function string(node) {
37233
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.StringElement(node.value);
37234
- maybeAddSourceMap(node, element);
37235
- return element;
37236
- };
37237
- this.number = function number(node) {
37238
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.NumberElement(Number(node.value));
37239
- maybeAddSourceMap(node, element);
37240
- return element;
37241
- };
37163
+ /**
37164
+ * Process possible errors here that may be present in pair node children as we're using direct field access.
37165
+ * There are usually 3 children here found: "key", ":", "value".
37166
+ */
37167
+ if (node.children.length > 3) {
37168
+ node.children
37169
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37170
+ .filter(child => child.type === 'error')
37171
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37172
+ .forEach(errorNode => {
37173
+ this.error(errorNode, node, [], [node]);
37174
+ });
37175
+ }
37176
+ return element;
37177
+ }
37178
+ key(node) {
37179
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.StringElement(node.value);
37180
+ this.maybeAddSourceMap(node, element);
37181
+ return element;
37182
+ }
37183
+ array(node) {
37184
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ArrayElement();
37185
+ // @ts-ignore
37186
+ element._content = node.children;
37187
+ this.maybeAddSourceMap(node, element);
37188
+ return element;
37189
+ }
37190
+ string(node) {
37191
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.StringElement(node.value);
37192
+ this.maybeAddSourceMap(node, element);
37193
+ return element;
37194
+ }
37195
+ number(node) {
37196
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.NumberElement(Number(node.value));
37197
+ this.maybeAddSourceMap(node, element);
37198
+ return element;
37199
+ }
37242
37200
 
37243
- // eslint-disable-next-line @typescript-eslint/naming-convention
37244
- this.null = function _null(node) {
37245
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.NullElement();
37246
- maybeAddSourceMap(node, element);
37247
- return element;
37248
- };
37201
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37202
+ null(node) {
37203
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.NullElement();
37204
+ this.maybeAddSourceMap(node, element);
37205
+ return element;
37206
+ }
37249
37207
 
37250
- // eslint-disable-next-line @typescript-eslint/naming-convention
37251
- this.true = function _true(node) {
37252
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.BooleanElement(true);
37253
- maybeAddSourceMap(node, element);
37254
- return element;
37255
- };
37208
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37209
+ true(node) {
37210
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.BooleanElement(true);
37211
+ this.maybeAddSourceMap(node, element);
37212
+ return element;
37213
+ }
37256
37214
 
37257
- // eslint-disable-next-line @typescript-eslint/naming-convention
37258
- this.false = function _false(node) {
37259
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.BooleanElement(false);
37260
- maybeAddSourceMap(node, element);
37261
- return element;
37262
- };
37263
- this.literal = function literal(node) {
37264
- if (node.isMissing) {
37265
- const message = `(Missing ${node.value})`;
37266
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.AnnotationElement(message);
37267
- element.classes.push('warning');
37268
- maybeAddSourceMap(node, element);
37269
- this.annotations.push(element);
37270
- }
37271
- return null;
37272
- };
37273
- this.error = function error(node, key, parent, path) {
37274
- const message = node.isUnexpected ? `(Unexpected ${node.value})` : `(Error ${node.value})`;
37275
- const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.AnnotationElement(message);
37276
- element.classes.push('error');
37277
- maybeAddSourceMap(node, element);
37278
- if (path.length === 0) {
37279
- // no document to visit, only error is present in CST
37280
- const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_10__.ParseResultElement();
37281
- parseResultElement.push(element);
37282
- return parseResultElement;
37283
- }
37215
+ // eslint-disable-next-line @typescript-eslint/naming-convention
37216
+ false(node) {
37217
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.BooleanElement(false);
37218
+ this.maybeAddSourceMap(node, element);
37219
+ return element;
37220
+ }
37221
+ literal(node) {
37222
+ if (node.isMissing) {
37223
+ const message = `(Missing ${node.value})`;
37224
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.AnnotationElement(message);
37225
+ element.classes.push('warning');
37226
+ this.maybeAddSourceMap(node, element);
37284
37227
  this.annotations.push(element);
37285
- return null;
37286
- };
37228
+ }
37229
+ return null;
37287
37230
  }
37288
- });
37231
+ error(node, key, parent, path) {
37232
+ const message = node.isUnexpected ? `(Unexpected ${node.value})` : `(Error ${node.value})`;
37233
+ const element = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.AnnotationElement(message);
37234
+ element.classes.push('error');
37235
+ this.maybeAddSourceMap(node, element);
37236
+ if (path.length === 0) {
37237
+ // no document to visit, only error is present in CST
37238
+ const parseResultElement = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.ParseResultElement();
37239
+ parseResultElement.push(element);
37240
+ return parseResultElement;
37241
+ }
37242
+ this.annotations.push(element);
37243
+ return null;
37244
+ }
37245
+ maybeAddSourceMap(node, element) {
37246
+ if (!this.sourceMap) {
37247
+ return;
37248
+ }
37249
+ const sourceMap = new _swagger_api_apidom_core__WEBPACK_IMPORTED_MODULE_9__.SourceMapElement();
37250
+ // @ts-ignore
37251
+ sourceMap.position = node.position;
37252
+ // @ts-ignore
37253
+ sourceMap.astNode = node;
37254
+ element.meta.set('sourceMap', sourceMap);
37255
+ }
37256
+ }
37289
37257
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (JsonAstVisitor);
37290
37258
 
37291
37259
  /***/ })