@plumile/ui 0.1.112 → 0.1.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/_virtual/_rolldown/runtime.js +5 -5
- package/lib/esm/atomic/molecules/markdown/components/MarkdownArticleContainer.css.js +0 -1
- package/lib/esm/atomic/molecules/markdown/components/MarkdownLink.css.js +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-7EHR7CIX.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-4EGX6M5U.js +37 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-4EGX6M5U.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-5DO6E6H7.js +25 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-5DO6E6H7.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-LIHQZDEY.js → chunk-BR22UD5L.js} +18 -21
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-BR22UD5L.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FHYWG6QK.js +25 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FHYWG6QK.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MPE355IW.js +25 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MPE355IW.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MZUSXYTE.js +32 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-MZUSXYTE.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-N66VUXT2.js +56 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-N66VUXT2.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-NNHCCRGN.js +20648 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-NNHCCRGN.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-PUPMXCY4.js +25 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-PUPMXCY4.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-UIBZB4QT.js +25 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-UIBZB4QT.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WCWK7LTN.js +33 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-WCWK7LTN.js.map +1 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/eventmodeling-FCH6USID.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-WXDBUCRP.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-J43DQDTF.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-YPE3B663.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-LRSECV5Y.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-GUYGQ44K.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-BLDUP644.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-LRROVOQU.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-L42UT6IY.js +3 -0
- package/lib/esm/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +24 -19
- package/lib/esm/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js.map +1 -1
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +8 -8
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/layout.js +105 -105
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +12 -12
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +8 -8
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/index.js +12 -12
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/init-order.js +6 -6
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +7 -7
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +9 -9
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/order/sort.js +7 -7
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/position/bk.js +53 -53
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/position/index.js +5 -5
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +26 -26
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/rank/util.js +9 -9
- package/lib/esm/node_modules/dagre-d3-es/src/dagre/util.js +54 -54
- package/lib/esm/node_modules/dagre-d3-es/src/graphlib/graph.js +45 -45
- package/lib/esm/node_modules/dagre-d3-es/src/graphlib/json.js +18 -18
- package/lib/esm/node_modules/lodash-es/_arrayLikeKeys.js +8 -8
- package/lib/esm/node_modules/lodash-es/_baseAssign.js +3 -3
- package/lib/esm/node_modules/lodash-es/_baseClone.js +24 -24
- package/lib/esm/node_modules/lodash-es/_baseForOwn.js +3 -3
- package/lib/esm/node_modules/lodash-es/_baseGetAllKeys.js +3 -3
- package/lib/esm/node_modules/lodash-es/_baseIsEqualDeep.js +12 -12
- package/lib/esm/node_modules/lodash-es/_baseIteratee.js +4 -4
- package/lib/esm/node_modules/lodash-es/_baseMatchesProperty.js +9 -9
- package/lib/esm/node_modules/lodash-es/_baseMerge.js +6 -6
- package/lib/esm/node_modules/lodash-es/_baseMergeDeep.js +15 -15
- package/lib/esm/node_modules/lodash-es/_baseOrderBy.js +14 -14
- package/lib/esm/node_modules/lodash-es/_baseSet.js +8 -8
- package/lib/esm/node_modules/lodash-es/_baseSetToString.js +5 -5
- package/lib/esm/node_modules/lodash-es/_baseToString.js +11 -11
- package/lib/esm/node_modules/lodash-es/_baseUniq.js +7 -7
- package/lib/esm/node_modules/lodash-es/_copySymbols.js +3 -3
- package/lib/esm/node_modules/lodash-es/_createSet.js +6 -6
- package/lib/esm/node_modules/lodash-es/_equalByTag.js +18 -18
- package/lib/esm/node_modules/lodash-es/_flatRest.js +4 -4
- package/lib/esm/node_modules/lodash-es/_getAllKeys.js +3 -3
- package/lib/esm/node_modules/lodash-es/_getAllKeysIn.js +4 -4
- package/lib/esm/node_modules/lodash-es/_getSymbolsIn.js +3 -3
- package/lib/esm/node_modules/lodash-es/_hasPath.js +5 -5
- package/lib/esm/node_modules/lodash-es/_initCloneObject.js +4 -4
- package/lib/esm/node_modules/lodash-es/_isFlattenable.js +3 -3
- package/lib/esm/node_modules/lodash-es/_isIterateeCall.js +6 -6
- package/lib/esm/node_modules/lodash-es/_mapCacheClear.js +6 -6
- package/lib/esm/node_modules/lodash-es/findIndex.js +4 -4
- package/lib/esm/node_modules/lodash-es/forEach.js +3 -3
- package/lib/esm/node_modules/lodash-es/forIn.js +3 -3
- package/lib/esm/node_modules/lodash-es/isEmpty.js +8 -8
- package/lib/esm/node_modules/lodash-es/isPlainObject.js +4 -4
- package/lib/esm/node_modules/lodash-es/isString.js +3 -3
- package/lib/esm/node_modules/lodash-es/keys.js +4 -4
- package/lib/esm/node_modules/lodash-es/keysIn.js +3 -3
- package/lib/esm/node_modules/lodash-es/map.js +3 -3
- package/lib/esm/node_modules/lodash-es/mapValues.js +5 -5
- package/lib/esm/node_modules/lodash-es/max.js +3 -3
- package/lib/esm/node_modules/lodash-es/min.js +3 -3
- package/lib/esm/node_modules/lodash-es/minBy.js +3 -3
- package/lib/esm/node_modules/lodash-es/reduce.js +5 -5
- package/lib/esm/node_modules/lodash-es/size.js +4 -4
- package/lib/esm/node_modules/lodash-es/sortBy.js +6 -6
- package/lib/esm/node_modules/lodash-es/union.js +6 -6
- package/lib/esm/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5PVQY5BW.js +146 -146
- package/lib/esm/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5PVQY5BW.js.map +1 -1
- package/lib/esm/node_modules/mermaid/dist/mermaid.core.js +374 -374
- package/lib/esm/node_modules/mermaid/dist/mermaid.core.js.map +1 -1
- package/package.json +6 -6
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/helpers.js +0 -27
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/helpers.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/model.js +0 -155
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/model.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/visitor.js +0 -45
- package/lib/esm/node_modules/@chevrotain/gast/lib/src/visitor.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/api.js +0 -2
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js +0 -89
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/base-regexp-visitor.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js +0 -39
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/character-classes.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js +0 -600
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/regexp-parser.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js +0 -29
- package/lib/esm/node_modules/@chevrotain/regexp-to-ast/lib/src/utils.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/print.js +0 -13
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/print.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/timer.js +0 -12
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/timer.js.map +0 -1
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js +0 -14
- package/lib/esm/node_modules/@chevrotain/utils/lib/src/to-fast-properties.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/architecture-YZFGNWBL.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-2KRD3SAO.js +0 -28
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-2KRD3SAO.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-67CJDMHE.js +0 -28
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-67CJDMHE.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-7N4EOEYR.js +0 -40
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-7N4EOEYR.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-AA7GKIK3.js +0 -35
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-AA7GKIK3.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +0 -28
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOC6F5B3.js +0 -28
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-FOC6F5B3.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +0 -1210
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-KGLVRYIC.js +0 -28
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-KGLVRYIC.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-LIHQZDEY.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +0 -36
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js.map +0 -1
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/gitGraph-7Q5UKJZL.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +0 -3
- package/lib/esm/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +0 -3
- package/lib/esm/node_modules/chevrotain/lib/src/api.js +0 -10
- package/lib/esm/node_modules/chevrotain/lib/src/lang/lang_extensions.js +0 -14
- package/lib/esm/node_modules/chevrotain/lib/src/lang/lang_extensions.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/constants.js +0 -6
- package/lib/esm/node_modules/chevrotain/lib/src/parse/constants.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/cst/cst.js +0 -17
- package/lib/esm/node_modules/chevrotain/lib/src/parse/cst/cst.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +0 -53
- package/lib/esm/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/errors_public.js +0 -81
- package/lib/esm/node_modules/chevrotain/lib/src/parse/errors_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/exceptions_public.js +0 -37
- package/lib/esm/node_modules/chevrotain/lib/src/parse/exceptions_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/checks.js +0 -279
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/checks.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/first.js +0 -27
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/first.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/follow.js +0 -32
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/follow.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +0 -18
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +0 -269
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/keys.js +0 -8
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/keys.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +0 -45
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +0 -245
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +0 -34
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/resolver.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/rest.js +0 -60
- package/lib/esm/node_modules/chevrotain/lib/src/parse/grammar/rest.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/parser.js +0 -118
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/parser.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +0 -50
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +0 -170
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +0 -47
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +0 -111
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +0 -25
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +0 -316
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +0 -291
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +0 -147
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +0 -96
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js +0 -15
- package/lib/esm/node_modules/chevrotain/lib/src/parse/parser/utils/apply_mixins.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer.js +0 -439
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js +0 -13
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer_errors_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer_public.js +0 -257
- package/lib/esm/node_modules/chevrotain/lib/src/scan/lexer_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/reg_exp.js +0 -157
- package/lib/esm/node_modules/chevrotain/lib/src/scan/reg_exp.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js +0 -19
- package/lib/esm/node_modules/chevrotain/lib/src/scan/reg_exp_parser.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/tokens.js +0 -68
- package/lib/esm/node_modules/chevrotain/lib/src/scan/tokens.js.map +0 -1
- package/lib/esm/node_modules/chevrotain/lib/src/scan/tokens_public.js +0 -43
- package/lib/esm/node_modules/chevrotain/lib/src/scan/tokens_public.js.map +0 -1
- package/lib/esm/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +0 -365
- package/lib/esm/node_modules/chevrotain-allstar/lib/all-star-lookahead.js.map +0 -1
- package/lib/esm/node_modules/chevrotain-allstar/lib/atn.js +0 -197
- package/lib/esm/node_modules/chevrotain-allstar/lib/atn.js.map +0 -1
- package/lib/esm/node_modules/chevrotain-allstar/lib/dfa.js +0 -35
- package/lib/esm/node_modules/chevrotain-allstar/lib/dfa.js.map +0 -1
- package/lib/esm/node_modules/chevrotain-allstar/lib/index.js +0 -1
- package/lib/esm/node_modules/langium/lib/default-module.js +0 -89
- package/lib/esm/node_modules/langium/lib/default-module.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/dependency-injection.js +0 -62
- package/lib/esm/node_modules/langium/lib/dependency-injection.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/documentation/comment-provider.js +0 -15
- package/lib/esm/node_modules/langium/lib/documentation/comment-provider.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/documentation/documentation-provider.js +0 -40
- package/lib/esm/node_modules/langium/lib/documentation/documentation-provider.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/documentation/jsdoc.js +0 -307
- package/lib/esm/node_modules/langium/lib/documentation/jsdoc.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/languages/generated/ast.js +0 -900
- package/lib/esm/node_modules/langium/lib/languages/generated/ast.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/languages/grammar-config.js +0 -17
- package/lib/esm/node_modules/langium/lib/languages/grammar-config.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/async-parser.js +0 -13
- package/lib/esm/node_modules/langium/lib/parser/async-parser.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/completion-parser-builder.js +0 -11
- package/lib/esm/node_modules/langium/lib/parser/completion-parser-builder.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/cst-node-builder.js +0 -164
- package/lib/esm/node_modules/langium/lib/parser/cst-node-builder.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/langium-parser-builder.js +0 -15
- package/lib/esm/node_modules/langium/lib/parser/langium-parser-builder.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/langium-parser.js +0 -397
- package/lib/esm/node_modules/langium/lib/parser/langium-parser.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/lexer.js +0 -54
- package/lib/esm/node_modules/langium/lib/parser/lexer.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/parser-builder-base.js +0 -278
- package/lib/esm/node_modules/langium/lib/parser/parser-builder-base.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/token-builder.js +0 -65
- package/lib/esm/node_modules/langium/lib/parser/token-builder.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/parser/value-converter.js +0 -82
- package/lib/esm/node_modules/langium/lib/parser/value-converter.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/linker.js +0 -195
- package/lib/esm/node_modules/langium/lib/references/linker.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/name-provider.js +0 -17
- package/lib/esm/node_modules/langium/lib/references/name-provider.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/references.js +0 -80
- package/lib/esm/node_modules/langium/lib/references/references.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/scope-computation.js +0 -39
- package/lib/esm/node_modules/langium/lib/references/scope-computation.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/scope-provider.js +0 -38
- package/lib/esm/node_modules/langium/lib/references/scope-provider.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/references/scope.js +0 -46
- package/lib/esm/node_modules/langium/lib/references/scope.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/serializer/hydrator.js +0 -129
- package/lib/esm/node_modules/langium/lib/serializer/hydrator.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/serializer/json-serializer.js +0 -149
- package/lib/esm/node_modules/langium/lib/serializer/json-serializer.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/service-registry.js +0 -41
- package/lib/esm/node_modules/langium/lib/service-registry.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/syntax-tree.js +0 -74
- package/lib/esm/node_modules/langium/lib/syntax-tree.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/ast-utils.js +0 -124
- package/lib/esm/node_modules/langium/lib/utils/ast-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/caching.js +0 -84
- package/lib/esm/node_modules/langium/lib/utils/caching.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/cancellation.js +0 -9
- package/lib/esm/node_modules/langium/lib/utils/cancellation.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/collections.js +0 -89
- package/lib/esm/node_modules/langium/lib/utils/collections.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/cst-utils.js +0 -77
- package/lib/esm/node_modules/langium/lib/utils/cst-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/disposable.js +0 -12
- package/lib/esm/node_modules/langium/lib/utils/disposable.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/errors.js +0 -13
- package/lib/esm/node_modules/langium/lib/utils/errors.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/event.js +0 -9
- package/lib/esm/node_modules/langium/lib/utils/event.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/grammar-loader.js +0 -26
- package/lib/esm/node_modules/langium/lib/utils/grammar-loader.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/grammar-utils.js +0 -221
- package/lib/esm/node_modules/langium/lib/utils/grammar-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/promise-utils.js +0 -31
- package/lib/esm/node_modules/langium/lib/utils/promise-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/regexp-utils.js +0 -146
- package/lib/esm/node_modules/langium/lib/utils/regexp-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/stream.js +0 -331
- package/lib/esm/node_modules/langium/lib/utils/stream.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/utils/uri-utils.js +0 -111
- package/lib/esm/node_modules/langium/lib/utils/uri-utils.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/validation/document-validator.js +0 -213
- package/lib/esm/node_modules/langium/lib/validation/document-validator.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/validation/validation-registry.js +0 -90
- package/lib/esm/node_modules/langium/lib/validation/validation-registry.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/ast-descriptions.js +0 -61
- package/lib/esm/node_modules/langium/lib/workspace/ast-descriptions.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/ast-node-locator.js +0 -32
- package/lib/esm/node_modules/langium/lib/workspace/ast-node-locator.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/configuration.js +0 -55
- package/lib/esm/node_modules/langium/lib/workspace/configuration.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/document-builder.js +0 -200
- package/lib/esm/node_modules/langium/lib/workspace/document-builder.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/documents.js +0 -146
- package/lib/esm/node_modules/langium/lib/workspace/documents.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/file-system-provider.js +0 -37
- package/lib/esm/node_modules/langium/lib/workspace/file-system-provider.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/index-manager.js +0 -53
- package/lib/esm/node_modules/langium/lib/workspace/index-manager.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/workspace-lock.js +0 -46
- package/lib/esm/node_modules/langium/lib/workspace/workspace-lock.js.map +0 -1
- package/lib/esm/node_modules/langium/lib/workspace/workspace-manager.js +0 -70
- package/lib/esm/node_modules/langium/lib/workspace/workspace-manager.js.map +0 -1
- package/lib/esm/node_modules/lodash-es/flatMap.js +0 -10
- package/lib/esm/node_modules/lodash-es/flatMap.js.map +0 -1
- package/lib/esm/node_modules/lodash-es/uniqBy.js +0 -10
- package/lib/esm/node_modules/lodash-es/uniqBy.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/browser.js +0 -11
- package/lib/esm/node_modules/vscode-jsonrpc/browser.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/browser/main.js +0 -56
- package/lib/esm/node_modules/vscode-jsonrpc/lib/browser/main.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/browser/ril.js +0 -124
- package/lib/esm/node_modules/vscode-jsonrpc/lib/browser/ril.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/api.js +0 -341
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/api.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/cancellation.js +0 -61
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/cancellation.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/connection.js +0 -651
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/connection.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/disposable.js +0 -17
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/disposable.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/events.js +0 -68
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/events.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/is.js +0 -38
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/is.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/linkedMap.js +0 -239
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/linkedMap.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js +0 -97
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageBuffer.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageReader.js +0 -133
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageReader.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageWriter.js +0 -89
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messageWriter.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messages.js +0 -165
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/messages.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/ral.js +0 -22
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/ral.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/semaphore.js +0 -48
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/semaphore.js.map +0 -1
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -62
- package/lib/esm/node_modules/vscode-jsonrpc/lib/common/sharedArrayCancellation.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/browser/main.js +0 -32
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/browser/main.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/api.js +0 -40
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/api.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/connection.js +0 -16
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/connection.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/messages.js +0 -35
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/messages.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js +0 -23
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.callHierarchy.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js +0 -19
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.colorProvider.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.configuration.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.declaration.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js +0 -37
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.diagnostic.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js +0 -39
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.fileOperations.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js +0 -19
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.foldingRange.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.implementation.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js +0 -23
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlayHint.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineCompletion.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js +0 -19
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.inlineValue.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.js +0 -678
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.linkedEditingRange.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js +0 -23
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.moniker.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js +0 -130
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.notebook.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js +0 -28
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.progress.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.selectionRange.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js +0 -35
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.semanticTokens.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.showDocument.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js +0 -15
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeDefinition.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js +0 -23
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.typeHierarchy.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js +0 -19
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/protocol.workspaceFolder.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js +0 -46
- package/lib/esm/node_modules/vscode-languageserver-protocol/lib/common/utils/is.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-textdocument/lib/esm/main.js +0 -142
- package/lib/esm/node_modules/vscode-languageserver-textdocument/lib/esm/main.js.map +0 -1
- package/lib/esm/node_modules/vscode-languageserver-types/lib/esm/main.js +0 -1088
- package/lib/esm/node_modules/vscode-languageserver-types/lib/esm/main.js.map +0 -1
- package/lib/esm/node_modules/vscode-uri/lib/esm/index.js +0 -377
- package/lib/esm/node_modules/vscode-uri/lib/esm/index.js.map +0 -1
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { isAstNode as e, isCompositeCstNode as t, isLeafCstNode as n, isReference as r, isRootCstNode as i } from "../syntax-tree.js";
|
|
2
|
-
import { streamAst as a } from "../utils/ast-utils.js";
|
|
3
|
-
import { isAbstractElement as o } from "../languages/generated/ast.js";
|
|
4
|
-
import { streamCst as s } from "../utils/cst-utils.js";
|
|
5
|
-
import { CompositeCstNodeImpl as c, LeafCstNodeImpl as l, RootCstNodeImpl as u } from "../parser/cst-node-builder.js";
|
|
6
|
-
import { BiMap as d } from "../utils/collections.js";
|
|
7
|
-
//#region ../../node_modules/langium/lib/serializer/hydrator.js
|
|
8
|
-
var f = class {
|
|
9
|
-
constructor(e) {
|
|
10
|
-
this.grammarElementIdMap = new d(), this.tokenTypeIdMap = new d(), this.grammar = e.Grammar, this.lexer = e.parser.Lexer, this.linker = e.references.Linker;
|
|
11
|
-
}
|
|
12
|
-
dehydrate(e) {
|
|
13
|
-
return {
|
|
14
|
-
lexerErrors: e.lexerErrors,
|
|
15
|
-
lexerReport: e.lexerReport ? this.dehydrateLexerReport(e.lexerReport) : void 0,
|
|
16
|
-
parserErrors: e.parserErrors.map((e) => ({
|
|
17
|
-
...e,
|
|
18
|
-
message: e.message
|
|
19
|
-
})),
|
|
20
|
-
value: this.dehydrateAstNode(e.value, this.createDehyrationContext(e.value))
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
dehydrateLexerReport(e) {
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
createDehyrationContext(e) {
|
|
27
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
28
|
-
for (let n of a(e)) t.set(n, {});
|
|
29
|
-
if (e.$cstNode) for (let t of s(e.$cstNode)) n.set(t, {});
|
|
30
|
-
return {
|
|
31
|
-
astNodes: t,
|
|
32
|
-
cstNodes: n
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
dehydrateAstNode(t, n) {
|
|
36
|
-
let i = n.astNodes.get(t);
|
|
37
|
-
i.$type = t.$type, i.$containerIndex = t.$containerIndex, i.$containerProperty = t.$containerProperty, t.$cstNode !== void 0 && (i.$cstNode = this.dehydrateCstNode(t.$cstNode, n));
|
|
38
|
-
for (let [a, o] of Object.entries(t)) if (!a.startsWith("$")) if (Array.isArray(o)) {
|
|
39
|
-
let t = [];
|
|
40
|
-
i[a] = t;
|
|
41
|
-
for (let i of o) e(i) ? t.push(this.dehydrateAstNode(i, n)) : r(i) ? t.push(this.dehydrateReference(i, n)) : t.push(i);
|
|
42
|
-
} else e(o) ? i[a] = this.dehydrateAstNode(o, n) : r(o) ? i[a] = this.dehydrateReference(o, n) : o !== void 0 && (i[a] = o);
|
|
43
|
-
return i;
|
|
44
|
-
}
|
|
45
|
-
dehydrateReference(e, t) {
|
|
46
|
-
let n = {};
|
|
47
|
-
return n.$refText = e.$refText, e.$refNode && (n.$refNode = t.cstNodes.get(e.$refNode)), n;
|
|
48
|
-
}
|
|
49
|
-
dehydrateCstNode(e, r) {
|
|
50
|
-
let a = r.cstNodes.get(e);
|
|
51
|
-
return i(e) ? a.fullText = e.fullText : a.grammarSource = this.getGrammarElementId(e.grammarSource), a.hidden = e.hidden, a.astNode = r.astNodes.get(e.astNode), t(e) ? a.content = e.content.map((e) => this.dehydrateCstNode(e, r)) : n(e) && (a.tokenType = e.tokenType.name, a.offset = e.offset, a.length = e.length, a.startLine = e.range.start.line, a.startColumn = e.range.start.character, a.endLine = e.range.end.line, a.endColumn = e.range.end.character), a;
|
|
52
|
-
}
|
|
53
|
-
hydrate(e) {
|
|
54
|
-
let t = e.value, n = this.createHydrationContext(t);
|
|
55
|
-
return "$cstNode" in t && this.hydrateCstNode(t.$cstNode, n), {
|
|
56
|
-
lexerErrors: e.lexerErrors,
|
|
57
|
-
lexerReport: e.lexerReport,
|
|
58
|
-
parserErrors: e.parserErrors,
|
|
59
|
-
value: this.hydrateAstNode(t, n)
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
createHydrationContext(e) {
|
|
63
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
64
|
-
for (let n of a(e)) t.set(n, {});
|
|
65
|
-
let r;
|
|
66
|
-
if (e.$cstNode) for (let t of s(e.$cstNode)) {
|
|
67
|
-
let e;
|
|
68
|
-
"fullText" in t ? (e = new u(t.fullText), r = e) : "content" in t ? e = new c() : "tokenType" in t && (e = this.hydrateCstLeafNode(t)), e && (n.set(t, e), e.root = r);
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
astNodes: t,
|
|
72
|
-
cstNodes: n
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
hydrateAstNode(t, n) {
|
|
76
|
-
let i = n.astNodes.get(t);
|
|
77
|
-
i.$type = t.$type, i.$containerIndex = t.$containerIndex, i.$containerProperty = t.$containerProperty, t.$cstNode && (i.$cstNode = n.cstNodes.get(t.$cstNode));
|
|
78
|
-
for (let [a, o] of Object.entries(t)) if (!a.startsWith("$")) if (Array.isArray(o)) {
|
|
79
|
-
let t = [];
|
|
80
|
-
i[a] = t;
|
|
81
|
-
for (let s of o) e(s) ? t.push(this.setParent(this.hydrateAstNode(s, n), i)) : r(s) ? t.push(this.hydrateReference(s, i, a, n)) : t.push(s);
|
|
82
|
-
} else e(o) ? i[a] = this.setParent(this.hydrateAstNode(o, n), i) : r(o) ? i[a] = this.hydrateReference(o, i, a, n) : o !== void 0 && (i[a] = o);
|
|
83
|
-
return i;
|
|
84
|
-
}
|
|
85
|
-
setParent(e, t) {
|
|
86
|
-
return e.$container = t, e;
|
|
87
|
-
}
|
|
88
|
-
hydrateReference(e, t, n, r) {
|
|
89
|
-
return this.linker.buildReference(t, n, r.cstNodes.get(e.$refNode), e.$refText);
|
|
90
|
-
}
|
|
91
|
-
hydrateCstNode(e, n, r = 0) {
|
|
92
|
-
let i = n.cstNodes.get(e);
|
|
93
|
-
if (typeof e.grammarSource == "number" && (i.grammarSource = this.getGrammarElement(e.grammarSource)), i.astNode = n.astNodes.get(e.astNode), t(i)) for (let t of e.content) {
|
|
94
|
-
let e = this.hydrateCstNode(t, n, r++);
|
|
95
|
-
i.content.push(e);
|
|
96
|
-
}
|
|
97
|
-
return i;
|
|
98
|
-
}
|
|
99
|
-
hydrateCstLeafNode(e) {
|
|
100
|
-
let t = this.getTokenType(e.tokenType), n = e.offset, r = e.length, i = e.startLine, a = e.startColumn, o = e.endLine, s = e.endColumn, c = e.hidden;
|
|
101
|
-
return new l(n, r, {
|
|
102
|
-
start: {
|
|
103
|
-
line: i,
|
|
104
|
-
character: a
|
|
105
|
-
},
|
|
106
|
-
end: {
|
|
107
|
-
line: o,
|
|
108
|
-
character: s
|
|
109
|
-
}
|
|
110
|
-
}, t, c);
|
|
111
|
-
}
|
|
112
|
-
getTokenType(e) {
|
|
113
|
-
return this.lexer.definition[e];
|
|
114
|
-
}
|
|
115
|
-
getGrammarElementId(e) {
|
|
116
|
-
if (e) return this.grammarElementIdMap.size === 0 && this.createGrammarElementIdMap(), this.grammarElementIdMap.get(e);
|
|
117
|
-
}
|
|
118
|
-
getGrammarElement(e) {
|
|
119
|
-
return this.grammarElementIdMap.size === 0 && this.createGrammarElementIdMap(), this.grammarElementIdMap.getKey(e);
|
|
120
|
-
}
|
|
121
|
-
createGrammarElementIdMap() {
|
|
122
|
-
let e = 0;
|
|
123
|
-
for (let t of a(this.grammar)) o(t) && this.grammarElementIdMap.set(t, e++);
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
//#endregion
|
|
127
|
-
export { f as DefaultHydrator };
|
|
128
|
-
|
|
129
|
-
//# sourceMappingURL=hydrator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hydrator.js","names":[],"sources":["../../../../../../../../node_modules/langium/lib/serializer/hydrator.js"],"sourcesContent":["/******************************************************************************\n * Copyright 2024 TypeFox GmbH\n * This program and the accompanying materials are made available under the\n * terms of the MIT License, which is available in the project root.\n ******************************************************************************/\nimport { CompositeCstNodeImpl, LeafCstNodeImpl, RootCstNodeImpl } from '../parser/cst-node-builder.js';\nimport { isAbstractElement } from '../languages/generated/ast.js';\nimport { isRootCstNode, isCompositeCstNode, isLeafCstNode, isAstNode, isReference } from '../syntax-tree.js';\nimport { streamAst } from '../utils/ast-utils.js';\nimport { BiMap } from '../utils/collections.js';\nimport { streamCst } from '../utils/cst-utils.js';\nexport class DefaultHydrator {\n constructor(services) {\n this.grammarElementIdMap = new BiMap();\n this.tokenTypeIdMap = new BiMap();\n this.grammar = services.Grammar;\n this.lexer = services.parser.Lexer;\n this.linker = services.references.Linker;\n }\n dehydrate(result) {\n return {\n lexerErrors: result.lexerErrors,\n lexerReport: result.lexerReport ? this.dehydrateLexerReport(result.lexerReport) : undefined,\n // We need to create shallow copies of the errors\n // The original errors inherit from the `Error` class, which is not transferable across worker threads\n parserErrors: result.parserErrors.map(e => ({ ...e, message: e.message })),\n value: this.dehydrateAstNode(result.value, this.createDehyrationContext(result.value))\n };\n }\n dehydrateLexerReport(lexerReport) {\n // By default, lexer reports are serializable\n return lexerReport;\n }\n createDehyrationContext(node) {\n const astNodes = new Map();\n const cstNodes = new Map();\n for (const astNode of streamAst(node)) {\n astNodes.set(astNode, {});\n }\n if (node.$cstNode) {\n for (const cstNode of streamCst(node.$cstNode)) {\n cstNodes.set(cstNode, {});\n }\n }\n return {\n astNodes,\n cstNodes\n };\n }\n dehydrateAstNode(node, context) {\n const obj = context.astNodes.get(node);\n obj.$type = node.$type;\n obj.$containerIndex = node.$containerIndex;\n obj.$containerProperty = node.$containerProperty;\n if (node.$cstNode !== undefined) {\n obj.$cstNode = this.dehydrateCstNode(node.$cstNode, context);\n }\n for (const [name, value] of Object.entries(node)) {\n if (name.startsWith('$')) {\n continue;\n }\n if (Array.isArray(value)) {\n const arr = [];\n obj[name] = arr;\n for (const item of value) {\n if (isAstNode(item)) {\n arr.push(this.dehydrateAstNode(item, context));\n }\n else if (isReference(item)) {\n arr.push(this.dehydrateReference(item, context));\n }\n else {\n arr.push(item);\n }\n }\n }\n else if (isAstNode(value)) {\n obj[name] = this.dehydrateAstNode(value, context);\n }\n else if (isReference(value)) {\n obj[name] = this.dehydrateReference(value, context);\n }\n else if (value !== undefined) {\n obj[name] = value;\n }\n }\n return obj;\n }\n dehydrateReference(reference, context) {\n const obj = {};\n obj.$refText = reference.$refText;\n if (reference.$refNode) {\n obj.$refNode = context.cstNodes.get(reference.$refNode);\n }\n return obj;\n }\n dehydrateCstNode(node, context) {\n const cstNode = context.cstNodes.get(node);\n if (isRootCstNode(node)) {\n cstNode.fullText = node.fullText;\n }\n else {\n // Note: This returns undefined for hidden nodes (i.e. comments)\n cstNode.grammarSource = this.getGrammarElementId(node.grammarSource);\n }\n cstNode.hidden = node.hidden;\n cstNode.astNode = context.astNodes.get(node.astNode);\n if (isCompositeCstNode(node)) {\n cstNode.content = node.content.map(child => this.dehydrateCstNode(child, context));\n }\n else if (isLeafCstNode(node)) {\n cstNode.tokenType = node.tokenType.name;\n cstNode.offset = node.offset;\n cstNode.length = node.length;\n cstNode.startLine = node.range.start.line;\n cstNode.startColumn = node.range.start.character;\n cstNode.endLine = node.range.end.line;\n cstNode.endColumn = node.range.end.character;\n }\n return cstNode;\n }\n hydrate(result) {\n const node = result.value;\n const context = this.createHydrationContext(node);\n if ('$cstNode' in node) {\n this.hydrateCstNode(node.$cstNode, context);\n }\n return {\n lexerErrors: result.lexerErrors,\n lexerReport: result.lexerReport,\n parserErrors: result.parserErrors,\n value: this.hydrateAstNode(node, context)\n };\n }\n createHydrationContext(node) {\n const astNodes = new Map();\n const cstNodes = new Map();\n for (const astNode of streamAst(node)) {\n astNodes.set(astNode, {});\n }\n let root;\n if (node.$cstNode) {\n for (const cstNode of streamCst(node.$cstNode)) {\n let cst;\n if ('fullText' in cstNode) {\n cst = new RootCstNodeImpl(cstNode.fullText);\n root = cst;\n }\n else if ('content' in cstNode) {\n cst = new CompositeCstNodeImpl();\n }\n else if ('tokenType' in cstNode) {\n cst = this.hydrateCstLeafNode(cstNode);\n }\n if (cst) {\n cstNodes.set(cstNode, cst);\n cst.root = root;\n }\n }\n }\n return {\n astNodes,\n cstNodes\n };\n }\n hydrateAstNode(node, context) {\n const astNode = context.astNodes.get(node);\n astNode.$type = node.$type;\n astNode.$containerIndex = node.$containerIndex;\n astNode.$containerProperty = node.$containerProperty;\n if (node.$cstNode) {\n astNode.$cstNode = context.cstNodes.get(node.$cstNode);\n }\n for (const [name, value] of Object.entries(node)) {\n if (name.startsWith('$')) {\n continue;\n }\n if (Array.isArray(value)) {\n const arr = [];\n astNode[name] = arr;\n for (const item of value) {\n if (isAstNode(item)) {\n arr.push(this.setParent(this.hydrateAstNode(item, context), astNode));\n }\n else if (isReference(item)) {\n arr.push(this.hydrateReference(item, astNode, name, context));\n }\n else {\n arr.push(item);\n }\n }\n }\n else if (isAstNode(value)) {\n astNode[name] = this.setParent(this.hydrateAstNode(value, context), astNode);\n }\n else if (isReference(value)) {\n astNode[name] = this.hydrateReference(value, astNode, name, context);\n }\n else if (value !== undefined) {\n astNode[name] = value;\n }\n }\n return astNode;\n }\n setParent(node, parent) {\n node.$container = parent;\n return node;\n }\n hydrateReference(reference, node, name, context) {\n return this.linker.buildReference(node, name, context.cstNodes.get(reference.$refNode), reference.$refText);\n }\n hydrateCstNode(cstNode, context, num = 0) {\n const cstNodeObj = context.cstNodes.get(cstNode);\n if (typeof cstNode.grammarSource === 'number') {\n cstNodeObj.grammarSource = this.getGrammarElement(cstNode.grammarSource);\n }\n cstNodeObj.astNode = context.astNodes.get(cstNode.astNode);\n if (isCompositeCstNode(cstNodeObj)) {\n for (const child of cstNode.content) {\n const hydrated = this.hydrateCstNode(child, context, num++);\n cstNodeObj.content.push(hydrated);\n }\n }\n return cstNodeObj;\n }\n hydrateCstLeafNode(cstNode) {\n const tokenType = this.getTokenType(cstNode.tokenType);\n const offset = cstNode.offset;\n const length = cstNode.length;\n const startLine = cstNode.startLine;\n const startColumn = cstNode.startColumn;\n const endLine = cstNode.endLine;\n const endColumn = cstNode.endColumn;\n const hidden = cstNode.hidden;\n const node = new LeafCstNodeImpl(offset, length, {\n start: {\n line: startLine,\n character: startColumn\n },\n end: {\n line: endLine,\n character: endColumn\n }\n }, tokenType, hidden);\n return node;\n }\n getTokenType(name) {\n return this.lexer.definition[name];\n }\n getGrammarElementId(node) {\n if (!node) {\n return undefined;\n }\n if (this.grammarElementIdMap.size === 0) {\n this.createGrammarElementIdMap();\n }\n return this.grammarElementIdMap.get(node);\n }\n getGrammarElement(id) {\n if (this.grammarElementIdMap.size === 0) {\n this.createGrammarElementIdMap();\n }\n const element = this.grammarElementIdMap.getKey(id);\n return element;\n }\n createGrammarElementIdMap() {\n let id = 0;\n for (const element of streamAst(this.grammar)) {\n if (isAbstractElement(element)) {\n this.grammarElementIdMap.set(element, id++);\n }\n }\n }\n}\n//# sourceMappingURL=hydrator.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAWA,IAAa,IAAb,MAA6B;CACzB,YAAY,GAAU;EAKlB,AAJA,KAAK,sBAAsB,IAAI,GAAO,EACtC,KAAK,iBAAiB,IAAI,GAAO,EACjC,KAAK,UAAU,EAAS,SACxB,KAAK,QAAQ,EAAS,OAAO,OAC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AM,KAAW,EAAU,KAAK,QAAQ,EACzC,AAAI,EAAkB,EAAQ,IAC1B,KAAK,oBAAoB,IAAI,GAAS,IAAK"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { isAstNode as e, isMultiReference as t, isReference as n } from "../syntax-tree.js";
|
|
2
|
-
import { getDocument as r } from "../utils/ast-utils.js";
|
|
3
|
-
import { findNodesForProperty as i } from "../utils/grammar-utils.js";
|
|
4
|
-
import { URI as a } from "../../../vscode-uri/lib/esm/index.js";
|
|
5
|
-
//#region ../../node_modules/langium/lib/serializer/json-serializer.js
|
|
6
|
-
function o(e) {
|
|
7
|
-
return typeof e.$comment == "string";
|
|
8
|
-
}
|
|
9
|
-
function s(e) {
|
|
10
|
-
return typeof e == "object" && !!e && ("$ref" in e || "$error" in e);
|
|
11
|
-
}
|
|
12
|
-
var c = class {
|
|
13
|
-
constructor(e) {
|
|
14
|
-
this.ignoreProperties = new Set([
|
|
15
|
-
"$container",
|
|
16
|
-
"$containerProperty",
|
|
17
|
-
"$containerIndex",
|
|
18
|
-
"$document",
|
|
19
|
-
"$cstNode"
|
|
20
|
-
]), this.langiumDocuments = e.shared.workspace.LangiumDocuments, this.astNodeLocator = e.workspace.AstNodeLocator, this.nameProvider = e.references.NameProvider, this.commentProvider = e.documentation.CommentProvider;
|
|
21
|
-
}
|
|
22
|
-
serialize(e, t) {
|
|
23
|
-
let n = t ?? {}, i = t?.replacer, a = (e, t) => this.replacer(e, t, n), o = i ? (e, t) => i(e, t, a) : a;
|
|
24
|
-
try {
|
|
25
|
-
return this.currentDocument = r(e), JSON.stringify(e, o, t?.space);
|
|
26
|
-
} finally {
|
|
27
|
-
this.currentDocument = void 0;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
deserialize(e, t) {
|
|
31
|
-
let n = t ?? {}, r = JSON.parse(e);
|
|
32
|
-
return this.linkNode(r, r, n), r;
|
|
33
|
-
}
|
|
34
|
-
replacer(i, a, { refText: o, sourceText: s, textRegions: c, comments: l, uriConverter: u }) {
|
|
35
|
-
if (!this.ignoreProperties.has(i)) if (n(a)) {
|
|
36
|
-
let e = a.ref, t = o ? a.$refText : void 0;
|
|
37
|
-
if (e) {
|
|
38
|
-
let n = r(e), i = "";
|
|
39
|
-
this.currentDocument && this.currentDocument !== n && (i = u ? u(n.uri, e) : n.uri.toString());
|
|
40
|
-
let a = this.astNodeLocator.getAstNodePath(e);
|
|
41
|
-
return {
|
|
42
|
-
$ref: `${i}#${a}`,
|
|
43
|
-
$refText: t
|
|
44
|
-
};
|
|
45
|
-
} else return {
|
|
46
|
-
$error: a.error?.message ?? "Could not resolve reference",
|
|
47
|
-
$refText: t
|
|
48
|
-
};
|
|
49
|
-
} else if (t(a)) {
|
|
50
|
-
let e = o ? a.$refText : void 0, t = [];
|
|
51
|
-
for (let e of a.items) {
|
|
52
|
-
let n = e.ref, i = r(e.ref), a = "";
|
|
53
|
-
this.currentDocument && this.currentDocument !== i && (a = u ? u(i.uri, n) : i.uri.toString());
|
|
54
|
-
let o = this.astNodeLocator.getAstNodePath(n);
|
|
55
|
-
t.push(`${a}#${o}`);
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
$refs: t,
|
|
59
|
-
$refText: e
|
|
60
|
-
};
|
|
61
|
-
} else if (e(a)) {
|
|
62
|
-
let e;
|
|
63
|
-
if (c && (e = this.addAstNodeRegionWithAssignmentsTo({ ...a }), (!i || a.$document) && e?.$textRegion && (e.$textRegion.documentURI = this.currentDocument?.uri.toString())), s && !i && (e ??= { ...a }, e.$sourceText = a.$cstNode?.text), l) {
|
|
64
|
-
e ??= { ...a };
|
|
65
|
-
let t = this.commentProvider.getComment(a);
|
|
66
|
-
t && (e.$comment = t.replace(/\r/g, ""));
|
|
67
|
-
}
|
|
68
|
-
return e ?? a;
|
|
69
|
-
} else return a;
|
|
70
|
-
}
|
|
71
|
-
addAstNodeRegionWithAssignmentsTo(e) {
|
|
72
|
-
let t = (e) => ({
|
|
73
|
-
offset: e.offset,
|
|
74
|
-
end: e.end,
|
|
75
|
-
length: e.length,
|
|
76
|
-
range: e.range
|
|
77
|
-
});
|
|
78
|
-
if (e.$cstNode) {
|
|
79
|
-
let n = e.$textRegion = t(e.$cstNode), r = n.assignments = {};
|
|
80
|
-
return Object.keys(e).filter((e) => !e.startsWith("$")).forEach((n) => {
|
|
81
|
-
let a = i(e.$cstNode, n).map(t);
|
|
82
|
-
a.length !== 0 && (r[n] = a);
|
|
83
|
-
}), e;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
linkNode(t, n, r, i, a, o) {
|
|
87
|
-
for (let [i, a] of Object.entries(t)) if (Array.isArray(a)) for (let o = 0; o < a.length; o++) {
|
|
88
|
-
let c = a[o];
|
|
89
|
-
s(c) ? a[o] = this.reviveReference(t, i, n, c, r) : e(c) && this.linkNode(c, n, r, t, i, o);
|
|
90
|
-
}
|
|
91
|
-
else s(a) ? t[i] = this.reviveReference(t, i, n, a, r) : e(a) && this.linkNode(a, n, r, t, i);
|
|
92
|
-
let c = t;
|
|
93
|
-
c.$container = i, c.$containerProperty = a, c.$containerIndex = o;
|
|
94
|
-
}
|
|
95
|
-
reviveReference(t, n, r, i, a) {
|
|
96
|
-
let o = i.$refText, s = i.$error, c;
|
|
97
|
-
if (i.$ref) {
|
|
98
|
-
let t = this.getRefNode(r, i.$ref, a.uriConverter);
|
|
99
|
-
if (e(t)) return o ||= this.nameProvider.getName(t), {
|
|
100
|
-
$refText: o ?? "",
|
|
101
|
-
ref: t
|
|
102
|
-
};
|
|
103
|
-
s = t;
|
|
104
|
-
} else if (i.$refs) {
|
|
105
|
-
let t = [];
|
|
106
|
-
for (let n of i.$refs) {
|
|
107
|
-
let i = this.getRefNode(r, n, a.uriConverter);
|
|
108
|
-
e(i) && t.push({ ref: i });
|
|
109
|
-
}
|
|
110
|
-
if (t.length === 0) c = {
|
|
111
|
-
$refText: o ?? "",
|
|
112
|
-
items: t
|
|
113
|
-
}, s ??= "Could not resolve multi-reference";
|
|
114
|
-
else return {
|
|
115
|
-
$refText: o ?? "",
|
|
116
|
-
items: t
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
if (s) return c ??= {
|
|
120
|
-
$refText: o ?? "",
|
|
121
|
-
ref: void 0
|
|
122
|
-
}, c.error = {
|
|
123
|
-
info: {
|
|
124
|
-
container: t,
|
|
125
|
-
property: n,
|
|
126
|
-
reference: c
|
|
127
|
-
},
|
|
128
|
-
message: s
|
|
129
|
-
}, c;
|
|
130
|
-
}
|
|
131
|
-
getRefNode(e, t, n) {
|
|
132
|
-
try {
|
|
133
|
-
let r = t.indexOf("#");
|
|
134
|
-
if (r === 0) return this.astNodeLocator.getAstNode(e, t.substring(1)) || "Could not resolve path: " + t;
|
|
135
|
-
if (r < 0) {
|
|
136
|
-
let e = n ? n(t) : a.parse(t), r = this.langiumDocuments.getDocument(e);
|
|
137
|
-
return r ? r.parseResult.value : "Could not find document for URI: " + t;
|
|
138
|
-
}
|
|
139
|
-
let i = n ? n(t.substring(0, r)) : a.parse(t.substring(0, r)), o = this.langiumDocuments.getDocument(i);
|
|
140
|
-
return o ? r === t.length - 1 ? o.parseResult.value : this.astNodeLocator.getAstNode(o.parseResult.value, t.substring(r + 1)) || "Could not resolve URI: " + t : "Could not find document for URI: " + t;
|
|
141
|
-
} catch (e) {
|
|
142
|
-
return String(e);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
//#endregion
|
|
147
|
-
export { c as DefaultJsonSerializer, o as isAstNodeWithComment };
|
|
148
|
-
|
|
149
|
-
//# sourceMappingURL=json-serializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-serializer.js","names":[],"sources":["../../../../../../../../node_modules/langium/lib/serializer/json-serializer.js"],"sourcesContent":["/******************************************************************************\n * Copyright 2021 TypeFox GmbH\n * This program and the accompanying materials are made available under the\n * terms of the MIT License, which is available in the project root.\n ******************************************************************************/\nimport { URI } from 'vscode-uri';\nimport { isAstNode, isMultiReference, isReference } from '../syntax-tree.js';\nimport { getDocument } from '../utils/ast-utils.js';\nimport { findNodesForProperty } from '../utils/grammar-utils.js';\nexport function isAstNodeWithComment(node) {\n return typeof node.$comment === 'string';\n}\nfunction isIntermediateReference(obj) {\n return typeof obj === 'object' && !!obj && ('$ref' in obj || '$error' in obj);\n}\nexport class DefaultJsonSerializer {\n constructor(services) {\n /** The set of AstNode properties to be ignored by the serializer. */\n this.ignoreProperties = new Set(['$container', '$containerProperty', '$containerIndex', '$document', '$cstNode']);\n this.langiumDocuments = services.shared.workspace.LangiumDocuments;\n this.astNodeLocator = services.workspace.AstNodeLocator;\n this.nameProvider = services.references.NameProvider;\n this.commentProvider = services.documentation.CommentProvider;\n }\n serialize(node, options) {\n const serializeOptions = options ?? {};\n const specificReplacer = options?.replacer;\n const defaultReplacer = (key, value) => this.replacer(key, value, serializeOptions);\n const replacer = specificReplacer ? (key, value) => specificReplacer(key, value, defaultReplacer) : defaultReplacer;\n try {\n this.currentDocument = getDocument(node);\n return JSON.stringify(node, replacer, options?.space);\n }\n finally {\n this.currentDocument = undefined;\n }\n }\n deserialize(content, options) {\n const deserializeOptions = options ?? {};\n const root = JSON.parse(content);\n this.linkNode(root, root, deserializeOptions);\n return root;\n }\n replacer(key, value, { refText, sourceText, textRegions, comments, uriConverter }) {\n if (this.ignoreProperties.has(key)) {\n return undefined;\n }\n else if (isReference(value)) {\n const refValue = value.ref;\n const $refText = refText ? value.$refText : undefined;\n if (refValue) {\n const targetDocument = getDocument(refValue);\n let targetUri = '';\n if (this.currentDocument && this.currentDocument !== targetDocument) {\n if (uriConverter) {\n targetUri = uriConverter(targetDocument.uri, refValue);\n }\n else {\n targetUri = targetDocument.uri.toString();\n }\n }\n const targetPath = this.astNodeLocator.getAstNodePath(refValue);\n return {\n $ref: `${targetUri}#${targetPath}`,\n $refText\n };\n }\n else {\n return {\n $error: value.error?.message ?? 'Could not resolve reference',\n $refText\n };\n }\n }\n else if (isMultiReference(value)) {\n const $refText = refText ? value.$refText : undefined;\n const $refs = [];\n for (const item of value.items) {\n const refValue = item.ref;\n const targetDocument = getDocument(item.ref);\n let targetUri = '';\n if (this.currentDocument && this.currentDocument !== targetDocument) {\n if (uriConverter) {\n targetUri = uriConverter(targetDocument.uri, refValue);\n }\n else {\n targetUri = targetDocument.uri.toString();\n }\n }\n const targetPath = this.astNodeLocator.getAstNodePath(refValue);\n $refs.push(`${targetUri}#${targetPath}`);\n }\n return {\n $refs,\n $refText\n };\n }\n else if (isAstNode(value)) {\n let astNode = undefined;\n if (textRegions) {\n astNode = this.addAstNodeRegionWithAssignmentsTo({ ...value });\n if ((!key || value.$document) && astNode?.$textRegion) {\n // The document URI is added to the root node of the resulting JSON tree\n astNode.$textRegion.documentURI = this.currentDocument?.uri.toString();\n }\n }\n if (sourceText && !key) {\n astNode ?? (astNode = { ...value });\n astNode.$sourceText = value.$cstNode?.text;\n }\n if (comments) {\n astNode ?? (astNode = { ...value });\n const comment = this.commentProvider.getComment(value);\n if (comment) {\n astNode.$comment = comment.replace(/\\r/g, '');\n }\n }\n return astNode ?? value;\n }\n else {\n return value;\n }\n }\n addAstNodeRegionWithAssignmentsTo(node) {\n const createDocumentSegment = cstNode => ({\n offset: cstNode.offset,\n end: cstNode.end,\n length: cstNode.length,\n range: cstNode.range,\n });\n if (node.$cstNode) {\n const textRegion = node.$textRegion = createDocumentSegment(node.$cstNode);\n const assignments = textRegion.assignments = {};\n Object.keys(node).filter(key => !key.startsWith('$')).forEach(key => {\n const propertyAssignments = findNodesForProperty(node.$cstNode, key).map(createDocumentSegment);\n if (propertyAssignments.length !== 0) {\n assignments[key] = propertyAssignments;\n }\n });\n return node;\n }\n return undefined;\n }\n linkNode(node, root, options, container, containerProperty, containerIndex) {\n for (const [propertyName, item] of Object.entries(node)) {\n if (Array.isArray(item)) {\n for (let index = 0; index < item.length; index++) {\n const element = item[index];\n if (isIntermediateReference(element)) {\n item[index] = this.reviveReference(node, propertyName, root, element, options);\n }\n else if (isAstNode(element)) {\n this.linkNode(element, root, options, node, propertyName, index);\n }\n }\n }\n else if (isIntermediateReference(item)) {\n node[propertyName] = this.reviveReference(node, propertyName, root, item, options);\n }\n else if (isAstNode(item)) {\n this.linkNode(item, root, options, node, propertyName);\n }\n }\n const mutable = node;\n mutable.$container = container;\n mutable.$containerProperty = containerProperty;\n mutable.$containerIndex = containerIndex;\n }\n reviveReference(container, property, root, reference, options) {\n let refText = reference.$refText;\n let error = reference.$error;\n let ref;\n if (reference.$ref) {\n const refNode = this.getRefNode(root, reference.$ref, options.uriConverter);\n if (isAstNode(refNode)) {\n if (!refText) {\n refText = this.nameProvider.getName(refNode);\n }\n return {\n $refText: refText ?? '',\n ref: refNode\n };\n }\n else {\n error = refNode;\n }\n }\n else if (reference.$refs) {\n const refs = [];\n for (const refUri of reference.$refs) {\n const refNode = this.getRefNode(root, refUri, options.uriConverter);\n if (isAstNode(refNode)) {\n refs.push({ ref: refNode });\n }\n }\n if (refs.length === 0) {\n ref = {\n $refText: refText ?? '',\n items: refs\n };\n error ?? (error = 'Could not resolve multi-reference');\n }\n else {\n return {\n $refText: refText ?? '',\n items: refs\n };\n }\n }\n if (error) {\n ref ?? (ref = {\n $refText: refText ?? '',\n ref: undefined\n });\n ref.error = {\n info: {\n container,\n property,\n reference: ref\n },\n message: error\n };\n return ref;\n }\n else {\n return undefined;\n }\n }\n getRefNode(root, uri, uriConverter) {\n try {\n const fragmentIndex = uri.indexOf('#');\n if (fragmentIndex === 0) {\n const node = this.astNodeLocator.getAstNode(root, uri.substring(1));\n if (!node) {\n return 'Could not resolve path: ' + uri;\n }\n return node;\n }\n if (fragmentIndex < 0) {\n const documentUri = uriConverter ? uriConverter(uri) : URI.parse(uri);\n const document = this.langiumDocuments.getDocument(documentUri);\n if (!document) {\n return 'Could not find document for URI: ' + uri;\n }\n return document.parseResult.value;\n }\n const documentUri = uriConverter ? uriConverter(uri.substring(0, fragmentIndex)) : URI.parse(uri.substring(0, fragmentIndex));\n const document = this.langiumDocuments.getDocument(documentUri);\n if (!document) {\n return 'Could not find document for URI: ' + uri;\n }\n if (fragmentIndex === uri.length - 1) {\n return document.parseResult.value;\n }\n const node = this.astNodeLocator.getAstNode(document.parseResult.value, uri.substring(fragmentIndex + 1));\n if (!node) {\n return 'Could not resolve URI: ' + uri;\n }\n return node;\n }\n catch (err) {\n return String(err);\n }\n }\n}\n//# sourceMappingURL=json-serializer.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;AASA,SAAgB,EAAqB,GAAM;CACvC,OAAO,OAAO,EAAK,YAAa;;AAEpC,SAAS,EAAwB,GAAK;CAClC,OAAO,OAAO,KAAQ,YAAY,CAAC,CAAC,MAAQ,UAAU,KAAO,YAAY;;AAE7E,IAAa,IAAb,MAAmC;CAC/B,YAAY,GAAU;EAMlB,AAJA,KAAK,mBAAmB,IAAI,IAAI;GAAC;GAAc;GAAsB;GAAmB;GAAa;GAAW,CAAC,EACjH,KAAK,mBAAmB,EAAS,OAAO,UAAU,kBAClD,KAAK,iBAAiB,EAAS,UAAU,gBACzC,KAAK,eAAe,EAAS,WAAW,cACxC,KAAK,kBAAkB,EAAS,cAAc;;CAElD,UAAU,GAAM,GAAS;EACrB,IAAM,IAAmB,KAAW,EAAE,EAChC,IAAmB,GAAS,UAC5B,KAAmB,GAAK,MAAU,KAAK,SAAS,GAAK,GAAO,EAAiB,EAC7E,IAAW,KAAoB,GAAK,MAAU,EAAiB,GAAK,GAAO,EAAgB,GAAG;EACpG,IAAI;GAEA,OADA,KAAK,kBAAkB,EAAY,EAAK,EACjC,KAAK,UAAU,GAAM,GAAU,GAAS,MAAM;YAEjD;GACJ,KAAK,kBAAkB,KAAA;;;CAG/B,YAAY,GAAS,GAAS;EAC1B,IAAM,IAAqB,KAAW,EAAE,EAClC,IAAO,KAAK,MAAM,EAAQ;EAEhC,OADA,KAAK,SAAS,GAAM,GAAM,EAAmB,EACtC;;CAEX,SAAS,GAAK,GAAO,EAAE,YAAS,eAAY,gBAAa,aAA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AU,GAAG,EAAc,CAAC,EACvH,IAAW,KAAK,iBAAiB,YAAY,EAAY;GAW/D,OAVK,IAGD,MAAkB,EAAI,SAAS,IACxB,EAAS,YAAY,QAEnB,KAAK,eAAe,WAAW,EAAS,YAAY,OAAO,EAAI,UAAU,IAAgB,EAAE,CACnG,IACM,4BAA4B,IAP5B,sCAAsC;WAW9C,GAAK;GACR,OAAO,OAAO,EAAI"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { UriUtils as e } from "./utils/uri-utils.js";
|
|
2
|
-
//#region ../../node_modules/langium/lib/service-registry.js
|
|
3
|
-
var t = class {
|
|
4
|
-
get map() {
|
|
5
|
-
return this.fileExtensionMap;
|
|
6
|
-
}
|
|
7
|
-
constructor(e) {
|
|
8
|
-
this.languageIdMap = /* @__PURE__ */ new Map(), this.fileExtensionMap = /* @__PURE__ */ new Map(), this.fileNameMap = /* @__PURE__ */ new Map(), this.textDocuments = e?.workspace.TextDocuments;
|
|
9
|
-
}
|
|
10
|
-
register(e) {
|
|
11
|
-
let t = e.LanguageMetaData;
|
|
12
|
-
for (let n of t.fileExtensions) this.fileExtensionMap.has(n) && console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`), this.fileExtensionMap.set(n, e);
|
|
13
|
-
if (t.fileNames) for (let n of t.fileNames) this.fileNameMap.has(n) && console.warn(`The file name ${n} is used by multiple languages. It is now assigned to '${t.languageId}'.`), this.fileNameMap.set(n, e);
|
|
14
|
-
this.languageIdMap.set(t.languageId, e);
|
|
15
|
-
}
|
|
16
|
-
getServices(t) {
|
|
17
|
-
if (this.languageIdMap.size === 0) throw Error("The service registry is empty. Use `register` to register the services of a language.");
|
|
18
|
-
let n = this.textDocuments?.get(t)?.languageId;
|
|
19
|
-
if (n !== void 0) {
|
|
20
|
-
let e = this.languageIdMap.get(n);
|
|
21
|
-
if (e) return e;
|
|
22
|
-
}
|
|
23
|
-
let r = e.extname(t), i = e.basename(t), a = this.fileNameMap.get(i) ?? this.fileExtensionMap.get(r);
|
|
24
|
-
if (!a) throw Error(n ? `The service registry contains no services for the extension '${r}' for language '${n}'.` : `The service registry contains no services for the extension '${r}'.`);
|
|
25
|
-
return a;
|
|
26
|
-
}
|
|
27
|
-
hasServices(e) {
|
|
28
|
-
try {
|
|
29
|
-
return this.getServices(e), !0;
|
|
30
|
-
} catch {
|
|
31
|
-
return !1;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
get all() {
|
|
35
|
-
return Array.from(this.languageIdMap.values());
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { t as DefaultServiceRegistry };
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=service-registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-registry.js","names":[],"sources":["../../../../../../../node_modules/langium/lib/service-registry.js"],"sourcesContent":["/******************************************************************************\n * Copyright 2021 TypeFox GmbH\n * This program and the accompanying materials are made available under the\n * terms of the MIT License, which is available in the project root.\n ******************************************************************************/\nimport { UriUtils } from './utils/uri-utils.js';\n/**\n * Generic registry for Langium services, but capable of being used with extending service sets as well (such as the lsp-complete LangiumCoreServices set)\n */\nexport class DefaultServiceRegistry {\n /**\n * @deprecated Since 3.1.0. Use the new `fileExtensionMap` (or `languageIdMap`) property instead.\n */\n get map() {\n return this.fileExtensionMap;\n }\n constructor(services) {\n this.languageIdMap = new Map();\n this.fileExtensionMap = new Map();\n this.fileNameMap = new Map();\n this.textDocuments = services?.workspace.TextDocuments;\n }\n register(language) {\n const data = language.LanguageMetaData;\n for (const ext of data.fileExtensions) {\n if (this.fileExtensionMap.has(ext)) {\n console.warn(`The file extension ${ext} is used by multiple languages. It is now assigned to '${data.languageId}'.`);\n }\n this.fileExtensionMap.set(ext, language);\n }\n if (data.fileNames) {\n for (const name of data.fileNames) {\n if (this.fileNameMap.has(name)) {\n console.warn(`The file name ${name} is used by multiple languages. It is now assigned to '${data.languageId}'.`);\n }\n this.fileNameMap.set(name, language);\n }\n }\n this.languageIdMap.set(data.languageId, language);\n }\n getServices(uri) {\n if (this.languageIdMap.size === 0) {\n throw new Error('The service registry is empty. Use `register` to register the services of a language.');\n }\n const languageId = this.textDocuments?.get(uri)?.languageId;\n if (languageId !== undefined) {\n const services = this.languageIdMap.get(languageId);\n if (services) {\n return services;\n }\n }\n const ext = UriUtils.extname(uri);\n const name = UriUtils.basename(uri);\n const services = this.fileNameMap.get(name) ?? this.fileExtensionMap.get(ext);\n if (!services) {\n if (languageId) {\n throw new Error(`The service registry contains no services for the extension '${ext}' for language '${languageId}'.`);\n }\n else {\n throw new Error(`The service registry contains no services for the extension '${ext}'.`);\n }\n }\n return services;\n }\n hasServices(uri) {\n try {\n this.getServices(uri);\n return true;\n }\n catch {\n return false;\n }\n }\n get all() {\n return Array.from(this.languageIdMap.values());\n }\n}\n//# sourceMappingURL=service-registry.js.map"],"x_google_ignoreList":[0],"mappings":";;AASA,IAAa,IAAb,MAAoC;CAIhC,IAAI,MAAM;EACN,OAAO,KAAK;;CAEhB,YAAY,GAAU;EAIlB,AAHA,KAAK,gCAAgB,IAAI,KAAK,EAC9B,KAAK,mCAAmB,IAAI,KAAK,EACjC,KAAK,8BAAc,IAAI,KAAK,EAC5B,KAAK,gBAAgB,GAAU,UAAU;;CAE7C,SAAS,GAAU;EACf,IAAM,IAAO,EAAS;EACtB,KAAK,IAAM,KAAO,EAAK,gBAInB,AAHI,KAAK,iBAAiB,IAAI,EAAI,IAC9B,QAAQ,KAAK,sBAAsB,EAAI,yDAAyD,EAAK,WAAW,IAAI,EAExH,KAAK,iBAAiB,IAAI,GAAK,EAAS;EAE5C,IAAI,EAAK,WACL,KAAK,IAAM,KAAQ,EAAK,WAIpB,AAHI,KAAK,YAAY,IAAI,EAAK,IAC1B,QAAQ,KAAK,iBAAiB,EAAK,yDAAyD,EAAK,WAAW,IAAI,EAEpH,KAAK,YAAY,IAAI,GAAM,EAAS;EAG5C,KAAK,cAAc,IAAI,EAAK,YAAY,EAAS;;CAErD,YAAY,GAAK;EACb,IAAI,KAAK,cAAc,SAAS,GAC5B,MAAU,MAAM,wFAAwF;EAE5G,IAAM,IAAa,KAAK,eAAe,IAAI,EAAI,EAAE;EACjD,IAAI,MAAe,KAAA,GAAW;GAC1B,IAAM,IAAW,KAAK,cAAc,IAAI,EAAW;GACnD,IAAI,GACA,OAAO;;EAGf,IAAM,IAAM,EAAS,QAAQ,EAAI,EAC3B,IAAO,EAAS,SAAS,EAAI,EAC7B,IAAW,KAAK,YAAY,IAAI,EAAK,IAAI,KAAK,iBAAiB,IAAI,EAAI;EAC7E,IAAI,CAAC,GAKG,MAHU,MADV,IACgB,gEAAgE,EAAI,kBAAkB,EAAW,MAGjG,gEAAgE,EAAI,IAAI;EAGhG,OAAO;;CAEX,YAAY,GAAK;EACb,IAAI;GAEA,OADA,KAAK,YAAY,EAAI,EACd;UAEL;GACF,OAAO;;;CAGf,IAAI,MAAM;EACN,OAAO,MAAM,KAAK,KAAK,cAAc,QAAQ,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/langium/lib/syntax-tree.js
|
|
2
|
-
function e(e) {
|
|
3
|
-
return typeof e == "object" && !!e && typeof e.$type == "string";
|
|
4
|
-
}
|
|
5
|
-
function t(e) {
|
|
6
|
-
return typeof e == "object" && !!e && typeof e.$refText == "string" && "ref" in e;
|
|
7
|
-
}
|
|
8
|
-
function n(e) {
|
|
9
|
-
return typeof e == "object" && !!e && typeof e.$refText == "string" && "items" in e;
|
|
10
|
-
}
|
|
11
|
-
function r(e) {
|
|
12
|
-
return typeof e == "object" && !!e && typeof e.name == "string" && typeof e.type == "string" && typeof e.path == "string";
|
|
13
|
-
}
|
|
14
|
-
function i(e) {
|
|
15
|
-
return typeof e == "object" && !!e && typeof e.info == "object" && typeof e.message == "string";
|
|
16
|
-
}
|
|
17
|
-
var a = class {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.subtypes = {}, this.allSubtypes = {};
|
|
20
|
-
}
|
|
21
|
-
getAllTypes() {
|
|
22
|
-
return Object.keys(this.types);
|
|
23
|
-
}
|
|
24
|
-
getReferenceType(e) {
|
|
25
|
-
let t = this.types[e.container.$type];
|
|
26
|
-
if (!t) throw Error(`Type ${e.container.$type || "undefined"} not found.`);
|
|
27
|
-
let n = t.properties[e.property]?.referenceType;
|
|
28
|
-
if (!n) throw Error(`Property ${e.property || "undefined"} of type ${e.container.$type} is not a reference.`);
|
|
29
|
-
return n;
|
|
30
|
-
}
|
|
31
|
-
getTypeMetaData(e) {
|
|
32
|
-
return this.types[e] || {
|
|
33
|
-
name: e,
|
|
34
|
-
properties: {},
|
|
35
|
-
superTypes: []
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
isInstance(t, n) {
|
|
39
|
-
return e(t) && this.isSubtype(t.$type, n);
|
|
40
|
-
}
|
|
41
|
-
isSubtype(e, t) {
|
|
42
|
-
if (e === t) return !0;
|
|
43
|
-
let n = this.subtypes[e];
|
|
44
|
-
n ||= this.subtypes[e] = {};
|
|
45
|
-
let r = n[t];
|
|
46
|
-
if (r !== void 0) return r;
|
|
47
|
-
{
|
|
48
|
-
let r = this.types[e], i = r ? r.superTypes.some((e) => this.isSubtype(e, t)) : !1;
|
|
49
|
-
return n[t] = i, i;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
getAllSubTypes(e) {
|
|
53
|
-
let t = this.allSubtypes[e];
|
|
54
|
-
if (t) return t;
|
|
55
|
-
{
|
|
56
|
-
let t = this.getAllTypes(), n = [];
|
|
57
|
-
for (let r of t) this.isSubtype(r, e) && n.push(r);
|
|
58
|
-
return this.allSubtypes[e] = n, n;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function o(e) {
|
|
63
|
-
return typeof e == "object" && !!e && Array.isArray(e.content);
|
|
64
|
-
}
|
|
65
|
-
function s(e) {
|
|
66
|
-
return typeof e == "object" && !!e && typeof e.tokenType == "object";
|
|
67
|
-
}
|
|
68
|
-
function c(e) {
|
|
69
|
-
return o(e) && typeof e.fullText == "string";
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
export { a as AbstractAstReflection, e as isAstNode, r as isAstNodeDescription, o as isCompositeCstNode, s as isLeafCstNode, i as isLinkingError, n as isMultiReference, t as isReference, c as isRootCstNode };
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=syntax-tree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syntax-tree.js","names":[],"sources":["../../../../../../../node_modules/langium/lib/syntax-tree.js"],"sourcesContent":["/******************************************************************************\n * Copyright 2021 TypeFox GmbH\n * This program and the accompanying materials are made available under the\n * terms of the MIT License, which is available in the project root.\n ******************************************************************************/\nexport function isAstNode(obj) {\n return typeof obj === 'object' && obj !== null && typeof obj.$type === 'string';\n}\nexport function isReference(obj) {\n return typeof obj === 'object' && obj !== null && typeof obj.$refText === 'string' && 'ref' in obj;\n}\nexport function isMultiReference(obj) {\n return typeof obj === 'object' && obj !== null && typeof obj.$refText === 'string' && 'items' in obj;\n}\nexport function isAstNodeDescription(obj) {\n return typeof obj === 'object' && obj !== null\n && typeof obj.name === 'string'\n && typeof obj.type === 'string'\n && typeof obj.path === 'string';\n}\nexport function isLinkingError(obj) {\n return typeof obj === 'object' && obj !== null\n && typeof obj.info === 'object'\n && typeof obj.message === 'string';\n}\n/**\n * An abstract implementation of the {@link AstReflection} interface.\n * Serves to cache subtype computation results to improve performance throughout different parts of Langium.\n */\nexport class AbstractAstReflection {\n constructor() {\n this.subtypes = {};\n this.allSubtypes = {};\n }\n getAllTypes() {\n return Object.keys(this.types);\n }\n getReferenceType(refInfo) {\n const metaData = this.types[refInfo.container.$type];\n if (!metaData) {\n throw new Error(`Type ${refInfo.container.$type || 'undefined'} not found.`);\n }\n const referenceType = metaData.properties[refInfo.property]?.referenceType;\n if (!referenceType) {\n throw new Error(`Property ${refInfo.property || 'undefined'} of type ${refInfo.container.$type} is not a reference.`);\n }\n return referenceType;\n }\n getTypeMetaData(type) {\n const result = this.types[type];\n if (!result) {\n return {\n name: type,\n properties: {},\n superTypes: []\n };\n }\n return result;\n }\n isInstance(node, type) {\n return isAstNode(node) && this.isSubtype(node.$type, type);\n }\n isSubtype(subtype, supertype) {\n if (subtype === supertype) {\n return true;\n }\n let nested = this.subtypes[subtype];\n if (!nested) {\n nested = this.subtypes[subtype] = {};\n }\n const existing = nested[supertype];\n if (existing !== undefined) {\n return existing;\n }\n else {\n const metaData = this.types[subtype];\n const result = metaData ? metaData.superTypes.some(s => this.isSubtype(s, supertype)) : false;\n nested[supertype] = result;\n return result;\n }\n }\n getAllSubTypes(type) {\n const existing = this.allSubtypes[type];\n if (existing) {\n return existing;\n }\n else {\n const allTypes = this.getAllTypes();\n const types = [];\n for (const possibleSubType of allTypes) {\n if (this.isSubtype(possibleSubType, type)) {\n types.push(possibleSubType);\n }\n }\n this.allSubtypes[type] = types;\n return types;\n }\n }\n}\nexport function isCompositeCstNode(node) {\n return typeof node === 'object' && node !== null && Array.isArray(node.content);\n}\nexport function isLeafCstNode(node) {\n return typeof node === 'object' && node !== null && typeof node.tokenType === 'object';\n}\nexport function isRootCstNode(node) {\n return isCompositeCstNode(node) && typeof node.fullText === 'string';\n}\n//# sourceMappingURL=syntax-tree.js.map"],"x_google_ignoreList":[0],"mappings":";AAKA,SAAgB,EAAU,GAAK;CAC3B,OAAO,OAAO,KAAQ,cAAY,KAAgB,OAAO,EAAI,SAAU;;AAE3E,SAAgB,EAAY,GAAK;CAC7B,OAAO,OAAO,KAAQ,cAAY,KAAgB,OAAO,EAAI,YAAa,YAAY,SAAS;;AAEnG,SAAgB,EAAiB,GAAK;CAClC,OAAO,OAAO,KAAQ,cAAY,KAAgB,OAAO,EAAI,YAAa,YAAY,WAAW;;AAErG,SAAgB,EAAqB,GAAK;CACtC,OAAO,OAAO,KAAQ,cAAY,KAC3B,OAAO,EAAI,QAAS,YACpB,OAAO,E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AAK,IAAM,KAAmB,GAC1B,AAAI,KAAK,UAAU,GAAiB,EAAK,IACrC,EAAM,KAAK,EAAgB;GAInC,OADA,KAAK,YAAY,KAAQ,GAClB;;;;AAInB,SAAgB,EAAmB,GAAM;CACrC,OAAO,OAAO,KAAS,cAAY,KAAiB,MAAM,QAAQ,EAAK,QAAQ;;AAEnF,SAAgB,EAAc,GAAM;CAChC,OAAO,OAAO,KAAS,cAAY,KAAiB,OAAO,EAAK,aAAc;;AAElF,SAAgB,EAAc,GAAM;CAChC,OAAO,EAAmB,EAAK,IAAI,OAAO,EAAK,YAAa"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { isAstNode as e, isMultiReference as t, isReference as n } from "../syntax-tree.js";
|
|
2
|
-
import { DONE_RESULT as r, StreamImpl as i, TreeStreamImpl as a } from "./stream.js";
|
|
3
|
-
import { inRange as o } from "./cst-utils.js";
|
|
4
|
-
//#region ../../node_modules/langium/lib/utils/ast-utils.js
|
|
5
|
-
function s(t, n = {}) {
|
|
6
|
-
for (let [r, i] of Object.entries(t)) r.startsWith("$") || (Array.isArray(i) ? i.forEach((i, a) => {
|
|
7
|
-
e(i) && (i.$container = t, i.$containerProperty = r, i.$containerIndex = a, n.deep && s(i, n));
|
|
8
|
-
}) : e(i) && (i.$container = t, i.$containerProperty = r, n.deep && s(i, n)));
|
|
9
|
-
}
|
|
10
|
-
function c(e, t) {
|
|
11
|
-
let n = e;
|
|
12
|
-
for (; n;) {
|
|
13
|
-
if (t(n)) return n;
|
|
14
|
-
n = n.$container;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
function l(e) {
|
|
18
|
-
let t = u(e).$document;
|
|
19
|
-
if (!t) throw Error("AST node has no document.");
|
|
20
|
-
return t;
|
|
21
|
-
}
|
|
22
|
-
function u(e) {
|
|
23
|
-
for (; e.$container;) e = e.$container;
|
|
24
|
-
return e;
|
|
25
|
-
}
|
|
26
|
-
function d(e) {
|
|
27
|
-
return n(e) ? e.ref ? [e.ref] : [] : t(e) ? e.items.map((e) => e.ref) : [];
|
|
28
|
-
}
|
|
29
|
-
function f(t, n) {
|
|
30
|
-
if (!t) throw Error("Node must be an AstNode.");
|
|
31
|
-
let a = n?.range;
|
|
32
|
-
return new i(() => ({
|
|
33
|
-
keys: Object.keys(t),
|
|
34
|
-
keyIndex: 0,
|
|
35
|
-
arrayIndex: 0
|
|
36
|
-
}), (n) => {
|
|
37
|
-
for (; n.keyIndex < n.keys.length;) {
|
|
38
|
-
let r = n.keys[n.keyIndex];
|
|
39
|
-
if (!r.startsWith("$")) {
|
|
40
|
-
let i = t[r];
|
|
41
|
-
if (e(i)) {
|
|
42
|
-
if (n.keyIndex++, h(i, a)) return {
|
|
43
|
-
done: !1,
|
|
44
|
-
value: i
|
|
45
|
-
};
|
|
46
|
-
} else if (Array.isArray(i)) {
|
|
47
|
-
for (; n.arrayIndex < i.length;) {
|
|
48
|
-
let t = i[n.arrayIndex++];
|
|
49
|
-
if (e(t) && h(t, a)) return {
|
|
50
|
-
done: !1,
|
|
51
|
-
value: t
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
n.arrayIndex = 0;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
n.keyIndex++;
|
|
58
|
-
}
|
|
59
|
-
return r;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function p(e, t) {
|
|
63
|
-
if (!e) throw Error("Root node must be an AstNode.");
|
|
64
|
-
return new a(e, (e) => f(e, t));
|
|
65
|
-
}
|
|
66
|
-
function m(e, t) {
|
|
67
|
-
if (!e) throw Error("Root node must be an AstNode.");
|
|
68
|
-
return t?.range && !h(e, t.range) ? new a(e, () => []) : new a(e, (e) => f(e, t), { includeRoot: !0 });
|
|
69
|
-
}
|
|
70
|
-
function h(e, t) {
|
|
71
|
-
if (!t) return !0;
|
|
72
|
-
let n = e.$cstNode?.range;
|
|
73
|
-
return n ? o(n, t) : !1;
|
|
74
|
-
}
|
|
75
|
-
function g(e) {
|
|
76
|
-
return new i(() => ({
|
|
77
|
-
keys: Object.keys(e),
|
|
78
|
-
keyIndex: 0,
|
|
79
|
-
arrayIndex: 0
|
|
80
|
-
}), (i) => {
|
|
81
|
-
for (; i.keyIndex < i.keys.length;) {
|
|
82
|
-
let r = i.keys[i.keyIndex];
|
|
83
|
-
if (!r.startsWith("$")) {
|
|
84
|
-
let a = e[r];
|
|
85
|
-
if (n(a) || t(a)) return i.keyIndex++, {
|
|
86
|
-
done: !1,
|
|
87
|
-
value: {
|
|
88
|
-
reference: a,
|
|
89
|
-
container: e,
|
|
90
|
-
property: r
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
if (Array.isArray(a)) {
|
|
94
|
-
for (; i.arrayIndex < a.length;) {
|
|
95
|
-
let o = i.arrayIndex++, s = a[o];
|
|
96
|
-
if (n(s) || t(a)) return {
|
|
97
|
-
done: !1,
|
|
98
|
-
value: {
|
|
99
|
-
reference: s,
|
|
100
|
-
container: e,
|
|
101
|
-
property: r,
|
|
102
|
-
index: o
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
i.arrayIndex = 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
i.keyIndex++;
|
|
110
|
-
}
|
|
111
|
-
return r;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function _(e, t) {
|
|
115
|
-
let n = e.getTypeMetaData(t.$type), r = t;
|
|
116
|
-
for (let e of Object.values(n.properties)) e.defaultValue !== void 0 && r[e.name] === void 0 && (r[e.name] = v(e.defaultValue));
|
|
117
|
-
}
|
|
118
|
-
function v(e) {
|
|
119
|
-
return Array.isArray(e) ? [...e.map(v)] : e;
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
export { _ as assignMandatoryProperties, u as findRootNode, c as getContainerOfType, l as getDocument, d as getReferenceNodes, s as linkContentToContainer, p as streamAllContents, m as streamAst, f as streamContents, g as streamReferences };
|
|
123
|
-
|
|
124
|
-
//# sourceMappingURL=ast-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ast-utils.js","names":[],"sources":["../../../../../../../../node_modules/langium/lib/utils/ast-utils.js"],"sourcesContent":["/******************************************************************************\n * Copyright 2021 TypeFox GmbH\n * This program and the accompanying materials are made available under the\n * terms of the MIT License, which is available in the project root.\n ******************************************************************************/\nimport { isAstNode, isMultiReference, isReference } from '../syntax-tree.js';\nimport { DONE_RESULT, StreamImpl, TreeStreamImpl } from './stream.js';\nimport { inRange } from './cst-utils.js';\n/**\n * Link the `$container` and other related properties of every AST node that is directly contained\n * in the given `node`.\n */\nexport function linkContentToContainer(node, options = {}) {\n for (const [name, value] of Object.entries(node)) {\n if (!name.startsWith('$')) {\n if (Array.isArray(value)) {\n value.forEach((item, index) => {\n if (isAstNode(item)) {\n item.$container = node;\n item.$containerProperty = name;\n item.$containerIndex = index;\n if (options.deep) {\n linkContentToContainer(item, options);\n }\n }\n });\n }\n else if (isAstNode(value)) {\n value.$container = node;\n value.$containerProperty = name;\n if (options.deep) {\n linkContentToContainer(value, options);\n }\n }\n }\n }\n}\n/**\n * Walk along the hierarchy of containers from the given AST node to the root and return the first\n * node that matches the type predicate. If the start node itself matches, it is returned.\n * If no container matches, `undefined` is returned.\n */\nexport function getContainerOfType(node, typePredicate) {\n let item = node;\n while (item) {\n if (typePredicate(item)) {\n return item;\n }\n item = item.$container;\n }\n return undefined;\n}\n/**\n * Walk along the hierarchy of containers from the given AST node to the root and check for existence\n * of a container that matches the given predicate. The start node is included in the checks.\n */\nexport function hasContainerOfType(node, predicate) {\n let item = node;\n while (item) {\n if (predicate(item)) {\n return true;\n }\n item = item.$container;\n }\n return false;\n}\n/**\n * Retrieve the document in which the given AST node is contained. A reference to the document is\n * usually held by the root node of the AST.\n *\n * @throws an error if the node is not contained in a document.\n */\nexport function getDocument(node) {\n const rootNode = findRootNode(node);\n const result = rootNode.$document;\n if (!result) {\n throw new Error('AST node has no document.');\n }\n return result;\n}\n/**\n * Returns the root node of the given AST node by following the `$container` references.\n */\nexport function findRootNode(node) {\n while (node.$container) {\n node = node.$container;\n }\n return node;\n}\n/**\n * Returns all AST nodes that are referenced by the given reference or multi-reference.\n */\nexport function getReferenceNodes(reference) {\n if (isReference(reference)) {\n return reference.ref ? [reference.ref] : [];\n }\n else if (isMultiReference(reference)) {\n return reference.items.map(item => item.ref);\n }\n return [];\n}\n/**\n * Create a stream of all AST nodes that are directly contained in the given node. This includes\n * single-valued as well as multi-valued (array) properties.\n */\nexport function streamContents(node, options) {\n if (!node) {\n throw new Error('Node must be an AstNode.');\n }\n const range = options?.range;\n return new StreamImpl(() => ({\n keys: Object.keys(node),\n keyIndex: 0,\n arrayIndex: 0\n }), state => {\n while (state.keyIndex < state.keys.length) {\n const property = state.keys[state.keyIndex];\n if (!property.startsWith('$')) {\n const value = node[property];\n if (isAstNode(value)) {\n state.keyIndex++;\n if (isAstNodeInRange(value, range)) {\n return { done: false, value };\n }\n }\n else if (Array.isArray(value)) {\n while (state.arrayIndex < value.length) {\n const index = state.arrayIndex++;\n const element = value[index];\n if (isAstNode(element) && isAstNodeInRange(element, range)) {\n return { done: false, value: element };\n }\n }\n state.arrayIndex = 0;\n }\n }\n state.keyIndex++;\n }\n return DONE_RESULT;\n });\n}\n/**\n * Create a stream of all AST nodes that are directly and indirectly contained in the given root node.\n * This does not include the root node itself.\n */\nexport function streamAllContents(root, options) {\n if (!root) {\n throw new Error('Root node must be an AstNode.');\n }\n return new TreeStreamImpl(root, node => streamContents(node, options));\n}\n/**\n * Create a stream of all AST nodes that are directly and indirectly contained in the given root node,\n * including the root node itself.\n */\nexport function streamAst(root, options) {\n if (!root) {\n throw new Error('Root node must be an AstNode.');\n }\n else if (options?.range && !isAstNodeInRange(root, options.range)) {\n // Return an empty stream if the root node isn't in range\n return new TreeStreamImpl(root, () => []);\n }\n return new TreeStreamImpl(root, node => streamContents(node, options), { includeRoot: true });\n}\nfunction isAstNodeInRange(astNode, range) {\n if (!range) {\n return true;\n }\n const nodeRange = astNode.$cstNode?.range;\n if (!nodeRange) {\n return false;\n }\n return inRange(nodeRange, range);\n}\n/**\n * Create a stream of all cross-references that are held by the given AST node. This includes\n * single-valued as well as multi-valued (array) properties.\n */\nexport function streamReferences(node) {\n return new StreamImpl(() => ({\n keys: Object.keys(node),\n keyIndex: 0,\n arrayIndex: 0\n }), state => {\n while (state.keyIndex < state.keys.length) {\n const property = state.keys[state.keyIndex];\n if (!property.startsWith('$')) {\n const value = node[property];\n if (isReference(value) || isMultiReference(value)) {\n state.keyIndex++;\n return { done: false, value: { reference: value, container: node, property } };\n }\n else if (Array.isArray(value)) {\n while (state.arrayIndex < value.length) {\n const index = state.arrayIndex++;\n const element = value[index];\n if (isReference(element) || isMultiReference(value)) {\n return { done: false, value: { reference: element, container: node, property, index } };\n }\n }\n state.arrayIndex = 0;\n }\n }\n state.keyIndex++;\n }\n return DONE_RESULT;\n });\n}\n/**\n * Assigns all mandatory AST properties to the specified node.\n *\n * @param reflection Reflection object used to gather mandatory properties for the node.\n * @param node Specified node is modified in place and properties are directly assigned.\n */\nexport function assignMandatoryProperties(reflection, node) {\n const typeMetaData = reflection.getTypeMetaData(node.$type);\n const genericNode = node;\n for (const property of Object.values(typeMetaData.properties)) {\n // Only set the value if the property is not already set and if it has a default value\n if (property.defaultValue !== undefined && genericNode[property.name] === undefined) {\n genericNode[property.name] = copyDefaultValue(property.defaultValue);\n }\n }\n}\nfunction copyDefaultValue(propertyType) {\n if (Array.isArray(propertyType)) {\n return [...propertyType.map(copyDefaultValue)];\n }\n else {\n return propertyType;\n }\n}\n/**\n * Creates a deep copy of the specified AST node.\n * The resulting copy will only contain semantically relevant information, such as the `$type` property and AST properties.\n *\n * @param node The AST node to deeply copy.\n * @param buildReference References are not copied, instead this function is called to rebuild them.\n * @param trace For the sake of tracking copied nodes and their originals a `trace` map can be provided (optional).\n */\nexport function copyAstNode(node, buildReference, trace) {\n const copy = { $type: node.$type };\n if (trace) {\n trace.set(node, copy);\n trace.set(copy, node);\n }\n for (const [name, value] of Object.entries(node)) {\n if (!name.startsWith('$')) {\n if (isAstNode(value)) {\n copy[name] = copyAstNode(value, buildReference, trace);\n }\n else if (isReference(value)) {\n copy[name] = buildReference(copy, name, value.$refNode, value.$refText, value);\n }\n else if (Array.isArray(value)) {\n const copiedArray = [];\n for (const element of value) {\n if (isAstNode(element)) {\n copiedArray.push(copyAstNode(element, buildReference, trace));\n }\n else if (isReference(element)) {\n copiedArray.push(buildReference(copy, name, element.$refNode, element.$refText, element));\n }\n else {\n copiedArray.push(element);\n }\n }\n copy[name] = copiedArray;\n }\n else {\n copy[name] = value;\n }\n }\n }\n linkContentToContainer(copy, { deep: true });\n return copy;\n}\n//# sourceMappingURL=ast-utils.js.map"],"x_google_ignoreList":[0],"mappings":";;;;AAYA,SAAgB,EAAuB,GAAM,IAAU,EAAE,EAAE;CACvD,KAAK,IAAM,CAAC,GAAM,MAAU,OAAO,QAAQ,EAAK,EAC5C,AAAK,EAAK,WAAW,IAAI,KACjB,MAAM,QAAQ,EAAM,GACpB,EAAM,SAAS,GAAM,MAAU;EAC3B,AAAI,EAAU,EAAK,KACf,EAAK,aAAa,GAClB,EAAK,qBAAqB,GAC1B,EAAK,kBAAkB,GACnB,EAAQ,QACR,EAAuB,GAAM,EAAQ;GAG/C,GAEG,EAAU,EAAM,KACrB,EAAM,aAAa,GACnB,EAAM,qBAAqB,GACvB,EAAQ,QACR,EAAuB,GAAO,EAAQ;;AAW1D,SAAgB,EAAmB,GAAM,GAAe;CACpD,IAAI,IAAO;CACX,OAAO,IAAM;EACT,IAAI,EAAc,EAAK,EACnB,OAAO;EAEX,IAAO,EAAK;;;AAwBpB,SAAgB,EAAY,GAAM;CAE9B,IAAM,IADW,EAAa,EACP,CAAC;CACxB,IAAI,CAAC,GACD,MAAU,MAAM,4BAA4B;CAEhD,OAAO;;AAKX,SAAgB,EAAa,GAAM;CAC/B,OAAO,EAAK,aACR,IAAO,EAAK;CAEhB,O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