@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.11
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/browser/esm/B7aUIvgUjncMMD_i.mjs +394 -0
- package/browser/esm/BFagR2JeWs74iAG3.mjs +171 -0
- package/browser/esm/BGOFfpxr2jPIdqmV.mjs +40 -0
- package/browser/esm/BLoUBId2xZpXAK_H.mjs +698 -0
- package/browser/esm/BMyDRQ716j79h_bH.mjs +86 -0
- package/browser/esm/BVDiOXGMc5_FMGfy.mjs +400 -0
- package/browser/esm/BjkCiv5Jz6WYKZeu.mjs +598 -0
- package/browser/esm/BkBhLS0l6z8sxI6D.mjs +441 -0
- package/browser/esm/BnG31I6Oj_HEtSPS.mjs +167 -0
- package/browser/esm/BoV6zPBnfqCBCqZ7.mjs +7729 -0
- package/browser/esm/BpgskG1Er_lGQ_yS.mjs +142 -0
- package/browser/esm/BtvLTTfSBdAKplVG.mjs +466 -0
- package/browser/esm/C16ycKja6zG0crV_.mjs +55580 -0
- package/browser/esm/C2VbEI_XVAoseAwa.mjs +1552 -0
- package/browser/esm/C4MqfLn9Dm-l3OIk.mjs +540 -0
- package/browser/esm/C5E6zSGAALWf61n4.mjs +199 -0
- package/browser/esm/CHU6iu_WGlm7fLET.mjs +1001 -0
- package/browser/esm/CQYjO777cmAznUzK.mjs +527 -0
- package/browser/esm/CU3DmJ-YnVVrC1_k.mjs +1123 -0
- package/browser/esm/CV5EGEjG5_-CPpP0.mjs +8212 -0
- package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → CaB7J-xgfKO2uAkG.mjs} +2 -2
- package/browser/esm/CkxWugaJFjDGZNZ-.mjs +12 -0
- package/browser/esm/ClPfI4lODvCece29.mjs +632 -0
- package/browser/esm/ClbvFbFzFzXLBKNN.mjs +193 -0
- package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → Ctjb0SsxV4K4MMqG.mjs} +179 -202
- package/browser/esm/D5np__Jb1euAyaLw.mjs +7 -0
- package/browser/esm/DEiPS3Dr-s4fPbVZ.mjs +607 -0
- package/browser/esm/DLLE0FZNsKxbBzRn.mjs +128 -0
- package/browser/esm/DWNzqw7DUKwoxjri.mjs +20 -0
- package/browser/esm/{B0HS42a7lga1k1U_.mjs → Dlmig06rIo7cInRk.mjs} +2 -2
- package/browser/esm/{f2G3QRgEbvFJcoa2.mjs → DvAaxH6z_tGvrRzl.mjs} +1704 -1008
- package/browser/esm/Dyq_ivuHvlXLwPCl.mjs +12831 -0
- package/browser/esm/PcHFjNzQsE54POri.mjs +1141 -0
- package/browser/esm/S2dNNx1a5ydRnARM.mjs +367 -0
- package/browser/esm/f1IoRb7tEb0QmCSt.mjs +110 -0
- package/browser/esm/gssVX_FH1XFN-twD.mjs +210 -0
- package/browser/esm/index.mjs +1759 -1161
- package/browser/esm/nvU0ClAbf0g94YBK.mjs +1695 -0
- package/browser/esm/zlLuW405RSguy4Kn.mjs +357 -0
- package/licenses/dependencies.txt +141 -141
- package/node/esm/2Kihw_-5lVTEnwMa.mjs +1132 -0
- package/node/esm/857CIBgQgGpnqrXk.mjs +199 -0
- package/node/esm/B084DssTcdBheTp_.mjs +7966 -0
- package/node/esm/B21JjOLghRoDOrkx.mjs +134 -0
- package/node/esm/BIRq1kT7lLRzns9t.mjs +610 -0
- package/node/esm/BIwObuhTJYf0jpUa.mjs +451 -0
- package/node/esm/Bbf1Pm9Gk7YpLTvg.mjs +12 -0
- package/node/esm/BqiexuA89caYnAPz.mjs +1135 -0
- package/node/esm/BrCKGFRsX_ezFJ4B.mjs +811 -0
- package/node/esm/CCN5vD410obwdz38.mjs +405 -0
- package/node/esm/{Cku7XiUvw1xrRasi.mjs → CDHdgJXH2vS71WMc.mjs} +1 -1
- package/node/esm/CGp6VZL-gZa9Uezx.mjs +1860 -0
- package/node/esm/CNCNJNg890KdgkWh.mjs +142 -0
- package/node/esm/CZICGK_ss0HoGHCP.mjs +7 -0
- package/node/esm/CZiqiay42tFTrLI4.mjs +171 -0
- package/node/esm/CdJHUJSBRHZoryPe.mjs +360 -0
- package/node/esm/Ct3h15sCus4Tgt6M.mjs +1762 -0
- package/node/esm/CwePQwTILHHjGDkZ.mjs +1033 -0
- package/node/esm/CzXT00vrQa1_gvW9.mjs +28 -0
- package/node/esm/D1TKBVmoKGAXf37B.mjs +402 -0
- package/node/esm/D2KBymQJd1XhpeQD.mjs +540 -0
- package/node/esm/D6e2z7eZpxOJXHc7.mjs +1783 -0
- package/node/esm/D8zEN-6ZdDqDvTxM.mjs +639 -0
- package/node/esm/DNRhGK-8Tr9xcRyc.mjs +8320 -0
- package/node/esm/DOU54VsOjG-m-NyQ.mjs +210 -0
- package/node/esm/DUTskXCXref-IJnI.mjs +133 -0
- package/node/esm/D_t5AUxSm7_icjzq.mjs +638 -0
- package/node/esm/Db0v7zXNnyjBIjjI.mjs +372 -0
- package/node/esm/De2IONBxQhz-Qbyh.mjs +596 -0
- package/node/esm/Df1bL6VFvrqIdSLB.mjs +40 -0
- package/node/esm/DkwIPzKc3UwdUIfM.mjs +86 -0
- package/node/esm/DrTZbfemSLq2mseG.mjs +111 -0
- package/node/esm/OVfaSb506tNSIvbv.mjs +57107 -0
- package/node/esm/cGwrLA1RCE-WhJ7w.mjs +255 -0
- package/node/esm/index.mjs +2873 -53929
- package/node/esm/mFiBSM7XgBHV9AY7.mjs +13010 -0
- package/node/esm/yavzZOiZW_EjG9lE.mjs +15 -0
- package/package.json +15 -17
- package/resources/contents.json +184 -0
- package/resources/fonts/arial-bold-italic.hinted.json +125 -0
- package/resources/fonts/arial-bold-italic.metrics.json +139 -0
- package/resources/fonts/arial-bold-italic.rows.json +9 -0
- package/resources/fonts/arial-bold.hinted.json +125 -0
- package/resources/fonts/arial-bold.metrics.json +139 -0
- package/resources/fonts/arial-bold.rows.json +9 -0
- package/resources/fonts/arial-italic.hinted.json +125 -0
- package/resources/fonts/arial-italic.metrics.json +139 -0
- package/resources/fonts/arial-italic.rows.json +9 -0
- package/resources/fonts/arial-regular.hinted.json +125 -0
- package/resources/fonts/arial-regular.metrics.json +139 -0
- package/resources/fonts/arial-regular.rows.json +9 -0
- package/resources/fonts/calibri-bold-italic.hinted.json +122 -0
- package/resources/fonts/calibri-bold-italic.metrics.json +137 -0
- package/resources/fonts/calibri-bold-italic.rows.json +9 -0
- package/resources/fonts/calibri-bold.hinted.json +122 -0
- package/resources/fonts/calibri-bold.metrics.json +137 -0
- package/resources/fonts/calibri-bold.rows.json +9 -0
- package/resources/fonts/calibri-italic.hinted.json +121 -0
- package/resources/fonts/calibri-italic.metrics.json +137 -0
- package/resources/fonts/calibri-italic.rows.json +9 -0
- package/resources/fonts/calibri-regular.hinted.json +121 -0
- package/resources/fonts/calibri-regular.metrics.json +137 -0
- package/resources/fonts/calibri-regular.rows.json +9 -0
- package/resources/fonts/cambria-bold-italic.hinted.json +105 -0
- package/resources/fonts/cambria-bold-italic.metrics.json +66 -0
- package/resources/fonts/cambria-bold-italic.rows.json +9 -0
- package/resources/fonts/cambria-bold.hinted.json +108 -0
- package/resources/fonts/cambria-bold.metrics.json +66 -0
- package/resources/fonts/cambria-bold.rows.json +9 -0
- package/resources/fonts/cambria-italic.hinted.json +102 -0
- package/resources/fonts/cambria-italic.metrics.json +66 -0
- package/resources/fonts/cambria-italic.rows.json +9 -0
- package/resources/fonts/cambria-regular.hinted.json +110 -0
- package/resources/fonts/cambria-regular.metrics.json +66 -0
- package/resources/fonts/cambria-regular.rows.json +9 -0
- package/resources/fonts/contents.json +406 -0
- package/resources/fonts/courier-new-bold-italic.hinted.json +11 -0
- package/resources/fonts/courier-new-bold-italic.metrics.json +143 -0
- package/resources/fonts/courier-new-bold-italic.rows.json +9 -0
- package/resources/fonts/courier-new-bold.hinted.json +11 -0
- package/resources/fonts/courier-new-bold.metrics.json +143 -0
- package/resources/fonts/courier-new-bold.rows.json +9 -0
- package/resources/fonts/courier-new-italic.hinted.json +11 -0
- package/resources/fonts/courier-new-italic.metrics.json +143 -0
- package/resources/fonts/courier-new-italic.rows.json +9 -0
- package/resources/fonts/courier-new-regular.hinted.json +11 -0
- package/resources/fonts/courier-new-regular.metrics.json +143 -0
- package/resources/fonts/courier-new-regular.rows.json +9 -0
- package/resources/fonts/times-new-roman-bold-italic.hinted.json +125 -0
- package/resources/fonts/times-new-roman-bold-italic.metrics.json +141 -0
- package/resources/fonts/times-new-roman-bold-italic.rows.json +9 -0
- package/resources/fonts/times-new-roman-bold.hinted.json +125 -0
- package/resources/fonts/times-new-roman-bold.metrics.json +141 -0
- package/resources/fonts/times-new-roman-bold.rows.json +9 -0
- package/resources/fonts/times-new-roman-italic.hinted.json +125 -0
- package/resources/fonts/times-new-roman-italic.metrics.json +143 -0
- package/resources/fonts/times-new-roman-italic.rows.json +9 -0
- package/resources/fonts/times-new-roman-regular.hinted.json +125 -0
- package/resources/fonts/times-new-roman-regular.metrics.json +141 -0
- package/resources/fonts/times-new-roman-regular.rows.json +9 -0
- package/resources/locales/de/model.msg.json +199 -21
- package/resources/locales/en/model.msg.json +207 -23
- package/types/scripting-api.json +10663 -0
- package/types/scripting-enums.json +435 -130
- package/types/scripting.d.ts +33010 -15730
- package/types/src/.generated/wasm/fonts.d.ts +161 -0
- package/types/src/.generated/wasm/fonts_bg.inline.d.ts +3 -0
- package/types/src/.generated/wasm/sdk.d.ts +122 -0
- package/types/src/.generated/wasm/sdk_bg.inline.d.ts +3 -0
- package/types/src/address/AddressUtils.d.ts +10 -1
- package/types/src/address/_StructuredAddress.d.ts +58 -0
- package/types/src/anchored/AbstractAnchored.d.ts +18 -8
- package/types/src/anchored/AnchoredMap.d.ts +2 -0
- package/types/src/anchored/IAnchoredMap.d.ts +52 -4
- package/types/src/autoFill/AutoFill.d.ts +316 -32
- package/types/src/autoFill/IAutoFill.d.ts +232 -15
- package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +58 -41
- package/types/src/border/index.d.ts +1 -1
- package/types/src/calculation/Calculation.d.ts +584 -149
- package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
- package/types/src/calculation/FormulaLiterals.d.ts +2 -1
- package/types/src/calculation/FormulaText.d.ts +98 -0
- package/types/src/calculation/ICalculation.d.ts +353 -88
- package/types/src/calculation/INamedFormulasCollection.d.ts +9 -8
- package/types/src/calculation/NamedFormulaCollection.d.ts +322 -115
- package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
- package/types/src/calculation/TokenType.d.ts +9 -0
- package/types/src/calculation/Types.d.ts +83 -2
- package/types/src/calculation/_CloneBoundary.d.ts +80 -0
- package/types/src/calculation/_FormulaToolkit.d.ts +9 -0
- package/types/src/calculation/_TableExtent.d.ts +60 -0
- package/types/src/calculation/_TableRename.d.ts +13 -0
- package/types/src/calculation/compiler/ASTTypes.d.ts +71 -0
- package/types/src/calculation/compiler/CompilerUtils.d.ts +152 -44
- package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
- package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
- package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
- package/types/src/calculation/compiler/ParserUtils.d.ts +42 -1
- package/types/src/calculation/compiler/SRParser.d.ts +2 -1
- package/types/src/calculation/compiler/Types.d.ts +79 -9
- package/types/src/calculation/engine/CalcBackend.d.ts +855 -0
- package/types/src/calculation/engine/index.d.ts +10 -0
- package/types/src/calculation/executor/CalcExecutor.d.ts +331 -33
- package/types/src/calculation/executor/CalcExecutorUtils.d.ts +49 -2
- package/types/src/calculation/executor/CircularReference.d.ts +2 -0
- package/types/src/calculation/formula/Formula.d.ts +67 -21
- package/types/src/calculation/formula/FormulaBlock.d.ts +131 -23
- package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
- package/types/src/calculation/formula/FunctionValues.d.ts +10 -0
- package/types/src/calculation/formula/IFormulaBlock.d.ts +277 -67
- package/types/src/calculation/formula/LambdaValue.d.ts +51 -26
- package/types/src/calculation/formula/LazyValue.d.ts +96 -0
- package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
- package/types/src/calculation/formula/index.d.ts +1 -0
- package/types/src/calculation/functions/FunctionDeclarations.d.ts +35 -0
- package/types/src/calculation/functions/Operators.d.ts +8 -0
- package/types/src/calculation/functions/expandDeclaration.d.ts +15 -0
- package/types/src/calculation/functions/initializeFunctions.d.ts +3 -2
- package/types/src/calculation/grid/CalcGrid.d.ts +443 -158
- package/types/src/calculation/grid/CalcGridBackend.d.ts +523 -0
- package/types/src/calculation/grid/CalcGridProxy.d.ts +135 -0
- package/types/src/calculation/grid/CalcGridUtils.d.ts +69 -12
- package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
- package/types/src/calculation/grid/FormulaHost.d.ts +284 -0
- package/types/src/calculation/grid/ICalcGrid.d.ts +528 -141
- package/types/src/calculation/grid/_CalcRequest.d.ts +299 -0
- package/types/src/calculation/grid/_CellValueRun.d.ts +21 -0
- package/types/src/calculation/grid/index.d.ts +4 -0
- package/types/src/calculation/index.d.ts +2 -0
- package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
- package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +364 -11
- package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
- package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
- package/types/src/calculation/spatial/index.d.ts +1 -0
- package/types/src/calculation/state/CalcInputs.d.ts +41 -0
- package/types/src/calculation/state/CalcNode.d.ts +141 -30
- package/types/src/calculation/state/CalcScope.d.ts +46 -0
- package/types/src/calculation/state/CalcState.d.ts +32 -1
- package/types/src/calculation/state/CalculationContext.d.ts +50 -3
- package/types/src/calculation/state/IContextContainer.d.ts +141 -27
- package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
- package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
- package/types/src/calculation/state/index.d.ts +1 -0
- package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
- package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
- package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
- package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
- package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
- package/types/src/calculation/symbol/index.d.ts +3 -2
- package/types/src/calculation/toolkit/FormulaLiteralReader.d.ts +4 -0
- package/types/src/calculation/toolkit/FormulaTextParser.d.ts +10 -0
- package/types/src/calculation/toolkit/FunctionDeclarationTable.d.ts +4 -0
- package/types/src/calculation/toolkit/index.d.ts +12 -0
- package/types/src/cell/ICell.d.ts +357 -33
- package/types/src/cell/ICellHeader.d.ts +31 -8
- package/types/src/cell/ICellProtection.d.ts +50 -10
- package/types/src/cellRange/ICellHeaderRange.d.ts +6 -9
- package/types/src/cellRange/ICellHeaderRanges.d.ts +5 -0
- package/types/src/cellRange/ICellRange.d.ts +737 -130
- package/types/src/cellRange/ICellRanges.d.ts +31 -24
- package/types/src/chart/Chart.d.ts +246 -16
- package/types/src/chart/ChartCollection.d.ts +31 -0
- package/types/src/chart/IChart.d.ts +2058 -18
- package/types/src/chart/IChartCollection.d.ts +50 -0
- package/types/src/chart/_ChartParts.d.ts +1066 -0
- package/types/src/chart/_ChartSource.d.ts +47 -0
- package/types/src/chart/createChart.d.ts +26 -0
- package/types/src/chart/index.d.ts +5 -3
- package/types/src/chart/kinds/ChartKind.d.ts +252 -0
- package/types/src/chart/kinds/_Area.d.ts +3 -0
- package/types/src/chart/kinds/_Bar.d.ts +4 -0
- package/types/src/chart/kinds/_BoxWhisker.d.ts +4 -0
- package/types/src/chart/kinds/_Bubble.d.ts +3 -0
- package/types/src/chart/kinds/_Funnel.d.ts +4 -0
- package/types/src/chart/kinds/_Hierarchy.d.ts +31 -0
- package/types/src/chart/kinds/_Histogram.d.ts +4 -0
- package/types/src/chart/kinds/_HitKinds.d.ts +23 -0
- package/types/src/chart/kinds/_Line.d.ts +4 -0
- package/types/src/chart/kinds/_OfPie.d.ts +4 -0
- package/types/src/chart/kinds/_Pie.d.ts +4 -0
- package/types/src/chart/kinds/_Placeholder.d.ts +6 -0
- package/types/src/chart/kinds/_Radar.d.ts +4 -0
- package/types/src/chart/kinds/_Scatter.d.ts +8 -0
- package/types/src/chart/kinds/_Sunburst.d.ts +4 -0
- package/types/src/chart/kinds/_Surface.d.ts +4 -0
- package/types/src/chart/kinds/_Treemap.d.ts +4 -0
- package/types/src/chart/kinds/_Waterfall.d.ts +18 -0
- package/types/src/chart/kinds/_builtIns.d.ts +11 -0
- package/types/src/chart/layout/ChartLayout.d.ts +825 -0
- package/types/src/chart/layout/TextMeasurer.d.ts +38 -0
- package/types/src/chart/layout/_HitGeometry.d.ts +50 -0
- package/types/src/chart/layout/_HitTest.d.ts +36 -0
- package/types/src/chart/layout/_Layout.d.ts +25 -0
- package/types/src/chart/layout/_LayoutUtils.d.ts +97 -0
- package/types/src/chart/math/BoxStats.d.ts +35 -0
- package/types/src/chart/math/DateUnitCalcs.d.ts +80 -0
- package/types/src/chart/math/DisplayUnits.d.ts +53 -0
- package/types/src/chart/math/Histogram.d.ts +48 -0
- package/types/src/chart/math/OrdUnitCalcs.d.ts +166 -0
- package/types/src/chart/math/Treemap.d.ts +28 -0
- package/types/src/chart/math/Trendlines.d.ts +71 -0
- package/types/src/chart/math/UnitCalcs.d.ts +98 -0
- package/types/src/chart/model/ChartModel.d.ts +681 -0
- package/types/src/chart/model/_ChartType.d.ts +14 -0
- package/types/src/chart/model/_Edits.d.ts +489 -0
- package/types/src/chart/model/_Grouping.d.ts +83 -0
- package/types/src/chart/model/_Inference.d.ts +52 -0
- package/types/src/chart/model/_ModelFacts.d.ts +112 -0
- package/types/src/chart/model/_NewChart.d.ts +208 -0
- package/types/src/chart/model/_OfPie.d.ts +18 -0
- package/types/src/chart/resolve/_LegacyStyles.d.ts +48 -0
- package/types/src/chart/resolve/_Resolve.d.ts +51 -0
- package/types/src/chart/resolve/_ResolvedChart.d.ts +444 -0
- package/types/src/collections/ArraysGrid.d.ts +1 -1
- package/types/src/collections/IGrid.d.ts +1 -1
- package/types/src/collections/ISparseGrid.d.ts +9 -0
- package/types/src/collections/ISpatialMap.d.ts +59 -21
- package/types/src/collections/ImmutableList.d.ts +28 -0
- package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
- package/types/src/collections/RTree.d.ts +116 -36
- package/types/src/collections/RepeatingList.d.ts +7 -0
- package/types/src/collections/ScalarGrid.d.ts +50 -0
- package/types/src/collections/SparseGrid.d.ts +7 -4
- package/types/src/collections/SpatialMap.d.ts +15 -29
- package/types/src/collections/SpatialMap3D.d.ts +2 -0
- package/types/src/collections/Tuple.d.ts +128 -16
- package/types/src/collections/_GridUtils.d.ts +19 -6
- package/types/src/collections/_SpatialUtils.d.ts +20 -2
- package/types/src/collections/index.d.ts +2 -1
- package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
- package/types/src/comment/Comment.d.ts +246 -0
- package/types/src/comment/CommentCollection.d.ts +40 -0
- package/types/src/comment/IComment.d.ts +377 -50
- package/types/src/comment/ICommentCollection.d.ts +90 -0
- package/types/src/comment/NoteMovable.d.ts +26 -0
- package/types/src/comment/_CommentUtils.d.ts +50 -0
- package/types/src/comment/_NoteBox.d.ts +67 -0
- package/types/src/comment/index.d.ts +1 -0
- package/types/src/condition/AnchoredConditional.d.ts +110 -19
- package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +42 -12
- package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +4 -0
- package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +4 -1
- package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +5 -6
- package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/IconOperator.d.ts +4 -0
- package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +22 -5
- package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
- package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
- package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
- package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +21 -6
- package/types/src/condition/BuiltinSelectors/DateSelector.d.ts +4 -5
- package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +20 -0
- package/types/src/condition/BuiltinSelectors/TextLengthSelector.d.ts +7 -5
- package/types/src/condition/BuiltinSelectors/TimeSelector.d.ts +3 -5
- package/types/src/condition/BuiltinSelectors/WholeSelector.d.ts +3 -5
- package/types/src/condition/BuiltinSelectors/index.d.ts +12 -6
- package/types/src/condition/Condition.d.ts +19 -1
- package/types/src/condition/ICondition.d.ts +296 -75
- package/types/src/condition/_ConditionFormula.d.ts +152 -0
- package/types/src/condition/_ConditionUtils.d.ts +167 -13
- package/types/src/conditionalFormat/ConditionalEntry.d.ts +3 -3
- package/types/src/conditionalFormat/ConditionalFormat.d.ts +34 -17
- package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
- package/types/src/conditionalFormat/IConditionalFormat.d.ts +16 -13
- package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
- package/types/src/dataTable/DataTable.d.ts +67 -0
- package/types/src/dataTable/DataTableCollection.d.ts +19 -0
- package/types/src/dataTable/IDataTable.d.ts +99 -0
- package/types/src/dataTable/IDataTableCollection.d.ts +18 -0
- package/types/src/dataTable/index.d.ts +6 -0
- package/types/src/dataValidation/DataValidation.d.ts +70 -4
- package/types/src/dataValidation/DataValidationCollection.d.ts +23 -9
- package/types/src/dataValidation/IDataValidation.d.ts +150 -31
- package/types/src/dataValidation/IDataValidationCollection.d.ts +34 -2
- package/types/src/date/DateUtils.d.ts +20 -0
- package/types/src/date/_DateUtils.d.ts +91 -7
- package/types/src/documentProperties/DocumentProperties.d.ts +66 -0
- package/types/src/documentProperties/ICustomProperty.d.ts +69 -0
- package/types/src/documentProperties/IDocumentProperties.d.ts +110 -0
- package/types/src/documentProperties/index.d.ts +3 -0
- package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
- package/types/src/externalBook/ExternalBookName.d.ts +96 -0
- package/types/src/externalBook/IExternalBook.d.ts +171 -19
- package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
- package/types/src/externalBook/index.d.ts +1 -0
- package/types/src/{lib/file → file}/file.browser.d.ts +22 -8
- package/types/src/{lib/file → file}/file.node.d.ts +7 -2
- package/types/src/fill/IEffect.d.ts +5 -5
- package/types/src/fill/IFill.d.ts +129 -77
- package/types/src/fill/IFillable.d.ts +47 -0
- package/types/src/fill/IStroke.d.ts +204 -64
- package/types/src/fill/PaintUtils.d.ts +22 -0
- package/types/src/fill/RectAlignment.d.ts +20 -0
- package/types/src/fill/_Fills.d.ts +187 -0
- package/types/src/fill/_Stroke.d.ts +89 -0
- package/types/src/fill/index.d.ts +3 -0
- package/types/src/filter/IFilter.d.ts +188 -5
- package/types/src/font/AdvanceBuilder.d.ts +59 -0
- package/types/src/font/AdvanceTable.d.ts +228 -0
- package/types/src/font/CanvasAdvanceBuilder.d.ts +54 -0
- package/types/src/font/FontCapture.d.ts +4 -0
- package/types/src/font/FontCollection.d.ts +108 -0
- package/types/src/font/FontPlatform.d.ts +20 -0
- package/types/src/font/FontUtils.d.ts +5 -0
- package/types/src/font/IFont.d.ts +208 -61
- package/types/src/font/IFontCollection.d.ts +126 -22
- package/types/src/font/IFontStyle.d.ts +207 -0
- package/types/src/font/TableFileAdvanceBuilder.d.ts +36 -0
- package/types/src/font/_BuiltinFontTables.d.ts +10 -0
- package/types/src/font/_FontUtils.d.ts +11 -4
- package/types/src/font/_FontsVersion.d.ts +7 -0
- package/types/src/font/index.d.ts +2 -1
- package/types/src/font/platform.browser.d.ts +15 -0
- package/types/src/font/platform.node.d.ts +5 -0
- package/types/src/group/Group.d.ts +141 -0
- package/types/src/group/GroupMovableCollection.d.ts +41 -0
- package/types/src/group/IGroup.d.ts +129 -0
- package/types/src/group/index.d.ts +2 -0
- package/types/src/history/IHistory.d.ts +21 -3
- package/types/src/hyperlink/IHyperlink.d.ts +20 -1
- package/types/src/hyperlink/_Hyperlink.d.ts +5 -1
- package/types/src/i18n/LanguagePack.d.ts +12 -4
- package/types/src/index.d.ts +8 -0
- package/types/src/io/AbstractBackingStore.d.ts +24 -1
- package/types/src/io/ArrayBackingStore.d.ts +1 -1
- package/types/src/io/EmbeddedPart.d.ts +20 -0
- package/types/src/io/IEmbeddedPart.d.ts +63 -0
- package/types/src/io/IWorkbookIO.d.ts +185 -18
- package/types/src/io/WorkbookIO.d.ts +9 -0
- package/types/src/io/WorkbookOrigin.d.ts +20 -11
- package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
- package/types/src/io/_XmlFragment.d.ts +49 -0
- package/types/src/io/index.d.ts +1 -0
- package/types/src/license/LicenseDetails.d.ts +1 -0
- package/types/src/license/LicenseManager.d.ts +25 -1
- package/types/src/license/Types.d.ts +38 -0
- package/types/src/license/_Utils.d.ts +39 -0
- package/types/src/license/details.d.ts +24 -0
- package/types/src/license/license-key.d.ts +49 -2
- package/types/src/license/runtime.browser.d.ts +46 -0
- package/types/src/{lib/utils/utils.node.d.ts → license/runtime.node.d.ts} +19 -12
- package/types/src/listener/IListener.d.ts +23 -6
- package/types/src/listener/ListenerEmitter.d.ts +55 -6
- package/types/src/model/AbstractModel.d.ts +14 -5
- package/types/src/movable/AbstractMovableContent.d.ts +182 -0
- package/types/src/movable/CustomElement.d.ts +4 -5
- package/types/src/movable/ErrorContent.d.ts +49 -0
- package/types/src/movable/FormControl.d.ts +285 -0
- package/types/src/movable/GroupMember.d.ts +87 -0
- package/types/src/movable/ICustomElement.d.ts +7 -2
- package/types/src/movable/IErrorContent.d.ts +23 -0
- package/types/src/movable/IFormControl.d.ts +455 -0
- package/types/src/movable/IMovable.d.ts +405 -60
- package/types/src/movable/IMovableCollection.d.ts +64 -4
- package/types/src/movable/Movable.d.ts +161 -50
- package/types/src/movable/MovableCollection.d.ts +21 -10
- package/types/src/movable/MovableContentRegistry.d.ts +113 -0
- package/types/src/movable/_BuiltInContents.d.ts +14 -0
- package/types/src/movable/_ContentFactory.d.ts +35 -0
- package/types/src/movable/_DrawnBounds.d.ts +37 -0
- package/types/src/movable/_InsertableCollection.d.ts +39 -0
- package/types/src/movable/_MovableUtils.d.ts +5 -0
- package/types/src/movable/_PendingContent.d.ts +25 -0
- package/types/src/movable/_PlacementUtils.d.ts +55 -0
- package/types/src/movable/_RotatedFrame.d.ts +20 -0
- package/types/src/movable/index.d.ts +7 -1
- package/types/src/named/AbstractNamed.d.ts +1 -1
- package/types/src/named/INamed.d.ts +34 -1
- package/types/src/named/INamedCollection.d.ts +28 -2
- package/types/src/named/NamedCollection.d.ts +32 -19
- package/types/src/numFmt/BuiltInFormats.d.ts +20 -7
- package/types/src/numFmt/IFormatEngine.d.ts +2 -0
- package/types/src/numFmt/NumberFormatParser.d.ts +5 -0
- package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
- package/types/src/numFmt/_FormatCell.d.ts +11 -2
- package/types/src/numFmt/_NumFmtUtils.d.ts +0 -1
- package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +6 -0
- package/types/src/outline/IOutline.d.ts +186 -0
- package/types/src/outline/Outline.d.ts +157 -0
- package/types/src/outline/index.d.ts +2 -0
- package/types/src/person/IPerson.d.ts +99 -0
- package/types/src/person/IPersonCollection.d.ts +51 -0
- package/types/src/person/Person.d.ts +32 -0
- package/types/src/person/PersonCollection.d.ts +49 -0
- package/types/src/person/index.d.ts +4 -0
- package/types/src/picture/IPicture.d.ts +131 -4
- package/types/src/picture/Picture.d.ts +42 -14
- package/types/src/pivot/IPivotTable.d.ts +72 -0
- package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
- package/types/src/pivot/PivotCache.d.ts +34 -0
- package/types/src/pivot/PivotTable.d.ts +61 -0
- package/types/src/pivot/PivotTableCollection.d.ts +25 -0
- package/types/src/pivot/_PivotXml.d.ts +24 -0
- package/types/src/pivot/index.d.ts +6 -0
- package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
- package/types/src/primitives/Criteria.d.ts +1 -1
- package/types/src/primitives/Grouping.d.ts +65 -0
- package/types/src/primitives/LambdaBrand.d.ts +26 -0
- package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
- package/types/src/primitives/Range.d.ts +133 -25
- package/types/src/primitives/RangeStats.d.ts +30 -2
- package/types/src/primitives/ReferenceRange.d.ts +44 -0
- package/types/src/primitives/Runtime.d.ts +15 -2
- package/types/src/primitives/environment.browser.d.ts +9 -0
- package/types/src/primitives/environment.node.d.ts +10 -0
- package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
- package/types/src/primitives/stats/Cancellation.d.ts +13 -0
- package/types/src/primitives/stats/FrequencyStats.d.ts +10 -1
- package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
- package/types/src/primitives/stats/Ranked.d.ts +1 -1
- package/types/src/primitives/stats/SortedNumbers.d.ts +4 -2
- package/types/src/primitives/stats/index.d.ts +1 -0
- package/types/src/print/IPageLayout.d.ts +635 -0
- package/types/src/print/PageLayout.d.ts +258 -0
- package/types/src/print/index.d.ts +1 -1
- package/types/src/protectedRange/IProtectedRange.d.ts +6 -2
- package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
- package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
- package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
- package/types/src/protection/DefaultProtection.d.ts +12 -1
- package/types/src/protection/IProtection.d.ts +42 -2
- package/types/src/protection/PasswordHasher.d.ts +13 -0
- package/types/src/reference/ReferenceUtils.d.ts +80 -0
- package/types/src/reference/index.d.ts +2 -0
- package/types/src/resource/IResource.d.ts +21 -1
- package/types/src/resource/IResourceCollection.d.ts +9 -1
- package/types/src/resource/ResourceCollection.d.ts +6 -6
- package/types/src/richData/IRichDataKind.d.ts +22 -0
- package/types/src/richData/RichDataRegistry.d.ts +57 -0
- package/types/src/richData/RichText.d.ts +59 -0
- package/types/src/richData/index.d.ts +3 -0
- package/types/src/scripting/FunctionCollection.d.ts +49 -15
- package/types/src/scripting/IFunctionCollection.d.ts +62 -32
- package/types/src/scripting/IModule.d.ts +25 -0
- package/types/src/scripting/IModuleCollection.d.ts +17 -0
- package/types/src/scripting/IScript.d.ts +30 -28
- package/types/src/scripting/ITypedFunction.d.ts +1 -1
- package/types/src/scripting/Module.d.ts +34 -6
- package/types/src/scripting/ModuleCollection.d.ts +17 -12
- package/types/src/scripting/Runtime.d.ts +15 -0
- package/types/src/scripting/Scripts.d.ts +3 -7
- package/types/src/scripting/TypedFunction.d.ts +154 -18
- package/types/src/scripting/_FunctionIndex.d.ts +8 -3
- package/types/src/scripting/_ModuleUtils.d.ts +11 -1
- package/types/src/scripting/_ScriptUtils.d.ts +3 -0
- package/types/src/scripting/declarations.browser.d.ts +10 -0
- package/types/src/scripting/declarations.d.ts +52 -0
- package/types/src/scripting/declarations.node.d.ts +9 -0
- package/types/src/scripting/index.d.ts +3 -0
- package/types/src/selection/ChartElementSelection.d.ts +39 -0
- package/types/src/selection/IChartElementSelection.d.ts +103 -0
- package/types/src/selection/IItemSelection.d.ts +131 -0
- package/types/src/selection/IMovableSelection.d.ts +120 -0
- package/types/src/selection/IRangeSelection.d.ts +13 -8
- package/types/src/selection/ItemSelection.d.ts +49 -0
- package/types/src/selection/MovableSelection.d.ts +29 -0
- package/types/src/selection/RangeSelection.d.ts +19 -4
- package/types/src/selection/index.d.ts +4 -0
- package/types/src/shape/GeometryPreset.d.ts +197 -0
- package/types/src/shape/IGeometry.d.ts +380 -0
- package/types/src/shape/IShape.d.ts +342 -194
- package/types/src/shape/IShapeStyle.d.ts +109 -0
- package/types/src/shape/ITextBoxStyle.d.ts +85 -0
- package/types/src/shape/Shape.d.ts +107 -21
- package/types/src/shape/ShapeStyleUtils.d.ts +66 -0
- package/types/src/shape/_ConnectorFrame.d.ts +32 -0
- package/types/src/shape/_ConnectorRoute.d.ts +33 -0
- package/types/src/shape/_Connectors.d.ts +108 -0
- package/types/src/shape/_Geometry.d.ts +14 -0
- package/types/src/shape/_GeometryLoader.d.ts +21 -0
- package/types/src/shape/_ShapeStyle.d.ts +79 -0
- package/types/src/shape/_builtIn/_BuiltInChunks.d.ts +10 -0
- package/types/src/shape/_builtIn/_BuiltInDef.d.ts +9 -0
- package/types/src/shape/_builtIn/arrows.d.ts +6 -0
- package/types/src/shape/_builtIn/basic.d.ts +6 -0
- package/types/src/shape/_builtIn/callouts.d.ts +6 -0
- package/types/src/shape/_builtIn/flowchart.d.ts +6 -0
- package/types/src/shape/_builtIn/lines.d.ts +6 -0
- package/types/src/shape/_builtIn/math.d.ts +6 -0
- package/types/src/shape/_builtIn/other.d.ts +6 -0
- package/types/src/shape/_builtIn/rectangles.d.ts +6 -0
- package/types/src/shape/_builtIn/starsBanners.d.ts +6 -0
- package/types/src/shape/geometry/_strokeEnds.d.ts +7 -0
- package/types/src/shape/geometry/format.d.ts +3 -0
- package/types/src/shape/geometry/geometry.d.ts +85 -0
- package/types/src/shape/geometry/guides.d.ts +54 -0
- package/types/src/shape/geometry/handles.d.ts +14 -0
- package/types/src/shape/geometry/index.d.ts +7 -0
- package/types/src/shape/geometry/lineEnds.d.ts +54 -0
- package/types/src/shape/geometry/paths.d.ts +35 -0
- package/types/src/shape/geometry/segments.d.ts +114 -0
- package/types/src/shape/index.d.ts +4 -0
- package/types/src/sheet/CellRegion.d.ts +43 -3
- package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
- package/types/src/sheet/IOpaqueSheet.d.ts +46 -0
- package/types/src/sheet/ISheet.d.ts +81 -931
- package/types/src/sheet/IWorksheet.d.ts +1514 -0
- package/types/src/sheet/{ISheetCollection.d.ts → IWorksheetCollection.d.ts} +38 -16
- package/types/src/sheet/NamedCellRange.d.ts +17 -8
- package/types/src/sheet/NamedRange.d.ts +10 -2
- package/types/src/sheet/OpaqueSheet.d.ts +114 -0
- package/types/src/sheet/SheetCell.d.ts +96 -39
- package/types/src/sheet/SheetRange.d.ts +130 -27
- package/types/src/sheet/SheetRanges.d.ts +33 -18
- package/types/src/sheet/Worksheet.d.ts +2250 -0
- package/types/src/sheet/WorksheetCollection.d.ts +39 -0
- package/types/src/sheet/_Anomalies.d.ts +109 -0
- package/types/src/sheet/_AnomalyFormulaChecks.d.ts +125 -0
- package/types/src/sheet/_AnomalyLabelChecks.d.ts +21 -0
- package/types/src/sheet/_CellBuffer.d.ts +224 -0
- package/types/src/sheet/_CopyUtils.d.ts +13 -6
- package/types/src/sheet/_HeldFormula.d.ts +69 -0
- package/types/src/sheet/_IgnoredErrors.d.ts +46 -0
- package/types/src/sheet/_InvalidSheetRange.d.ts +10 -9
- package/types/src/sheet/_Kinds.d.ts +34 -0
- package/types/src/sheet/_Labels.d.ts +38 -0
- package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
- package/types/src/sheet/_RangeStateSweep.d.ts +15 -0
- package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
- package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
- package/types/src/sheet/_SheetAutoFitUtils.d.ts +5 -5
- package/types/src/sheet/_SheetChangeEvent.d.ts +72 -0
- package/types/src/sheet/_SheetCoords.d.ts +3 -3
- package/types/src/sheet/_SheetEvents.d.ts +43 -0
- package/types/src/sheet/_SheetFilterUtils.d.ts +51 -3
- package/types/src/sheet/_SheetIntents.d.ts +314 -0
- package/types/src/sheet/_SheetMessages.d.ts +1 -1
- package/types/src/sheet/_SheetMutations.d.ts +185 -66
- package/types/src/sheet/_SheetSortUtils.d.ts +2 -2
- package/types/src/sheet/_SheetStateReader.d.ts +35 -11
- package/types/src/sheet/_SheetStateTypes.d.ts +143 -79
- package/types/src/sheet/_SheetUtils.d.ts +59 -41
- package/types/src/sheet/_WatchAnchor.d.ts +106 -0
- package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +4 -4
- package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +3 -3
- package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +3 -3
- package/types/src/sheet/index.d.ts +5 -2
- package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
- package/types/src/sheet/spatial/index.d.ts +1 -0
- package/types/src/sheet/style/SheetCellStyle.d.ts +223 -337
- package/types/src/sheet/style/SheetDirectStyle.d.ts +31 -20
- package/types/src/sheet/style/SheetNamedStyle.d.ts +19 -17
- package/types/src/sheet/style/SheetTableStyle.d.ts +5 -5
- package/types/src/sheet/style/_DigitWidth.d.ts +7 -0
- package/types/src/sheet/style/_Resolvers.d.ts +17 -10
- package/types/src/sheet/style/_StyleUtils.d.ts +34 -40
- package/types/src/sheetHeader/ISheetHeader.d.ts +96 -55
- package/types/src/sheetHeader/SheetCellHeader.d.ts +6 -0
- package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +2 -0
- package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +2 -0
- package/types/src/sheetHeader/SheetHeader.d.ts +48 -27
- package/types/src/sheetHeader/_HeaderMetrics.d.ts +37 -0
- package/types/src/sheetHeader/_HeaderUtils.d.ts +5 -4
- package/types/src/sheetProtection/{ISheetProtection.d.ts → IWorksheetProtection.d.ts} +64 -30
- package/types/src/sheetProtection/WorksheetProtection.d.ts +51 -0
- package/types/src/sheetProtection/index.d.ts +1 -1
- package/types/src/sheetView/{ISheetView.d.ts → IWorksheetView.d.ts} +230 -69
- package/types/src/sheetView/WorksheetView.d.ts +139 -0
- package/types/src/sheetView/_SheetViewUtils.d.ts +5 -3
- package/types/src/sheetView/index.d.ts +1 -1
- package/types/src/slicer/ISlicer.d.ts +304 -17
- package/types/src/slicer/ISlicerStyle.d.ts +109 -0
- package/types/src/slicer/Slicer.d.ts +128 -13
- package/types/src/slicer/SlicerStyle.d.ts +25 -0
- package/types/src/slicer/_BuiltInSlicerStyles.d.ts +13 -0
- package/types/src/slicer/_SlicerUtils.d.ts +30 -0
- package/types/src/slicer/index.d.ts +1 -0
- package/types/src/sort/ISort.d.ts +39 -7
- package/types/src/string/IStringCollection.d.ts +5 -0
- package/types/src/string/StringCollection.d.ts +6 -6
- package/types/src/style/{IStyle.d.ts → ICellStyle.d.ts} +117 -85
- package/types/src/style/INamedStyleCollection.d.ts +72 -0
- package/types/src/style/ISlicerStyleCollection.d.ts +77 -0
- package/types/src/style/IStyleCollection.d.ts +91 -60
- package/types/src/style/ITableStyleCollection.d.ts +89 -0
- package/types/src/style/NamedStyleCollection.d.ts +39 -0
- package/types/src/style/SlicerStyleCollection.d.ts +46 -0
- package/types/src/style/StyleCollection.d.ts +81 -26
- package/types/src/style/TableStyleCollection.d.ts +49 -0
- package/types/src/style/_BuiltInStyleDefs.d.ts +9 -8
- package/types/src/style/_BuiltInStyleNames.d.ts +2 -2
- package/types/src/style/index.d.ts +7 -1
- package/types/src/table/AnchoredTable.d.ts +723 -78
- package/types/src/table/AutoTable.d.ts +8 -6
- package/types/src/table/ITable.d.ts +289 -49
- package/types/src/table/ITableCollection.d.ts +12 -0
- package/types/src/table/ITableStyle.d.ts +37 -37
- package/types/src/table/TableCollection.d.ts +19 -8
- package/types/src/table/_FilterField.d.ts +19 -6
- package/types/src/table/_NamedTable.d.ts +20 -4
- package/types/src/table/_NamedTableSource.d.ts +3 -2
- package/types/src/table/_SortField.d.ts +2 -0
- package/types/src/table/_TableColumn.d.ts +13 -2
- package/types/src/table/_TableMessages.d.ts +1 -0
- package/types/src/table/_TableUtils.d.ts +40 -0
- package/types/src/text/Bullet.d.ts +4 -0
- package/types/src/text/IText.d.ts +150 -15
- package/types/src/text/ITextFrame.d.ts +110 -1
- package/types/src/text/TextBoxAlignment.d.ts +25 -16
- package/types/src/text/TextEngine.d.ts +34 -0
- package/types/src/text/TextFrame.d.ts +8 -2
- package/types/src/text/TextLine.d.ts +4 -0
- package/types/src/text/TextParagraph.d.ts +4 -0
- package/types/src/text/TextRotation.d.ts +3 -3
- package/types/src/text/TextRun.d.ts +12 -2
- package/types/src/text/TextStacked.d.ts +83 -0
- package/types/src/text/TextWrapper.d.ts +32 -26
- package/types/src/text/_TextUtils.d.ts +5 -5
- package/types/src/text/_TextWrapperFallback.d.ts +49 -0
- package/types/src/text/impl/TabStrategy.d.ts +3 -1
- package/types/src/text/index.d.ts +1 -0
- package/types/src/text/richtext/IRichText.d.ts +50 -0
- package/types/src/text/richtext/index.d.ts +1 -1
- package/types/src/theme/ITheme.d.ts +153 -11
- package/types/src/theme/IThemeCollection.d.ts +2 -0
- package/types/src/theme/ThemeCollection.d.ts +16 -7
- package/types/src/theme/_OfficeFontScheme.d.ts +8 -0
- package/types/src/theme/_OfficeFormatScheme.d.ts +3 -0
- package/types/src/transaction/ITransaction.d.ts +277 -45
- package/types/src/transaction/Transaction.d.ts +108 -11
- package/types/src/transaction/TransactionUndoManager.d.ts +4 -1
- package/types/src/transaction/_BatchHandle.d.ts +118 -0
- package/types/src/type/AbstractCollection.d.ts +92 -0
- package/types/src/type/ICollection.d.ts +131 -1
- package/types/src/type/IProperties.d.ts +1 -1
- package/types/src/type/ITypes.d.ts +9 -7
- package/types/src/type/index.d.ts +1 -0
- package/types/src/utils/_CSSUtils.d.ts +4 -4
- package/types/src/wasm/_fontsWasm.d.ts +7 -0
- package/types/src/wasm/_sdkWasm.d.ts +7 -0
- package/types/src/wasm/fontsWasm.d.ts +32 -0
- package/types/src/wasm/index.d.ts +3 -0
- package/types/src/wasm/loader.browser.d.ts +9 -0
- package/types/src/wasm/loader.node.d.ts +9 -0
- package/types/src/wasm/sdkWasm.d.ts +32 -0
- package/types/src/workbook/IWorkbook.d.ts +404 -73
- package/types/src/workbook/Workbook.d.ts +196 -28
- package/types/src/workbook/WorkbookRange.d.ts +2 -2
- package/types/src/workbook/WorkbookRanges.d.ts +2 -2
- package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
- package/types/src/workbook/_WorkbookMessages.d.ts +5 -0
- package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
- package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
- package/types/src/workbookView/IWorkbookView.d.ts +94 -0
- package/types/src/workbookView/WorkbookView.d.ts +26 -0
- package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
- package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
- package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
- package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
- package/browser/cjs/Dv3x6zut1ZRUt3IF.cjs +0 -10
- package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
- package/browser/cjs/a0Z-SXs_N71CtqYb.cjs +0 -1
- package/browser/cjs/index.cjs +0 -3
- package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
- package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
- package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
- package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
- package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
- package/types/src/cellRange/_GraphNode.d.ts +0 -38
- package/types/src/collections/OverlappingRangeIterator.d.ts +0 -91
- package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +0 -12
- package/types/src/dataValidation/_Utils.d.ts +0 -10
- package/types/src/font/CanvasFontMeasurer.d.ts +0 -25
- package/types/src/font/FontKitFontMeasurer.d.ts +0 -11
- package/types/src/font/SimpleFontMeasurer.d.ts +0 -4
- package/types/src/lib/utils/_Utils.d.ts +0 -27
- package/types/src/lib/utils/utils.browser.d.ts +0 -33
- package/types/src/movable/IGroup.d.ts +0 -30
- package/types/src/movable/IMovableSelection.d.ts +0 -49
- package/types/src/print/IPrint.d.ts +0 -234
- package/types/src/sheet/Sheet.d.ts +0 -1107
- package/types/src/sheet/SheetCollection.d.ts +0 -18
- package/types/src/sheet/listener/RangesListener.d.ts +0 -32
- package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
- package/types/src/sheet/listener/index.d.ts +0 -3
- package/types/src/sheetProtection/SheetProtection.d.ts +0 -39
- package/types/src/sheetView/SheetView.d.ts +0 -113
- package/types/src/text/richtext/IStyledFont.d.ts +0 -330
- /package/types/src/{lib/utils → license}/banner.d.ts +0 -0
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.11
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import { FormulaError as
|
|
9
|
-
function
|
|
7
|
+
import { An as e, Bn as t, Dn as n, Fn as r, Gn as i, Hn as a, In as o, Jn as s, Kn as c, Ln as l, Nn as u, Pn as d, Rn as f, Tn as p, Un as m, Vn as h, Wn as g, Xn as _, Yn as v, Zn as y, dr as b, ir as x, jn as S, kn as ee, nr as te, or as C, qn as w, rr as ne, sr as re, zn as ie } from "./C16ycKja6zG0crV_.mjs";
|
|
8
|
+
import { FormulaError as T } from "@sheetxl/primitives";
|
|
9
|
+
function E(e) {
|
|
10
10
|
console && console.error && console.error(`Error: ${e}`);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function D(e) {
|
|
13
13
|
console && console.warn && console.warn(`Warning: ${e}`);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ae(e) {
|
|
16
16
|
let t = (/* @__PURE__ */ new Date()).getTime(), n = e();
|
|
17
17
|
return {
|
|
18
18
|
time: (/* @__PURE__ */ new Date()).getTime() - t,
|
|
19
19
|
value: n
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function O(e) {
|
|
23
23
|
function t() {}
|
|
24
24
|
t.prototype = e;
|
|
25
25
|
let n = new t();
|
|
@@ -28,7 +28,7 @@ function a(e) {
|
|
|
28
28
|
}
|
|
29
29
|
return r(), r(), e;
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var k = class {
|
|
32
32
|
get definition() {
|
|
33
33
|
return this._definition;
|
|
34
34
|
}
|
|
@@ -43,9 +43,9 @@ var o = class {
|
|
|
43
43
|
t.accept(e);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, A = class extends k {
|
|
47
47
|
constructor(e) {
|
|
48
|
-
super([]), this.idx = 1, Object.assign(this,
|
|
48
|
+
super([]), this.idx = 1, Object.assign(this, B(e));
|
|
49
49
|
}
|
|
50
50
|
set definition(e) {}
|
|
51
51
|
get definition() {
|
|
@@ -54,35 +54,35 @@ var o = class {
|
|
|
54
54
|
accept(e) {
|
|
55
55
|
e.visit(this);
|
|
56
56
|
}
|
|
57
|
-
},
|
|
57
|
+
}, j = class extends k {
|
|
58
58
|
constructor(e) {
|
|
59
|
-
super(e.definition), this.orgText = "", Object.assign(this,
|
|
59
|
+
super(e.definition), this.orgText = "", Object.assign(this, B(e));
|
|
60
60
|
}
|
|
61
|
-
},
|
|
61
|
+
}, M = class extends k {
|
|
62
62
|
constructor(e) {
|
|
63
|
-
super(e.definition), this.ignoreAmbiguities = !1, Object.assign(this,
|
|
63
|
+
super(e.definition), this.ignoreAmbiguities = !1, Object.assign(this, B(e));
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, N = class extends k {
|
|
66
66
|
constructor(e) {
|
|
67
|
-
super(e.definition), this.idx = 1, Object.assign(this,
|
|
67
|
+
super(e.definition), this.idx = 1, Object.assign(this, B(e));
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, P = class extends k {
|
|
70
70
|
constructor(e) {
|
|
71
|
-
super(e.definition), this.idx = 1, Object.assign(this,
|
|
71
|
+
super(e.definition), this.idx = 1, Object.assign(this, B(e));
|
|
72
72
|
}
|
|
73
|
-
},
|
|
73
|
+
}, F = class extends k {
|
|
74
74
|
constructor(e) {
|
|
75
|
-
super(e.definition), this.idx = 1, Object.assign(this,
|
|
75
|
+
super(e.definition), this.idx = 1, Object.assign(this, B(e));
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, I = class extends k {
|
|
78
78
|
constructor(e) {
|
|
79
|
-
super(e.definition), this.idx = 1, Object.assign(this,
|
|
79
|
+
super(e.definition), this.idx = 1, Object.assign(this, B(e));
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, L = class extends k {
|
|
82
82
|
constructor(e) {
|
|
83
|
-
super(e.definition), this.idx = 1, Object.assign(this,
|
|
83
|
+
super(e.definition), this.idx = 1, Object.assign(this, B(e));
|
|
84
84
|
}
|
|
85
|
-
},
|
|
85
|
+
}, R = class extends k {
|
|
86
86
|
get definition() {
|
|
87
87
|
return this._definition;
|
|
88
88
|
}
|
|
@@ -90,21 +90,21 @@ var o = class {
|
|
|
90
90
|
this._definition = e;
|
|
91
91
|
}
|
|
92
92
|
constructor(e) {
|
|
93
|
-
super(e.definition), this.idx = 1, this.ignoreAmbiguities = !1, this.hasPredicates = !1, Object.assign(this,
|
|
93
|
+
super(e.definition), this.idx = 1, this.ignoreAmbiguities = !1, this.hasPredicates = !1, Object.assign(this, B(e));
|
|
94
94
|
}
|
|
95
|
-
},
|
|
95
|
+
}, z = class {
|
|
96
96
|
constructor(e) {
|
|
97
|
-
this.idx = 1, Object.assign(this,
|
|
97
|
+
this.idx = 1, Object.assign(this, B(e));
|
|
98
98
|
}
|
|
99
99
|
accept(e) {
|
|
100
100
|
e.visit(this);
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function oe(e) {
|
|
104
104
|
function t(e) {
|
|
105
|
-
return e.map(
|
|
105
|
+
return e.map(oe);
|
|
106
106
|
}
|
|
107
|
-
if (e instanceof
|
|
107
|
+
if (e instanceof A) {
|
|
108
108
|
let t = {
|
|
109
109
|
type: "NonTerminal",
|
|
110
110
|
name: e.nonTerminalName,
|
|
@@ -112,43 +112,43 @@ function _(e) {
|
|
|
112
112
|
};
|
|
113
113
|
return typeof e.label == "string" && (t.label = e.label), t;
|
|
114
114
|
}
|
|
115
|
-
if (e instanceof
|
|
115
|
+
if (e instanceof M) return {
|
|
116
116
|
type: "Alternative",
|
|
117
117
|
definition: t(e.definition)
|
|
118
118
|
};
|
|
119
|
-
if (e instanceof
|
|
119
|
+
if (e instanceof N) return {
|
|
120
120
|
type: "Option",
|
|
121
121
|
idx: e.idx,
|
|
122
122
|
definition: t(e.definition)
|
|
123
123
|
};
|
|
124
|
-
if (e instanceof
|
|
124
|
+
if (e instanceof P) return {
|
|
125
125
|
type: "RepetitionMandatory",
|
|
126
126
|
idx: e.idx,
|
|
127
127
|
definition: t(e.definition)
|
|
128
128
|
};
|
|
129
|
-
if (e instanceof
|
|
129
|
+
if (e instanceof F) return {
|
|
130
130
|
type: "RepetitionMandatoryWithSeparator",
|
|
131
131
|
idx: e.idx,
|
|
132
|
-
separator:
|
|
132
|
+
separator: oe(new z({ terminalType: e.separator })),
|
|
133
133
|
definition: t(e.definition)
|
|
134
134
|
};
|
|
135
|
-
if (e instanceof
|
|
135
|
+
if (e instanceof L) return {
|
|
136
136
|
type: "RepetitionWithSeparator",
|
|
137
137
|
idx: e.idx,
|
|
138
|
-
separator:
|
|
138
|
+
separator: oe(new z({ terminalType: e.separator })),
|
|
139
139
|
definition: t(e.definition)
|
|
140
140
|
};
|
|
141
|
-
if (e instanceof
|
|
141
|
+
if (e instanceof I) return {
|
|
142
142
|
type: "Repetition",
|
|
143
143
|
idx: e.idx,
|
|
144
144
|
definition: t(e.definition)
|
|
145
145
|
};
|
|
146
|
-
if (e instanceof
|
|
146
|
+
if (e instanceof R) return {
|
|
147
147
|
type: "Alternation",
|
|
148
148
|
idx: e.idx,
|
|
149
149
|
definition: t(e.definition)
|
|
150
150
|
};
|
|
151
|
-
if (e instanceof
|
|
151
|
+
if (e instanceof z) {
|
|
152
152
|
let t = {
|
|
153
153
|
type: "Terminal",
|
|
154
154
|
name: e.terminalType.name,
|
|
@@ -159,7 +159,7 @@ function _(e) {
|
|
|
159
159
|
let i = e.terminalType.PATTERN;
|
|
160
160
|
return e.terminalType.PATTERN && (t.pattern = i instanceof RegExp ? i.source : i), t;
|
|
161
161
|
}
|
|
162
|
-
if (e instanceof
|
|
162
|
+
if (e instanceof j) return {
|
|
163
163
|
type: "Rule",
|
|
164
164
|
name: e.name,
|
|
165
165
|
orgText: e.orgText,
|
|
@@ -168,23 +168,23 @@ function _(e) {
|
|
|
168
168
|
throw Error("non exhaustive match");
|
|
169
169
|
var n, r;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function B(e) {
|
|
172
172
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
|
|
173
173
|
}
|
|
174
|
-
var
|
|
174
|
+
var se = class {
|
|
175
175
|
visit(e) {
|
|
176
176
|
let t = e;
|
|
177
177
|
switch (t.constructor) {
|
|
178
|
-
case
|
|
179
|
-
case
|
|
180
|
-
case
|
|
181
|
-
case
|
|
182
|
-
case
|
|
183
|
-
case
|
|
184
|
-
case
|
|
185
|
-
case
|
|
186
|
-
case
|
|
187
|
-
case
|
|
178
|
+
case A: return this.visitNonTerminal(t);
|
|
179
|
+
case M: return this.visitAlternative(t);
|
|
180
|
+
case N: return this.visitOption(t);
|
|
181
|
+
case P: return this.visitRepetitionMandatory(t);
|
|
182
|
+
case F: return this.visitRepetitionMandatoryWithSeparator(t);
|
|
183
|
+
case L: return this.visitRepetitionWithSeparator(t);
|
|
184
|
+
case I: return this.visitRepetition(t);
|
|
185
|
+
case R: return this.visitAlternation(t);
|
|
186
|
+
case z: return this.visitTerminal(t);
|
|
187
|
+
case j: return this.visitRule(t);
|
|
188
188
|
default: throw Error("non exhaustive match");
|
|
189
189
|
}
|
|
190
190
|
}
|
|
@@ -199,34 +199,34 @@ var y = class {
|
|
|
199
199
|
visitTerminal(e) {}
|
|
200
200
|
visitRule(e) {}
|
|
201
201
|
};
|
|
202
|
-
function
|
|
203
|
-
return e instanceof
|
|
202
|
+
function ce(e, t = []) {
|
|
203
|
+
return e instanceof N || e instanceof I || e instanceof L || (e instanceof R ? e.definition.some((e) => ce(e, t)) : !(e instanceof A && t.includes(e)) && e instanceof k && (e instanceof A && t.push(e), e.definition.every((e) => ce(e, t))));
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
if (e instanceof
|
|
207
|
-
if (e instanceof
|
|
208
|
-
if (e instanceof
|
|
209
|
-
if (e instanceof
|
|
210
|
-
if (e instanceof
|
|
211
|
-
if (e instanceof
|
|
212
|
-
if (e instanceof
|
|
213
|
-
if (e instanceof
|
|
205
|
+
function V(e) {
|
|
206
|
+
if (e instanceof A) return "SUBRULE";
|
|
207
|
+
if (e instanceof N) return "OPTION";
|
|
208
|
+
if (e instanceof R) return "OR";
|
|
209
|
+
if (e instanceof P) return "AT_LEAST_ONE";
|
|
210
|
+
if (e instanceof F) return "AT_LEAST_ONE_SEP";
|
|
211
|
+
if (e instanceof L) return "MANY_SEP";
|
|
212
|
+
if (e instanceof I) return "MANY";
|
|
213
|
+
if (e instanceof z) return "CONSUME";
|
|
214
214
|
throw Error("non exhaustive match");
|
|
215
215
|
}
|
|
216
|
-
var
|
|
216
|
+
var le = class {
|
|
217
217
|
walk(e, t = []) {
|
|
218
218
|
e.definition.forEach((n, r) => {
|
|
219
219
|
let i = e.definition.slice(r + 1);
|
|
220
|
-
if (n instanceof
|
|
221
|
-
else if (n instanceof
|
|
222
|
-
else if (n instanceof
|
|
223
|
-
else if (n instanceof
|
|
224
|
-
else if (n instanceof
|
|
225
|
-
else if (n instanceof
|
|
226
|
-
else if (n instanceof
|
|
227
|
-
else if (n instanceof
|
|
220
|
+
if (n instanceof A) this.walkProdRef(n, i, t);
|
|
221
|
+
else if (n instanceof z) this.walkTerminal(n, i, t);
|
|
222
|
+
else if (n instanceof M) this.walkFlat(n, i, t);
|
|
223
|
+
else if (n instanceof N) this.walkOption(n, i, t);
|
|
224
|
+
else if (n instanceof P) this.walkAtLeastOne(n, i, t);
|
|
225
|
+
else if (n instanceof F) this.walkAtLeastOneSep(n, i, t);
|
|
226
|
+
else if (n instanceof L) this.walkManySep(n, i, t);
|
|
227
|
+
else if (n instanceof I) this.walkMany(n, i, t);
|
|
228
228
|
else {
|
|
229
|
-
if (!(n instanceof
|
|
229
|
+
if (!(n instanceof R)) throw Error("non exhaustive match");
|
|
230
230
|
this.walkOr(n, i, t);
|
|
231
231
|
}
|
|
232
232
|
});
|
|
@@ -242,51 +242,51 @@ var S = class {
|
|
|
242
242
|
this.walk(e, r);
|
|
243
243
|
}
|
|
244
244
|
walkAtLeastOne(e, t, n) {
|
|
245
|
-
let r = [new
|
|
245
|
+
let r = [new N({ definition: e.definition })].concat(t, n);
|
|
246
246
|
this.walk(e, r);
|
|
247
247
|
}
|
|
248
248
|
walkAtLeastOneSep(e, t, n) {
|
|
249
|
-
let r =
|
|
249
|
+
let r = ue(e, t, n);
|
|
250
250
|
this.walk(e, r);
|
|
251
251
|
}
|
|
252
252
|
walkMany(e, t, n) {
|
|
253
|
-
let r = [new
|
|
253
|
+
let r = [new N({ definition: e.definition })].concat(t, n);
|
|
254
254
|
this.walk(e, r);
|
|
255
255
|
}
|
|
256
256
|
walkManySep(e, t, n) {
|
|
257
|
-
let r =
|
|
257
|
+
let r = ue(e, t, n);
|
|
258
258
|
this.walk(e, r);
|
|
259
259
|
}
|
|
260
260
|
walkOr(e, t, n) {
|
|
261
261
|
let r = t.concat(n);
|
|
262
262
|
e.definition.forEach((e) => {
|
|
263
|
-
let t = new
|
|
263
|
+
let t = new M({ definition: [e] });
|
|
264
264
|
this.walk(t, r);
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
|
-
function
|
|
269
|
-
return [new
|
|
268
|
+
function ue(e, t, n) {
|
|
269
|
+
return [new N({ definition: [new z({ terminalType: e.separator })].concat(e.definition) })].concat(t, n);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
if (e instanceof
|
|
273
|
-
if (e instanceof
|
|
271
|
+
function de(e) {
|
|
272
|
+
if (e instanceof A) return de(e.referencedRule);
|
|
273
|
+
if (e instanceof z) return [e.terminalType];
|
|
274
274
|
if (function(e) {
|
|
275
|
-
return e instanceof
|
|
275
|
+
return e instanceof M || e instanceof N || e instanceof I || e instanceof P || e instanceof F || e instanceof L || e instanceof z || e instanceof j;
|
|
276
276
|
}(e)) return function(e) {
|
|
277
277
|
let t = [], n = e.definition, r, i = 0, a = n.length > i, o = !0;
|
|
278
|
-
for (; a && o;) r = n[i], o =
|
|
278
|
+
for (; a && o;) r = n[i], o = ce(r), t = t.concat(de(r)), i += 1, a = n.length > i;
|
|
279
279
|
return [...new Set(t)];
|
|
280
280
|
}(e);
|
|
281
281
|
if (function(e) {
|
|
282
|
-
return e instanceof
|
|
282
|
+
return e instanceof R;
|
|
283
283
|
}(e)) return function(e) {
|
|
284
|
-
let t = e.definition.map((e) =>
|
|
284
|
+
let t = e.definition.map((e) => de(e));
|
|
285
285
|
return [...new Set(t.flat())];
|
|
286
286
|
}(e);
|
|
287
287
|
throw Error("non exhaustive match");
|
|
288
288
|
}
|
|
289
|
-
var
|
|
289
|
+
var fe = "_~IN~_", pe = class extends le {
|
|
290
290
|
constructor(e) {
|
|
291
291
|
super(), this.topProd = e, this.follows = {};
|
|
292
292
|
}
|
|
@@ -295,67 +295,67 @@ var T = "_~IN~_", E = class extends S {
|
|
|
295
295
|
}
|
|
296
296
|
walkTerminal(e, t, n) {}
|
|
297
297
|
walkProdRef(e, t, n) {
|
|
298
|
-
let r = (i = e.referencedRule, a = e.idx, i.name + a +
|
|
298
|
+
let r = (i = e.referencedRule, a = e.idx, i.name + a + fe + this.topProd.name);
|
|
299
299
|
var i, a;
|
|
300
|
-
let o =
|
|
300
|
+
let o = de(new M({ definition: t.concat(n) }));
|
|
301
301
|
this.follows[r] = o;
|
|
302
302
|
}
|
|
303
303
|
};
|
|
304
|
-
function
|
|
304
|
+
function H(e) {
|
|
305
305
|
return e.charCodeAt(0);
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function me(e, t) {
|
|
308
308
|
Array.isArray(e) ? e.forEach(function(e) {
|
|
309
309
|
t.push(e);
|
|
310
310
|
}) : t.push(e);
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function U(e, t) {
|
|
313
313
|
if (!0 === e[t]) throw "duplicate flag " + t;
|
|
314
314
|
e[t], e[t] = !0;
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function W(e) {
|
|
317
317
|
if (e === void 0) throw Error("Internal Error - Should never get here!");
|
|
318
318
|
return !0;
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function he() {
|
|
321
321
|
throw Error("Internal Error - Should never get here!");
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function ge(e) {
|
|
324
324
|
return e.type === "Character";
|
|
325
325
|
}
|
|
326
|
-
var
|
|
327
|
-
for (let e =
|
|
328
|
-
var
|
|
329
|
-
for (let e =
|
|
330
|
-
for (let e =
|
|
331
|
-
var
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
],
|
|
326
|
+
var _e = [];
|
|
327
|
+
for (let e = H("0"); e <= H("9"); e++) _e.push(e);
|
|
328
|
+
var ve = [H("_")].concat(_e);
|
|
329
|
+
for (let e = H("a"); e <= H("z"); e++) ve.push(e);
|
|
330
|
+
for (let e = H("A"); e <= H("Z"); e++) ve.push(e);
|
|
331
|
+
var ye = [
|
|
332
|
+
H(" "),
|
|
333
|
+
H("\f"),
|
|
334
|
+
H("\n"),
|
|
335
|
+
H("\r"),
|
|
336
|
+
H(" "),
|
|
337
|
+
H("\v"),
|
|
338
|
+
H(" "),
|
|
339
|
+
H("\xA0"),
|
|
340
|
+
H(" "),
|
|
341
|
+
H(" "),
|
|
342
|
+
H(" "),
|
|
343
|
+
H(" "),
|
|
344
|
+
H(" "),
|
|
345
|
+
H(" "),
|
|
346
|
+
H(" "),
|
|
347
|
+
H(" "),
|
|
348
|
+
H(" "),
|
|
349
|
+
H(" "),
|
|
350
|
+
H(" "),
|
|
351
|
+
H(" "),
|
|
352
|
+
H("\u2028"),
|
|
353
|
+
H("\u2029"),
|
|
354
|
+
H(" "),
|
|
355
|
+
H(" "),
|
|
356
|
+
H(" "),
|
|
357
|
+
H("")
|
|
358
|
+
], be = /[0-9a-fA-F]/, xe = /[0-9]/, Se = /[1-9]/, Ce = class {
|
|
359
359
|
visitChildren(e) {
|
|
360
360
|
for (let t in e) {
|
|
361
361
|
let n = e[t];
|
|
@@ -435,7 +435,7 @@ var ee = [
|
|
|
435
435
|
visitGroup(e) {}
|
|
436
436
|
visitGroupBackReference(e) {}
|
|
437
437
|
visitQuantifier(e) {}
|
|
438
|
-
},
|
|
438
|
+
}, we = {}, Te = new class {
|
|
439
439
|
constructor() {
|
|
440
440
|
this.idx = 0, this.input = "", this.groupIdx = 0;
|
|
441
441
|
}
|
|
@@ -467,18 +467,18 @@ var ee = [
|
|
|
467
467
|
};
|
|
468
468
|
for (; this.isRegExpFlag();) switch (this.popChar()) {
|
|
469
469
|
case "g":
|
|
470
|
-
|
|
470
|
+
U(n, "global");
|
|
471
471
|
break;
|
|
472
472
|
case "i":
|
|
473
|
-
|
|
473
|
+
U(n, "ignoreCase");
|
|
474
474
|
break;
|
|
475
475
|
case "m":
|
|
476
|
-
|
|
476
|
+
U(n, "multiLine");
|
|
477
477
|
break;
|
|
478
478
|
case "u":
|
|
479
|
-
|
|
479
|
+
U(n, "unicode");
|
|
480
480
|
break;
|
|
481
|
-
case "y":
|
|
481
|
+
case "y": U(n, "sticky");
|
|
482
482
|
}
|
|
483
483
|
if (this.idx !== this.input.length) throw Error("Redundant input: " + this.input.substring(this.idx));
|
|
484
484
|
return {
|
|
@@ -548,7 +548,7 @@ var ee = [
|
|
|
548
548
|
case "!": t = "NegativeLookbehind";
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
|
|
551
|
+
W(t);
|
|
552
552
|
let n = this.disjunction();
|
|
553
553
|
return this.consumeChar(")"), {
|
|
554
554
|
type: t,
|
|
@@ -556,7 +556,7 @@ var ee = [
|
|
|
556
556
|
loc: this.loc(e)
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
return
|
|
559
|
+
return he();
|
|
560
560
|
}
|
|
561
561
|
quantifier(e = !1) {
|
|
562
562
|
let t, n = this.idx;
|
|
@@ -564,13 +564,13 @@ var ee = [
|
|
|
564
564
|
case "*":
|
|
565
565
|
t = {
|
|
566
566
|
atLeast: 0,
|
|
567
|
-
atMost:
|
|
567
|
+
atMost: 1 / 0
|
|
568
568
|
};
|
|
569
569
|
break;
|
|
570
570
|
case "+":
|
|
571
571
|
t = {
|
|
572
572
|
atLeast: 1,
|
|
573
|
-
atMost:
|
|
573
|
+
atMost: 1 / 0
|
|
574
574
|
};
|
|
575
575
|
break;
|
|
576
576
|
case "?":
|
|
@@ -595,13 +595,13 @@ var ee = [
|
|
|
595
595
|
atMost: e
|
|
596
596
|
}) : t = {
|
|
597
597
|
atLeast: n,
|
|
598
|
-
atMost:
|
|
598
|
+
atMost: 1 / 0
|
|
599
599
|
}, this.consumeChar("}");
|
|
600
600
|
}
|
|
601
601
|
if (!0 === e && t === void 0) return;
|
|
602
|
-
|
|
602
|
+
W(t);
|
|
603
603
|
}
|
|
604
|
-
if (!0 !== e || t !== void 0) return
|
|
604
|
+
if (!0 !== e || t !== void 0) return W(t) ? (this.peekChar(0) === "?" ? (this.consumeChar("?"), t.greedy = !1) : t.greedy = !0, t.type = "Quantifier", t.loc = this.loc(n), t) : void 0;
|
|
605
605
|
}
|
|
606
606
|
atom() {
|
|
607
607
|
let e, t = this.idx;
|
|
@@ -617,17 +617,17 @@ var ee = [
|
|
|
617
617
|
break;
|
|
618
618
|
case "(": e = this.group();
|
|
619
619
|
}
|
|
620
|
-
return e === void 0 && this.isPatternCharacter() && (e = this.patternCharacter()),
|
|
620
|
+
return e === void 0 && this.isPatternCharacter() && (e = this.patternCharacter()), W(e) ? (e.loc = this.loc(t), this.isQuantifier() && (e.quantifier = this.quantifier()), e) : he();
|
|
621
621
|
}
|
|
622
622
|
dotAll() {
|
|
623
623
|
return this.consumeChar("."), {
|
|
624
624
|
type: "Set",
|
|
625
625
|
complement: !0,
|
|
626
626
|
value: [
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
627
|
+
H("\n"),
|
|
628
|
+
H("\r"),
|
|
629
|
+
H("\u2028"),
|
|
630
|
+
H("\u2029")
|
|
631
631
|
]
|
|
632
632
|
};
|
|
633
633
|
}
|
|
@@ -670,49 +670,49 @@ var ee = [
|
|
|
670
670
|
let e, t = !1;
|
|
671
671
|
switch (this.popChar()) {
|
|
672
672
|
case "d":
|
|
673
|
-
e =
|
|
673
|
+
e = _e;
|
|
674
674
|
break;
|
|
675
675
|
case "D":
|
|
676
|
-
e =
|
|
676
|
+
e = _e, t = !0;
|
|
677
677
|
break;
|
|
678
678
|
case "s":
|
|
679
|
-
e =
|
|
679
|
+
e = ye;
|
|
680
680
|
break;
|
|
681
681
|
case "S":
|
|
682
|
-
e =
|
|
682
|
+
e = ye, t = !0;
|
|
683
683
|
break;
|
|
684
684
|
case "w":
|
|
685
|
-
e =
|
|
685
|
+
e = ve;
|
|
686
686
|
break;
|
|
687
|
-
case "W": e =
|
|
687
|
+
case "W": e = ve, t = !0;
|
|
688
688
|
}
|
|
689
|
-
return
|
|
689
|
+
return W(e) ? {
|
|
690
690
|
type: "Set",
|
|
691
691
|
value: e,
|
|
692
692
|
complement: t
|
|
693
|
-
} :
|
|
693
|
+
} : he();
|
|
694
694
|
}
|
|
695
695
|
controlEscapeAtom() {
|
|
696
696
|
let e;
|
|
697
697
|
switch (this.popChar()) {
|
|
698
698
|
case "f":
|
|
699
|
-
e =
|
|
699
|
+
e = H("\f");
|
|
700
700
|
break;
|
|
701
701
|
case "n":
|
|
702
|
-
e =
|
|
702
|
+
e = H("\n");
|
|
703
703
|
break;
|
|
704
704
|
case "r":
|
|
705
|
-
e =
|
|
705
|
+
e = H("\r");
|
|
706
706
|
break;
|
|
707
707
|
case "t":
|
|
708
|
-
e =
|
|
708
|
+
e = H(" ");
|
|
709
709
|
break;
|
|
710
|
-
case "v": e =
|
|
710
|
+
case "v": e = H("\v");
|
|
711
711
|
}
|
|
712
|
-
return
|
|
712
|
+
return W(e) ? {
|
|
713
713
|
type: "Character",
|
|
714
714
|
value: e
|
|
715
|
-
} :
|
|
715
|
+
} : he();
|
|
716
716
|
}
|
|
717
717
|
controlLetterEscapeAtom() {
|
|
718
718
|
this.consumeChar("c");
|
|
@@ -726,7 +726,7 @@ var ee = [
|
|
|
726
726
|
nulCharacterAtom() {
|
|
727
727
|
return this.consumeChar("0"), {
|
|
728
728
|
type: "Character",
|
|
729
|
-
value:
|
|
729
|
+
value: H("\0")
|
|
730
730
|
};
|
|
731
731
|
}
|
|
732
732
|
hexEscapeSequenceAtom() {
|
|
@@ -738,7 +738,7 @@ var ee = [
|
|
|
738
738
|
identityEscapeAtom() {
|
|
739
739
|
return {
|
|
740
740
|
type: "Character",
|
|
741
|
-
value:
|
|
741
|
+
value: H(this.popChar())
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
744
|
classPatternCharacterAtom() {
|
|
@@ -751,7 +751,7 @@ var ee = [
|
|
|
751
751
|
case "]": throw Error("TBD");
|
|
752
752
|
default: return {
|
|
753
753
|
type: "Character",
|
|
754
|
-
value:
|
|
754
|
+
value: H(this.popChar())
|
|
755
755
|
};
|
|
756
756
|
}
|
|
757
757
|
}
|
|
@@ -759,17 +759,17 @@ var ee = [
|
|
|
759
759
|
let e = [], t = !1;
|
|
760
760
|
for (this.consumeChar("["), this.peekChar(0) === "^" && (this.consumeChar("^"), t = !0); this.isClassAtom();) {
|
|
761
761
|
let t = this.classAtom();
|
|
762
|
-
if (t.type,
|
|
762
|
+
if (t.type, ge(t) && this.isRangeDash()) {
|
|
763
763
|
this.consumeChar("-");
|
|
764
764
|
let n = this.classAtom();
|
|
765
|
-
if (n.type,
|
|
765
|
+
if (n.type, ge(n)) {
|
|
766
766
|
if (n.value < t.value) throw Error("Range out of order in character class");
|
|
767
767
|
e.push({
|
|
768
768
|
from: t.value,
|
|
769
769
|
to: n.value
|
|
770
770
|
});
|
|
771
|
-
} else
|
|
772
|
-
} else
|
|
771
|
+
} else me(t.value, e), e.push(H("-")), me(n.value, e);
|
|
772
|
+
} else me(t.value, e);
|
|
773
773
|
}
|
|
774
774
|
return this.consumeChar("]"), {
|
|
775
775
|
type: "Set",
|
|
@@ -792,7 +792,7 @@ var ee = [
|
|
|
792
792
|
switch (this.consumeChar("\\"), this.peekChar()) {
|
|
793
793
|
case "b": return this.consumeChar("b"), {
|
|
794
794
|
type: "Character",
|
|
795
|
-
value:
|
|
795
|
+
value: H("\b")
|
|
796
796
|
};
|
|
797
797
|
case "d":
|
|
798
798
|
case "D":
|
|
@@ -826,14 +826,14 @@ var ee = [
|
|
|
826
826
|
}
|
|
827
827
|
positiveInteger() {
|
|
828
828
|
let e = this.popChar();
|
|
829
|
-
if (!1 ===
|
|
830
|
-
for (;
|
|
829
|
+
if (!1 === Se.test(e)) throw Error("Expecting a positive integer");
|
|
830
|
+
for (; xe.test(this.peekChar(0));) e += this.popChar();
|
|
831
831
|
return parseInt(e, 10);
|
|
832
832
|
}
|
|
833
833
|
integerIncludingZero() {
|
|
834
834
|
let e = this.popChar();
|
|
835
|
-
if (!1 ===
|
|
836
|
-
for (;
|
|
835
|
+
if (!1 === xe.test(e)) throw Error("Expecting an integer");
|
|
836
|
+
for (; xe.test(this.peekChar(0));) e += this.popChar();
|
|
837
837
|
return parseInt(e, 10);
|
|
838
838
|
}
|
|
839
839
|
patternCharacter() {
|
|
@@ -856,7 +856,7 @@ var ee = [
|
|
|
856
856
|
case "|": throw Error("TBD");
|
|
857
857
|
default: return {
|
|
858
858
|
type: "Character",
|
|
859
|
-
value:
|
|
859
|
+
value: H(e)
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
862
|
}
|
|
@@ -874,7 +874,7 @@ var ee = [
|
|
|
874
874
|
return this.peekChar() === "-" && this.isClassAtom(1);
|
|
875
875
|
}
|
|
876
876
|
isDigit() {
|
|
877
|
-
return
|
|
877
|
+
return xe.test(this.peekChar(0));
|
|
878
878
|
}
|
|
879
879
|
isClassAtom(e = 0) {
|
|
880
880
|
switch (this.peekChar(e)) {
|
|
@@ -947,7 +947,7 @@ var ee = [
|
|
|
947
947
|
let t = "";
|
|
948
948
|
for (let n = 0; n < e; n++) {
|
|
949
949
|
let e = this.popChar();
|
|
950
|
-
if (!1 ===
|
|
950
|
+
if (!1 === be.test(e)) throw Error("Expecting a HexDecimal digits");
|
|
951
951
|
t += e;
|
|
952
952
|
}
|
|
953
953
|
return {
|
|
@@ -974,32 +974,32 @@ var ee = [
|
|
|
974
974
|
};
|
|
975
975
|
}
|
|
976
976
|
}();
|
|
977
|
-
function
|
|
977
|
+
function Ee(e) {
|
|
978
978
|
let t = e.toString();
|
|
979
|
-
if (
|
|
979
|
+
if (we.hasOwnProperty(t)) return we[t];
|
|
980
980
|
{
|
|
981
|
-
let e =
|
|
982
|
-
return
|
|
981
|
+
let e = Te.pattern(t);
|
|
982
|
+
return we[t] = e, e;
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
var
|
|
986
|
-
function
|
|
985
|
+
var De = "Complement Sets are not supported for first char optimization", Oe = "Unable to use \"first char\" lexer optimizations:\n";
|
|
986
|
+
function ke(e, t = !1) {
|
|
987
987
|
try {
|
|
988
|
-
let t =
|
|
989
|
-
return
|
|
990
|
-
} catch (
|
|
991
|
-
if (
|
|
988
|
+
let t = Ee(e);
|
|
989
|
+
return Ae(t.value, {}, t.flags.ignoreCase);
|
|
990
|
+
} catch (n) {
|
|
991
|
+
if (n.message === De) t && D(`${Oe}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);
|
|
992
992
|
else {
|
|
993
|
-
let
|
|
994
|
-
t && (
|
|
993
|
+
let n = "";
|
|
994
|
+
t && (n = "\n This will disable the lexer's first char optimizations.\n See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."), E(`${Oe}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues` + n);
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
997
|
return [];
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function Ae(e, t, n) {
|
|
1000
1000
|
switch (e.type) {
|
|
1001
1001
|
case "Disjunction":
|
|
1002
|
-
for (let r = 0; r < e.value.length; r++)
|
|
1002
|
+
for (let r = 0; r < e.value.length; r++) Ae(e.value[r], t, n);
|
|
1003
1003
|
break;
|
|
1004
1004
|
case "Alternative":
|
|
1005
1005
|
let r = e.value;
|
|
@@ -1019,19 +1019,19 @@ function ce(e, t, n) {
|
|
|
1019
1019
|
let a = i;
|
|
1020
1020
|
switch (a.type) {
|
|
1021
1021
|
case "Character":
|
|
1022
|
-
|
|
1022
|
+
je(a.value, t, n);
|
|
1023
1023
|
break;
|
|
1024
1024
|
case "Set":
|
|
1025
|
-
if (!0 === a.complement) throw Error(
|
|
1025
|
+
if (!0 === a.complement) throw Error(De);
|
|
1026
1026
|
a.value.forEach((e) => {
|
|
1027
|
-
if (typeof e == "number")
|
|
1027
|
+
if (typeof e == "number") je(e, t, n);
|
|
1028
1028
|
else {
|
|
1029
1029
|
let r = e;
|
|
1030
|
-
if (!0 === n) for (let e = r.from; e <= r.to; e++)
|
|
1030
|
+
if (!0 === n) for (let e = r.from; e <= r.to; e++) je(e, t, n);
|
|
1031
1031
|
else {
|
|
1032
|
-
for (let e = r.from; e <= r.to && e < 256; e++)
|
|
1032
|
+
for (let e = r.from; e <= r.to && e < 256; e++) je(e, t, n);
|
|
1033
1033
|
if (r.to >= 256) {
|
|
1034
|
-
let e = r.from >= 256 ? r.from : 256, n = r.to, i =
|
|
1034
|
+
let e = r.from >= 256 ? r.from : 256, n = r.to, i = K(e), a = K(n);
|
|
1035
1035
|
for (let e = i; e <= a; e++) t[e] = e;
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
@@ -1039,35 +1039,35 @@ function ce(e, t, n) {
|
|
|
1039
1039
|
});
|
|
1040
1040
|
break;
|
|
1041
1041
|
case "Group":
|
|
1042
|
-
|
|
1042
|
+
Ae(a.value, t, n);
|
|
1043
1043
|
break;
|
|
1044
1044
|
default: throw Error("Non Exhaustive Match");
|
|
1045
1045
|
}
|
|
1046
1046
|
let o = a.quantifier !== void 0 && a.quantifier.atLeast === 0;
|
|
1047
|
-
if (a.type === "Group" && !1 ===
|
|
1047
|
+
if (a.type === "Group" && !1 === Ne(a) || a.type !== "Group" && !1 === o) break;
|
|
1048
1048
|
}
|
|
1049
1049
|
break;
|
|
1050
1050
|
default: throw Error("non exhaustive match!");
|
|
1051
1051
|
}
|
|
1052
1052
|
return Object.values(t);
|
|
1053
1053
|
}
|
|
1054
|
-
function
|
|
1055
|
-
let r =
|
|
1054
|
+
function je(e, t, n) {
|
|
1055
|
+
let r = K(e);
|
|
1056
1056
|
t[r] = r, !0 === n && function(e, t) {
|
|
1057
1057
|
let n = String.fromCharCode(e), r = n.toUpperCase();
|
|
1058
1058
|
if (r !== n) {
|
|
1059
|
-
let e =
|
|
1059
|
+
let e = K(r.charCodeAt(0));
|
|
1060
1060
|
t[e] = e;
|
|
1061
1061
|
} else {
|
|
1062
1062
|
let e = n.toLowerCase();
|
|
1063
1063
|
if (e !== n) {
|
|
1064
|
-
let n =
|
|
1064
|
+
let n = K(e.charCodeAt(0));
|
|
1065
1065
|
t[n] = n;
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
}(e, t);
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function Me(e, t) {
|
|
1071
1071
|
return e.value.find((e) => {
|
|
1072
1072
|
if (typeof e == "number") return t.includes(e);
|
|
1073
1073
|
{
|
|
@@ -1076,11 +1076,11 @@ function ue(e, t) {
|
|
|
1076
1076
|
}
|
|
1077
1077
|
});
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1079
|
+
function Ne(e) {
|
|
1080
1080
|
let t = e.quantifier;
|
|
1081
|
-
return !(!t || t.atLeast !== 0) || !!e.value && (Array.isArray(e.value) ? e.value.every(
|
|
1081
|
+
return !(!t || t.atLeast !== 0) || !!e.value && (Array.isArray(e.value) ? e.value.every(Ne) : Ne(e.value));
|
|
1082
1082
|
}
|
|
1083
|
-
var
|
|
1083
|
+
var Pe = class extends Ce {
|
|
1084
1084
|
constructor(e) {
|
|
1085
1085
|
super(), this.targetCharCodes = e, this.found = !1;
|
|
1086
1086
|
}
|
|
@@ -1107,12 +1107,12 @@ var fe = class extends I {
|
|
|
1107
1107
|
this.targetCharCodes.includes(e.value) && (this.found = !0);
|
|
1108
1108
|
}
|
|
1109
1109
|
visitSet(e) {
|
|
1110
|
-
e.complement ?
|
|
1110
|
+
e.complement ? Me(e, this.targetCharCodes) === void 0 && (this.found = !0) : Me(e, this.targetCharCodes) !== void 0 && (this.found = !0);
|
|
1111
1111
|
}
|
|
1112
1112
|
};
|
|
1113
|
-
function
|
|
1113
|
+
function Fe(e, t) {
|
|
1114
1114
|
if (t instanceof RegExp) {
|
|
1115
|
-
let n =
|
|
1115
|
+
let n = Ee(t), r = new Pe(e);
|
|
1116
1116
|
return r.visit(n), r.found;
|
|
1117
1117
|
}
|
|
1118
1118
|
for (let n of t) {
|
|
@@ -1121,28 +1121,28 @@ function pe(e, t) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
return !1;
|
|
1123
1123
|
}
|
|
1124
|
-
var
|
|
1125
|
-
function
|
|
1126
|
-
let
|
|
1124
|
+
var G = "PATTERN", Ie = "defaultMode";
|
|
1125
|
+
function Le(e, t) {
|
|
1126
|
+
let n = (t = Object.assign({
|
|
1127
1127
|
safeMode: !1,
|
|
1128
1128
|
positionTracking: "full",
|
|
1129
1129
|
lineTerminatorCharacters: ["\r", "\n"],
|
|
1130
1130
|
tracer: (e, t) => t()
|
|
1131
|
-
}, t)).tracer,
|
|
1132
|
-
|
|
1131
|
+
}, t)).tracer, r;
|
|
1132
|
+
n("initCharCodeToOptimizedIndexMap", () => {
|
|
1133
1133
|
(function() {
|
|
1134
|
-
if (
|
|
1135
|
-
|
|
1136
|
-
for (let e = 0; e < 65536; e++)
|
|
1134
|
+
if (Ye.length === 0) {
|
|
1135
|
+
Ye = Array(65536);
|
|
1136
|
+
for (let e = 0; e < 65536; e++) Ye[e] = e > 255 ? 255 + ~~(e / 255) : e;
|
|
1137
1137
|
}
|
|
1138
1138
|
})();
|
|
1139
|
-
}),
|
|
1140
|
-
|
|
1139
|
+
}), n("Reject Lexer.NA", () => {
|
|
1140
|
+
r = e.filter((e) => e[G] !== J.NA);
|
|
1141
1141
|
});
|
|
1142
|
-
let a, o, s, c, l, u, d, f, p, m, h
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
let t = e[
|
|
1142
|
+
let i, a, o, s, c, l, u, d, f, p, m, h = !1;
|
|
1143
|
+
n("Transform Patterns", () => {
|
|
1144
|
+
h = !1, i = r.map((e) => {
|
|
1145
|
+
let t = e[G];
|
|
1146
1146
|
if (t instanceof RegExp) {
|
|
1147
1147
|
let e = t.source;
|
|
1148
1148
|
return e.length !== 1 || e === "^" || e === "$" || e === "." || t.ignoreCase ? e.length !== 2 || e[0] !== "\\" || [
|
|
@@ -1162,86 +1162,113 @@ function he(e, t) {
|
|
|
1162
1162
|
"v",
|
|
1163
1163
|
"w",
|
|
1164
1164
|
"W"
|
|
1165
|
-
].includes(e[1]) ?
|
|
1165
|
+
].includes(e[1]) ? Ve(t) : e[1] : e;
|
|
1166
1166
|
}
|
|
1167
|
-
if (typeof t == "function") return
|
|
1168
|
-
if (typeof t == "object") return
|
|
1167
|
+
if (typeof t == "function") return h = !0, { exec: t };
|
|
1168
|
+
if (typeof t == "object") return h = !0, t;
|
|
1169
1169
|
if (typeof t == "string") {
|
|
1170
1170
|
if (t.length === 1) return t;
|
|
1171
1171
|
{
|
|
1172
1172
|
let e = t.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
|
|
1173
|
-
return
|
|
1173
|
+
return Ve(new RegExp(e));
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
throw Error("non exhaustive match");
|
|
1177
1177
|
});
|
|
1178
|
-
}),
|
|
1179
|
-
|
|
1178
|
+
}), n("misc mapping", () => {
|
|
1179
|
+
a = r.map((e) => e.tokenTypeIdx), o = r.map((e) => {
|
|
1180
1180
|
let t = e.GROUP;
|
|
1181
|
-
if (t !==
|
|
1181
|
+
if (t !== J.SKIPPED) {
|
|
1182
1182
|
if (typeof t == "string") return t;
|
|
1183
1183
|
if (t === void 0) return !1;
|
|
1184
1184
|
throw Error("non exhaustive match");
|
|
1185
1185
|
}
|
|
1186
|
-
}),
|
|
1186
|
+
}), s = r.map((e) => {
|
|
1187
1187
|
let t = e.LONGER_ALT;
|
|
1188
|
-
if (t) return Array.isArray(t) ? t.map((e) =>
|
|
1189
|
-
}),
|
|
1190
|
-
}),
|
|
1191
|
-
let e =
|
|
1192
|
-
|
|
1193
|
-
}),
|
|
1194
|
-
|
|
1188
|
+
if (t) return Array.isArray(t) ? t.map((e) => r.indexOf(e)) : [r.indexOf(t)];
|
|
1189
|
+
}), c = r.map((e) => e.PUSH_MODE), l = r.map((e) => Object.hasOwn(e, "POP_MODE"));
|
|
1190
|
+
}), n("Line Terminator Handling", () => {
|
|
1191
|
+
let e = qe(t.lineTerminatorCharacters);
|
|
1192
|
+
u = r.map((e) => !1), t.positionTracking !== "onlyOffset" && (u = r.map((t) => Object.hasOwn(t, "LINE_BREAKS") ? !!t.LINE_BREAKS : !1 === Ge(t, e) && Fe(e, t.PATTERN)));
|
|
1193
|
+
}), n("Misc Mapping #2", () => {
|
|
1194
|
+
d = r.map(He), f = i.map(Ue), p = r.reduce((e, t) => {
|
|
1195
1195
|
let n = t.GROUP;
|
|
1196
|
-
return typeof n == "string" && n !==
|
|
1197
|
-
}, {}),
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1196
|
+
return typeof n == "string" && n !== J.SKIPPED && (e[n] = []), e;
|
|
1197
|
+
}, {}), m = i.map((e, t) => {
|
|
1198
|
+
let n = o[t] === void 0 && s[t] === void 0 ? function(e) {
|
|
1199
|
+
if (!(e instanceof RegExp) || e.flags !== "") return;
|
|
1200
|
+
let t;
|
|
1201
|
+
try {
|
|
1202
|
+
t = Ee(e);
|
|
1203
|
+
} catch {
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
if (t.value.value.length !== 1 || t.value.value[0].value.length !== 1) return;
|
|
1207
|
+
let n, r = t.value.value[0].value[0];
|
|
1208
|
+
for (; r.type === "Group";) {
|
|
1209
|
+
if (r.capturing || r.quantifier !== void 0 && n !== void 0 || r.value.value.length !== 1 || r.value.value[0].value.length !== 1) return;
|
|
1210
|
+
n = r.quantifier ?? n, r = r.value.value[0].value[0];
|
|
1211
|
+
}
|
|
1212
|
+
if (r.type !== "Set" || r.complement || r.quantifier !== void 0 && n !== void 0 || (n = r.quantifier ?? n, n?.atLeast !== 1 || n.atMost !== 1 / 0 || !n.greedy)) return;
|
|
1213
|
+
let i = /* @__PURE__ */ new Uint8Array(128);
|
|
1214
|
+
for (let e of r.value) {
|
|
1215
|
+
let t = typeof e == "number" ? e : e.from, n = typeof e == "number" ? e : e.to;
|
|
1216
|
+
if (t < 0 || n >= i.length) return;
|
|
1217
|
+
i.fill(1, t, n + 1);
|
|
1218
|
+
}
|
|
1219
|
+
return i;
|
|
1220
|
+
}(r[t].PATTERN) : void 0;
|
|
1221
|
+
return {
|
|
1222
|
+
pattern: i[t],
|
|
1223
|
+
asciiClass: n,
|
|
1224
|
+
longerAlt: s[t],
|
|
1225
|
+
canLineTerminator: u[t],
|
|
1226
|
+
matchType: n === void 0 ? !1 === f[t] ? d[t] ? 1 : 2 : 0 : 3,
|
|
1227
|
+
short: f[t],
|
|
1228
|
+
group: o[t],
|
|
1229
|
+
push: c[t],
|
|
1230
|
+
pop: l[t],
|
|
1231
|
+
tokenTypeIdx: a[t],
|
|
1232
|
+
tokenType: r[t]
|
|
1233
|
+
};
|
|
1234
|
+
});
|
|
1209
1235
|
});
|
|
1210
|
-
let
|
|
1211
|
-
return t.safeMode ||
|
|
1212
|
-
|
|
1213
|
-
if (typeof
|
|
1214
|
-
else if (Array.isArray(
|
|
1236
|
+
let g = !0, _ = [];
|
|
1237
|
+
return t.safeMode || n("First Char Optimization", () => {
|
|
1238
|
+
_ = r.reduce((e, n, r) => {
|
|
1239
|
+
if (typeof n.PATTERN == "string") Je(e, K(n.PATTERN.charCodeAt(0)), m[r]);
|
|
1240
|
+
else if (Array.isArray(n.START_CHARS_HINT)) {
|
|
1215
1241
|
let t;
|
|
1216
|
-
|
|
1217
|
-
let
|
|
1218
|
-
t !==
|
|
1219
|
-
});
|
|
1220
|
-
} else if (r.PATTERN instanceof RegExp) if (r.PATTERN.unicode) _ = !1, t.ensureOptimizations && n(`${oe}\tUnable to analyze < ${r.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);
|
|
1221
|
-
else {
|
|
1222
|
-
let n = se(r.PATTERN, t.ensureOptimizations);
|
|
1223
|
-
n.length === 0 && (_ = !1), n.forEach((t) => {
|
|
1224
|
-
Ee(e, t, h[i]);
|
|
1242
|
+
n.START_CHARS_HINT.forEach((n) => {
|
|
1243
|
+
let i = K(typeof n == "string" ? n.charCodeAt(0) : n);
|
|
1244
|
+
t !== i && (t = i, Je(e, i, m[r]));
|
|
1225
1245
|
});
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1246
|
+
} else if (n.PATTERN instanceof RegExp) {
|
|
1247
|
+
if (n.PATTERN.unicode) g = !1, t.ensureOptimizations && E(`${Oe}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);
|
|
1248
|
+
else {
|
|
1249
|
+
let i = ke(n.PATTERN, t.ensureOptimizations);
|
|
1250
|
+
i.length === 0 && (g = !1), i.forEach((t) => {
|
|
1251
|
+
Je(e, t, m[r]);
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
} else t.ensureOptimizations && E(`${Oe}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`), g = !1;
|
|
1228
1255
|
return e;
|
|
1229
1256
|
}, []);
|
|
1230
1257
|
}), {
|
|
1231
|
-
emptyGroups:
|
|
1232
|
-
patternIdxToConfig:
|
|
1233
|
-
charCodeToPatternIdxToConfig:
|
|
1234
|
-
hasCustom:
|
|
1235
|
-
canBeOptimized:
|
|
1258
|
+
emptyGroups: p,
|
|
1259
|
+
patternIdxToConfig: m,
|
|
1260
|
+
charCodeToPatternIdxToConfig: _,
|
|
1261
|
+
hasCustom: h,
|
|
1262
|
+
canBeOptimized: g
|
|
1236
1263
|
};
|
|
1237
1264
|
}
|
|
1238
|
-
function
|
|
1265
|
+
function Re(e, t) {
|
|
1239
1266
|
let n = [], r = function(e) {
|
|
1240
|
-
let t = e.filter((e) => !Object.hasOwn(e,
|
|
1267
|
+
let t = e.filter((e) => !Object.hasOwn(e, G));
|
|
1241
1268
|
return {
|
|
1242
1269
|
errors: t.map((e) => ({
|
|
1243
1270
|
message: "Token Type: ->" + e.name + "<- missing static 'PATTERN' property",
|
|
1244
|
-
type:
|
|
1271
|
+
type: q.MISSING_PATTERN,
|
|
1245
1272
|
tokenTypes: [e]
|
|
1246
1273
|
})),
|
|
1247
1274
|
valid: e.filter((e) => !t.includes(e))
|
|
@@ -1250,22 +1277,22 @@ function ge(e, t) {
|
|
|
1250
1277
|
n = n.concat(r.errors);
|
|
1251
1278
|
let i = function(e) {
|
|
1252
1279
|
let t = e.filter((e) => {
|
|
1253
|
-
let t = e[
|
|
1280
|
+
let t = e[G];
|
|
1254
1281
|
return !(t instanceof RegExp || typeof t == "function" || Object.hasOwn(t, "exec") || typeof t == "string");
|
|
1255
1282
|
});
|
|
1256
1283
|
return {
|
|
1257
1284
|
errors: t.map((e) => ({
|
|
1258
1285
|
message: "Token Type: ->" + e.name + "<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",
|
|
1259
|
-
type:
|
|
1286
|
+
type: q.INVALID_PATTERN,
|
|
1260
1287
|
tokenTypes: [e]
|
|
1261
1288
|
})),
|
|
1262
1289
|
valid: e.filter((e) => !t.includes(e))
|
|
1263
1290
|
};
|
|
1264
1291
|
}(r.valid), a = i.valid;
|
|
1265
1292
|
return n = n.concat(i.errors), n = n.concat(function(e) {
|
|
1266
|
-
let t = [], n = e.filter((e) => e[
|
|
1293
|
+
let t = [], n = e.filter((e) => e[G] instanceof RegExp);
|
|
1267
1294
|
return t = t.concat(function(e) {
|
|
1268
|
-
class t extends
|
|
1295
|
+
class t extends Ce {
|
|
1269
1296
|
constructor() {
|
|
1270
1297
|
super(...arguments), this.found = !1;
|
|
1271
1298
|
}
|
|
@@ -1276,18 +1303,18 @@ function ge(e, t) {
|
|
|
1276
1303
|
return e.filter((e) => {
|
|
1277
1304
|
let n = e.PATTERN;
|
|
1278
1305
|
try {
|
|
1279
|
-
let e =
|
|
1306
|
+
let e = Ee(n), r = new t();
|
|
1280
1307
|
return r.visit(e), r.found;
|
|
1281
1308
|
} catch {
|
|
1282
|
-
return
|
|
1309
|
+
return ze.test(n.source);
|
|
1283
1310
|
}
|
|
1284
1311
|
}).map((e) => ({
|
|
1285
1312
|
message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + e.name + "<- static 'PATTERN' cannot contain end of input anchor '$'\n See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",
|
|
1286
|
-
type:
|
|
1313
|
+
type: q.EOI_ANCHOR_FOUND,
|
|
1287
1314
|
tokenTypes: [e]
|
|
1288
1315
|
}));
|
|
1289
1316
|
}(n)), t = t.concat(function(e) {
|
|
1290
|
-
class t extends
|
|
1317
|
+
class t extends Ce {
|
|
1291
1318
|
constructor() {
|
|
1292
1319
|
super(...arguments), this.found = !1;
|
|
1293
1320
|
}
|
|
@@ -1298,39 +1325,39 @@ function ge(e, t) {
|
|
|
1298
1325
|
return e.filter((e) => {
|
|
1299
1326
|
let n = e.PATTERN;
|
|
1300
1327
|
try {
|
|
1301
|
-
let e =
|
|
1328
|
+
let e = Ee(n), r = new t();
|
|
1302
1329
|
return r.visit(e), r.found;
|
|
1303
1330
|
} catch {
|
|
1304
|
-
return
|
|
1331
|
+
return Be.test(n.source);
|
|
1305
1332
|
}
|
|
1306
1333
|
}).map((e) => ({
|
|
1307
1334
|
message: "Unexpected RegExp Anchor Error:\n Token Type: ->" + e.name + "<- static 'PATTERN' cannot contain start of input anchor '^'\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.",
|
|
1308
|
-
type:
|
|
1335
|
+
type: q.SOI_ANCHOR_FOUND,
|
|
1309
1336
|
tokenTypes: [e]
|
|
1310
1337
|
}));
|
|
1311
1338
|
}(n)), t = t.concat(function(e) {
|
|
1312
1339
|
return e.filter((e) => {
|
|
1313
|
-
let t = e[
|
|
1340
|
+
let t = e[G];
|
|
1314
1341
|
return t instanceof RegExp && (t.multiline || t.global);
|
|
1315
1342
|
}).map((e) => ({
|
|
1316
1343
|
message: "Token Type: ->" + e.name + "<- static 'PATTERN' may NOT contain global('g') or multiline('m')",
|
|
1317
|
-
type:
|
|
1344
|
+
type: q.UNSUPPORTED_FLAGS_FOUND,
|
|
1318
1345
|
tokenTypes: [e]
|
|
1319
1346
|
}));
|
|
1320
1347
|
}(n)), t = t.concat(function(e) {
|
|
1321
|
-
let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source !== r.PATTERN.source || t.includes(r) || r.PATTERN ===
|
|
1348
|
+
let t = [], n = e.map((n) => e.reduce((e, r) => (n.PATTERN.source !== r.PATTERN.source || t.includes(r) || r.PATTERN === J.NA || (t.push(r), e.push(r)), e), []));
|
|
1322
1349
|
return n = n.filter(Boolean), n.filter((e) => e.length > 1).map((e) => {
|
|
1323
1350
|
let t = e.map((e) => e.name);
|
|
1324
1351
|
return {
|
|
1325
1352
|
message: `The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(", ")} <-`,
|
|
1326
|
-
type:
|
|
1353
|
+
type: q.DUPLICATE_PATTERNS_FOUND,
|
|
1327
1354
|
tokenTypes: e
|
|
1328
1355
|
};
|
|
1329
1356
|
});
|
|
1330
1357
|
}(n)), t = t.concat(function(e) {
|
|
1331
1358
|
return e.filter((e) => e.PATTERN.test("")).map((e) => ({
|
|
1332
1359
|
message: "Token Type: ->" + e.name + "<- static 'PATTERN' must not match an empty string",
|
|
1333
|
-
type:
|
|
1360
|
+
type: q.EMPTY_MATCH_PATTERN,
|
|
1334
1361
|
tokenTypes: [e]
|
|
1335
1362
|
}));
|
|
1336
1363
|
}(n)), t;
|
|
@@ -1338,22 +1365,22 @@ function ge(e, t) {
|
|
|
1338
1365
|
return e.filter((e) => {
|
|
1339
1366
|
if (!Object.hasOwn(e, "GROUP")) return !1;
|
|
1340
1367
|
let t = e.GROUP;
|
|
1341
|
-
return t !==
|
|
1368
|
+
return t !== J.SKIPPED && t !== J.NA && typeof t != "string";
|
|
1342
1369
|
}).map((e) => ({
|
|
1343
1370
|
message: "Token Type: ->" + e.name + "<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",
|
|
1344
|
-
type:
|
|
1371
|
+
type: q.INVALID_GROUP_TYPE_FOUND,
|
|
1345
1372
|
tokenTypes: [e]
|
|
1346
1373
|
}));
|
|
1347
1374
|
}(a)), n = n.concat(function(e, t) {
|
|
1348
1375
|
return e.filter((e) => e.PUSH_MODE !== void 0 && !t.includes(e.PUSH_MODE)).map((e) => ({
|
|
1349
1376
|
message: `Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,
|
|
1350
|
-
type:
|
|
1377
|
+
type: q.PUSH_MODE_DOES_NOT_EXIST,
|
|
1351
1378
|
tokenTypes: [e]
|
|
1352
1379
|
}));
|
|
1353
1380
|
}(a, t)), n = n.concat(function(e) {
|
|
1354
1381
|
let t = [], n = e.reduce((e, t, n) => {
|
|
1355
1382
|
let r = t.PATTERN;
|
|
1356
|
-
return r ===
|
|
1383
|
+
return r === J.NA || (typeof r == "string" ? e.push({
|
|
1357
1384
|
str: r,
|
|
1358
1385
|
idx: n,
|
|
1359
1386
|
tokenType: t
|
|
@@ -1394,7 +1421,7 @@ function ge(e, t) {
|
|
|
1394
1421
|
let n = `Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;
|
|
1395
1422
|
t.push({
|
|
1396
1423
|
message: n,
|
|
1397
|
-
type:
|
|
1424
|
+
type: q.UNREACHABLE_PATTERN,
|
|
1398
1425
|
tokenTypes: [e, a]
|
|
1399
1426
|
});
|
|
1400
1427
|
}
|
|
@@ -1402,74 +1429,74 @@ function ge(e, t) {
|
|
|
1402
1429
|
}), t;
|
|
1403
1430
|
}(a)), n;
|
|
1404
1431
|
}
|
|
1405
|
-
var
|
|
1406
|
-
function
|
|
1432
|
+
var ze = /[^\\][$]/, Be = /[^\\[][\^]|^\^/;
|
|
1433
|
+
function Ve(e) {
|
|
1407
1434
|
let t = e.ignoreCase ? "iy" : "y";
|
|
1408
1435
|
return RegExp(`${e.source}`, t);
|
|
1409
1436
|
}
|
|
1410
|
-
function
|
|
1437
|
+
function He(e) {
|
|
1411
1438
|
let t = e.PATTERN;
|
|
1412
1439
|
if (t instanceof RegExp) return !1;
|
|
1413
1440
|
if (typeof t == "function" || Object.hasOwn(t, "exec")) return !0;
|
|
1414
1441
|
if (typeof t == "string") return !1;
|
|
1415
1442
|
throw Error("non exhaustive match");
|
|
1416
1443
|
}
|
|
1417
|
-
function
|
|
1444
|
+
function Ue(e) {
|
|
1418
1445
|
return typeof e == "string" && e.length === 1 && e.charCodeAt(0);
|
|
1419
1446
|
}
|
|
1420
|
-
var
|
|
1447
|
+
var We = {
|
|
1421
1448
|
test: function(e) {
|
|
1422
1449
|
let t = e.length;
|
|
1423
1450
|
for (let n = this.lastIndex; n < t; n++) {
|
|
1424
1451
|
let t = e.charCodeAt(n);
|
|
1425
1452
|
if (t === 10) return this.lastIndex = n + 1, !0;
|
|
1426
|
-
if (t === 13) return e.charCodeAt(n + 1) === 10 ?
|
|
1453
|
+
if (t === 13) return this.lastIndex = e.charCodeAt(n + 1) === 10 ? n + 2 : n + 1, !0;
|
|
1427
1454
|
}
|
|
1428
1455
|
return !1;
|
|
1429
1456
|
},
|
|
1430
1457
|
lastIndex: 0
|
|
1431
1458
|
};
|
|
1432
|
-
function
|
|
1459
|
+
function Ge(e, t) {
|
|
1433
1460
|
if (Object.hasOwn(e, "LINE_BREAKS")) return !1;
|
|
1434
1461
|
if (e.PATTERN instanceof RegExp) {
|
|
1435
1462
|
try {
|
|
1436
|
-
|
|
1463
|
+
Fe(t, e.PATTERN);
|
|
1437
1464
|
} catch (e) {
|
|
1438
1465
|
return {
|
|
1439
|
-
issue:
|
|
1466
|
+
issue: q.IDENTIFY_TERMINATOR,
|
|
1440
1467
|
errMsg: e.message
|
|
1441
1468
|
};
|
|
1442
1469
|
}
|
|
1443
1470
|
return !1;
|
|
1444
1471
|
}
|
|
1445
1472
|
if (typeof e.PATTERN == "string") return !1;
|
|
1446
|
-
if (
|
|
1473
|
+
if (He(e)) return { issue: q.CUSTOM_LINE_BREAK };
|
|
1447
1474
|
throw Error("non exhaustive match");
|
|
1448
1475
|
}
|
|
1449
|
-
function
|
|
1450
|
-
if (t.issue ===
|
|
1451
|
-
if (t.issue ===
|
|
1476
|
+
function Ke(e, t) {
|
|
1477
|
+
if (t.issue === q.IDENTIFY_TERMINATOR) return `Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;
|
|
1478
|
+
if (t.issue === q.CUSTOM_LINE_BREAK) return `Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;
|
|
1452
1479
|
throw Error("non exhaustive match");
|
|
1453
1480
|
}
|
|
1454
|
-
function
|
|
1481
|
+
function qe(e) {
|
|
1455
1482
|
return e.map((e) => typeof e == "string" ? e.charCodeAt(0) : e);
|
|
1456
1483
|
}
|
|
1457
|
-
function
|
|
1484
|
+
function Je(e, t, n) {
|
|
1458
1485
|
e[t] === void 0 ? e[t] = [n] : e[t].push(n);
|
|
1459
1486
|
}
|
|
1460
|
-
var
|
|
1461
|
-
function
|
|
1462
|
-
return e < 256 ? e :
|
|
1487
|
+
var Ye = [];
|
|
1488
|
+
function K(e) {
|
|
1489
|
+
return e < 256 ? e : Ye[e];
|
|
1463
1490
|
}
|
|
1464
|
-
function
|
|
1491
|
+
function Xe(e, t) {
|
|
1465
1492
|
let n = e.tokenTypeIdx;
|
|
1466
1493
|
return n === t.tokenTypeIdx || !0 === t.isParent && !0 === t.categoryMatchesMap[n];
|
|
1467
1494
|
}
|
|
1468
|
-
function
|
|
1495
|
+
function Ze(e, t) {
|
|
1469
1496
|
return e.tokenTypeIdx === t.tokenTypeIdx;
|
|
1470
1497
|
}
|
|
1471
|
-
var
|
|
1472
|
-
function
|
|
1498
|
+
var Qe = 1, $e = {};
|
|
1499
|
+
function et(e) {
|
|
1473
1500
|
let t = function(e) {
|
|
1474
1501
|
let t = [...e], n = e, r = !0;
|
|
1475
1502
|
for (; r;) {
|
|
@@ -1482,107 +1509,107 @@ function V(e) {
|
|
|
1482
1509
|
(function(e) {
|
|
1483
1510
|
e.forEach((e) => {
|
|
1484
1511
|
var t;
|
|
1485
|
-
|
|
1512
|
+
nt(e) || ($e[Qe] = e, e.tokenTypeIdx = Qe++), rt(e) && !Array.isArray(e.CATEGORIES) && (e.CATEGORIES = [e.CATEGORIES]), rt(e) || (e.CATEGORIES = []), t = e, Object.hasOwn(t ?? {}, "categoryMatches") || (e.categoryMatches = []), function(e) {
|
|
1486
1513
|
return Object.hasOwn(e ?? {}, "categoryMatchesMap");
|
|
1487
1514
|
}(e) || (e.categoryMatchesMap = {});
|
|
1488
1515
|
});
|
|
1489
1516
|
})(t), function(e) {
|
|
1490
1517
|
e.forEach((e) => {
|
|
1491
|
-
|
|
1518
|
+
tt([], e);
|
|
1492
1519
|
});
|
|
1493
1520
|
}(t), function(e) {
|
|
1494
1521
|
e.forEach((e) => {
|
|
1495
1522
|
e.categoryMatches = [], Object.keys(e.categoryMatchesMap).forEach((t) => {
|
|
1496
|
-
e.categoryMatches.push(
|
|
1523
|
+
e.categoryMatches.push($e[t].tokenTypeIdx);
|
|
1497
1524
|
});
|
|
1498
1525
|
});
|
|
1499
1526
|
}(t), t.forEach((e) => {
|
|
1500
1527
|
e.isParent = e.categoryMatches.length > 0;
|
|
1501
1528
|
});
|
|
1502
1529
|
}
|
|
1503
|
-
function
|
|
1530
|
+
function tt(e, t) {
|
|
1504
1531
|
e.forEach((e) => {
|
|
1505
1532
|
t.categoryMatchesMap[e.tokenTypeIdx] = !0;
|
|
1506
1533
|
}), t.CATEGORIES.forEach((n) => {
|
|
1507
1534
|
let r = e.concat(t);
|
|
1508
|
-
r.includes(n) ||
|
|
1535
|
+
r.includes(n) || tt(r, n);
|
|
1509
1536
|
});
|
|
1510
1537
|
}
|
|
1511
|
-
function
|
|
1538
|
+
function nt(e) {
|
|
1512
1539
|
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
1513
1540
|
}
|
|
1514
|
-
function
|
|
1541
|
+
function rt(e) {
|
|
1515
1542
|
return Object.hasOwn(e ?? {}, "CATEGORIES");
|
|
1516
1543
|
}
|
|
1517
|
-
function
|
|
1544
|
+
function it(e) {
|
|
1518
1545
|
return Object.hasOwn(e ?? {}, "tokenTypeIdx");
|
|
1519
1546
|
}
|
|
1520
|
-
var
|
|
1547
|
+
var q, at = {
|
|
1521
1548
|
buildUnableToPopLexerModeMessage: (e) => `Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,
|
|
1522
1549
|
buildUnexpectedCharactersMessage: (e, t, n, r, i, a) => `unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`
|
|
1523
1550
|
};
|
|
1524
1551
|
(function(e) {
|
|
1525
1552
|
e[e.MISSING_PATTERN = 0] = "MISSING_PATTERN", e[e.INVALID_PATTERN = 1] = "INVALID_PATTERN", e[e.EOI_ANCHOR_FOUND = 2] = "EOI_ANCHOR_FOUND", e[e.UNSUPPORTED_FLAGS_FOUND = 3] = "UNSUPPORTED_FLAGS_FOUND", e[e.DUPLICATE_PATTERNS_FOUND = 4] = "DUPLICATE_PATTERNS_FOUND", e[e.INVALID_GROUP_TYPE_FOUND = 5] = "INVALID_GROUP_TYPE_FOUND", e[e.PUSH_MODE_DOES_NOT_EXIST = 6] = "PUSH_MODE_DOES_NOT_EXIST", e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE = 7] = "MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE", e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY = 8] = "MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY", e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST = 9] = "MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST", e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED = 10] = "LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED", e[e.SOI_ANCHOR_FOUND = 11] = "SOI_ANCHOR_FOUND", e[e.EMPTY_MATCH_PATTERN = 12] = "EMPTY_MATCH_PATTERN", e[e.NO_LINE_BREAKS_FLAGS = 13] = "NO_LINE_BREAKS_FLAGS", e[e.UNREACHABLE_PATTERN = 14] = "UNREACHABLE_PATTERN", e[e.IDENTIFY_TERMINATOR = 15] = "IDENTIFY_TERMINATOR", e[e.CUSTOM_LINE_BREAK = 16] = "CUSTOM_LINE_BREAK", e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE = 17] = "MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";
|
|
1526
|
-
})(
|
|
1527
|
-
var
|
|
1553
|
+
})(q ||= {});
|
|
1554
|
+
var ot = {
|
|
1528
1555
|
deferDefinitionErrorsHandling: !1,
|
|
1529
1556
|
positionTracking: "full",
|
|
1530
1557
|
lineTerminatorsPattern: /\n|\r\n?/g,
|
|
1531
1558
|
lineTerminatorCharacters: ["\n", "\r"],
|
|
1532
1559
|
ensureOptimizations: !1,
|
|
1533
1560
|
safeMode: !1,
|
|
1534
|
-
errorMessageProvider:
|
|
1561
|
+
errorMessageProvider: at,
|
|
1535
1562
|
traceInitPerf: !1,
|
|
1536
1563
|
skipValidations: !1,
|
|
1537
1564
|
recoveryEnabled: !0
|
|
1538
1565
|
};
|
|
1539
|
-
Object.freeze(
|
|
1540
|
-
var
|
|
1541
|
-
constructor(e, t =
|
|
1566
|
+
Object.freeze(ot);
|
|
1567
|
+
var J = class {
|
|
1568
|
+
constructor(e, t = ot) {
|
|
1542
1569
|
if (this.lexerDefinition = e, this.lexerDefinitionErrors = [], this.lexerDefinitionWarning = [], this.patternIdxToConfig = {}, this.charCodeToPatternIdxToConfig = {}, this.modes = [], this.emptyGroups = {}, this.cachedGroupKeys = [], this.trackStartLines = !0, this.trackEndLines = !0, this.hasCustom = !1, this.canModeBeOptimized = {}, this.TRACE_INIT = (e, t) => {
|
|
1543
1570
|
if (!0 === this.traceInitPerf) {
|
|
1544
1571
|
this.traceInitIndent++;
|
|
1545
1572
|
let n = Array(this.traceInitIndent + 1).join(" ");
|
|
1546
1573
|
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
|
|
1547
|
-
let { time: r, value:
|
|
1548
|
-
return this.traceInitIndent < this.traceInitMaxIdent &&
|
|
1574
|
+
let { time: r, value: i } = ae(t), a = r > 10 ? console.warn : console.log;
|
|
1575
|
+
return this.traceInitIndent < this.traceInitMaxIdent && a(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, i;
|
|
1549
1576
|
}
|
|
1550
1577
|
return t();
|
|
1551
1578
|
}, typeof t == "boolean") throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");
|
|
1552
|
-
this.config = Object.assign({},
|
|
1579
|
+
this.config = Object.assign({}, ot, t);
|
|
1553
1580
|
let n = this.config.traceInitPerf;
|
|
1554
|
-
!0 === n ? (this.traceInitMaxIdent =
|
|
1555
|
-
let n,
|
|
1581
|
+
!0 === n ? (this.traceInitMaxIdent = 1 / 0, this.traceInitPerf = !0) : typeof n == "number" && (this.traceInitMaxIdent = n, this.traceInitPerf = !0), this.traceInitIndent = -1, this.TRACE_INIT("Lexer Constructor", () => {
|
|
1582
|
+
let n, r = !0;
|
|
1556
1583
|
this.TRACE_INIT("Lexer Config handling", () => {
|
|
1557
|
-
if (this.config.lineTerminatorsPattern ===
|
|
1558
|
-
else if (this.config.lineTerminatorCharacters ===
|
|
1584
|
+
if (this.config.lineTerminatorsPattern === ot.lineTerminatorsPattern) this.config.lineTerminatorsPattern = We;
|
|
1585
|
+
else if (this.config.lineTerminatorCharacters === ot.lineTerminatorCharacters) throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");
|
|
1559
1586
|
if (t.safeMode && t.ensureOptimizations) throw Error("\"safeMode\" and \"ensureOptimizations\" flags are mutually exclusive.");
|
|
1560
1587
|
this.trackStartLines = /full|onlyStart/i.test(this.config.positionTracking), this.trackEndLines = /full/i.test(this.config.positionTracking), Array.isArray(e) ? n = {
|
|
1561
1588
|
modes: { defaultMode: [...e] },
|
|
1562
|
-
defaultMode:
|
|
1563
|
-
} : (
|
|
1589
|
+
defaultMode: Ie
|
|
1590
|
+
} : (r = !1, n = Object.assign({}, e));
|
|
1564
1591
|
}), !1 === this.config.skipValidations && (this.TRACE_INIT("performRuntimeChecks", () => {
|
|
1565
1592
|
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(function(e) {
|
|
1566
1593
|
let t = [];
|
|
1567
1594
|
return Object.hasOwn(e, "defaultMode") || t.push({
|
|
1568
1595
|
message: "A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition\n",
|
|
1569
|
-
type:
|
|
1596
|
+
type: q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE
|
|
1570
1597
|
}), Object.hasOwn(e, "modes") || t.push({
|
|
1571
1598
|
message: "A MultiMode Lexer cannot be initialized without a <modes> property in its definition\n",
|
|
1572
|
-
type:
|
|
1599
|
+
type: q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY
|
|
1573
1600
|
}), Object.hasOwn(e, "modes") && Object.hasOwn(e, "defaultMode") && !Object.hasOwn(e.modes, e.defaultMode) && t.push({
|
|
1574
|
-
message: `A MultiMode Lexer cannot be initialized with a ${
|
|
1575
|
-
type:
|
|
1601
|
+
message: `A MultiMode Lexer cannot be initialized with a ${Ie}: <${e.defaultMode}>which does not exist\n`,
|
|
1602
|
+
type: q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST
|
|
1576
1603
|
}), Object.hasOwn(e, "modes") && Object.keys(e.modes).forEach((n) => {
|
|
1577
1604
|
let r = e.modes[n];
|
|
1578
1605
|
r.forEach((e, i) => {
|
|
1579
1606
|
e === void 0 ? t.push({
|
|
1580
1607
|
message: `A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,
|
|
1581
|
-
type:
|
|
1608
|
+
type: q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED
|
|
1582
1609
|
}) : Object.hasOwn(e, "LONGER_ALT") && (Array.isArray(e.LONGER_ALT) ? e.LONGER_ALT : [e.LONGER_ALT]).forEach((i) => {
|
|
1583
1610
|
i === void 0 || r.includes(i) || t.push({
|
|
1584
1611
|
message: `A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,
|
|
1585
|
-
type:
|
|
1612
|
+
type: q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE
|
|
1586
1613
|
});
|
|
1587
1614
|
});
|
|
1588
1615
|
});
|
|
@@ -1590,34 +1617,34 @@ var W = class {
|
|
|
1590
1617
|
}(n, this.trackStartLines, this.config.lineTerminatorCharacters));
|
|
1591
1618
|
}), this.TRACE_INIT("performWarningRuntimeChecks", () => {
|
|
1592
1619
|
this.lexerDefinitionWarning = this.lexerDefinitionWarning.concat(function(e, t, n) {
|
|
1593
|
-
let r = [], i = !1, a = Object.values(e.modes || {}).flat().filter(Boolean).filter((e) => e[
|
|
1620
|
+
let r = [], i = !1, a = Object.values(e.modes || {}).flat().filter(Boolean).filter((e) => e[G] !== J.NA), o = qe(n);
|
|
1594
1621
|
return t && a.forEach((e) => {
|
|
1595
|
-
let t =
|
|
1622
|
+
let t = Ge(e, o);
|
|
1596
1623
|
if (!1 !== t) {
|
|
1597
1624
|
let n = {
|
|
1598
|
-
message:
|
|
1625
|
+
message: Ke(e, t),
|
|
1599
1626
|
type: t.issue,
|
|
1600
1627
|
tokenType: e
|
|
1601
1628
|
};
|
|
1602
1629
|
r.push(n);
|
|
1603
|
-
} else Object.hasOwn(e, "LINE_BREAKS") ? !0 === e.LINE_BREAKS && (i = !0) :
|
|
1630
|
+
} else Object.hasOwn(e, "LINE_BREAKS") ? !0 === e.LINE_BREAKS && (i = !0) : Fe(o, e.PATTERN) && (i = !0);
|
|
1604
1631
|
}), t && !i && r.push({
|
|
1605
1632
|
message: "Warning: No LINE_BREAKS Found.\n This Lexer has been defined to track line and column information,\n But none of the Token Types can be identified as matching a line terminator.\n See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n for details.",
|
|
1606
|
-
type:
|
|
1633
|
+
type: q.NO_LINE_BREAKS_FLAGS
|
|
1607
1634
|
}), r;
|
|
1608
1635
|
}(n, this.trackStartLines, this.config.lineTerminatorCharacters));
|
|
1609
1636
|
})), n.modes = n.modes ? n.modes : {}, Object.entries(n.modes).forEach(([e, t]) => {
|
|
1610
1637
|
n.modes[e] = t.filter((e) => e !== void 0);
|
|
1611
1638
|
});
|
|
1612
|
-
let
|
|
1639
|
+
let i = Object.keys(n.modes);
|
|
1613
1640
|
if (Object.entries(n.modes).forEach(([e, n]) => {
|
|
1614
1641
|
this.TRACE_INIT(`Mode: <${e}> processing`, () => {
|
|
1615
1642
|
if (this.modes.push(e), !1 === this.config.skipValidations && this.TRACE_INIT("validatePatterns", () => {
|
|
1616
|
-
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(
|
|
1643
|
+
this.lexerDefinitionErrors = this.lexerDefinitionErrors.concat(Re(n, i));
|
|
1617
1644
|
}), this.lexerDefinitionErrors.length === 0) {
|
|
1618
1645
|
let r;
|
|
1619
|
-
|
|
1620
|
-
r =
|
|
1646
|
+
et(n), this.TRACE_INIT("analyzeTokenTypes", () => {
|
|
1647
|
+
r = Le(n, {
|
|
1621
1648
|
lineTerminatorCharacters: this.config.lineTerminatorCharacters,
|
|
1622
1649
|
positionTracking: t.positionTracking,
|
|
1623
1650
|
ensureOptimizations: t.ensureOptimizations,
|
|
@@ -1632,9 +1659,9 @@ var W = class {
|
|
|
1632
1659
|
throw Error("Errors detected in definition of Lexer:\n" + e);
|
|
1633
1660
|
}
|
|
1634
1661
|
this.lexerDefinitionWarning.forEach((e) => {
|
|
1635
|
-
|
|
1662
|
+
D(e.message);
|
|
1636
1663
|
}), this.TRACE_INIT("Choosing sub-methods implementations", () => {
|
|
1637
|
-
if (
|
|
1664
|
+
if (r && (this.handleModes = () => {}), !1 === this.trackStartLines && (this.computeNewColumn = (e) => e), !1 === this.trackEndLines && (this.updateTokenEndLineColumnLocation = () => {}), /full/i.test(this.config.positionTracking)) this.createTokenInstance = this.createFullToken;
|
|
1638
1665
|
else if (/onlyStart/i.test(this.config.positionTracking)) this.createTokenInstance = this.createStartOnlyToken;
|
|
1639
1666
|
else {
|
|
1640
1667
|
if (!/onlyOffset/i.test(this.config.positionTracking)) throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);
|
|
@@ -1645,9 +1672,9 @@ var W = class {
|
|
|
1645
1672
|
let e = Object.entries(this.canModeBeOptimized).reduce((e, [t, n]) => (!1 === n && e.push(t), e), []);
|
|
1646
1673
|
if (t.ensureOptimizations && e.length > 0) throw Error(`Lexer Modes: < ${e.join(", ")} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`);
|
|
1647
1674
|
}), this.TRACE_INIT("clearRegExpParserCache", () => {
|
|
1648
|
-
|
|
1675
|
+
we = {};
|
|
1649
1676
|
}), this.TRACE_INIT("toFastProperties", () => {
|
|
1650
|
-
|
|
1677
|
+
O(this);
|
|
1651
1678
|
});
|
|
1652
1679
|
});
|
|
1653
1680
|
}
|
|
@@ -1659,14 +1686,14 @@ var W = class {
|
|
|
1659
1686
|
return this.tokenizeInternal(e, t);
|
|
1660
1687
|
}
|
|
1661
1688
|
tokenizeInternal(e, t) {
|
|
1662
|
-
let n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = e, v = _.length, y = 0, b = 0, x = this.hasCustom ? 0 : Math.floor(e.length / 10), S = Array(x),
|
|
1663
|
-
for (let e = 0; e < this.cachedGroupKeys.length; e++)
|
|
1664
|
-
let
|
|
1665
|
-
Object.freeze(
|
|
1666
|
-
let
|
|
1667
|
-
if (
|
|
1689
|
+
let n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = e, v = _.length, y = 0, b = 0, x = this.hasCustom ? 0 : Math.floor(e.length / 10), S = Array(x), ee = [], te = this.trackStartLines ? 1 : void 0, C = this.trackStartLines ? 1 : void 0, w = {};
|
|
1690
|
+
for (let e = 0; e < this.cachedGroupKeys.length; e++) w[this.cachedGroupKeys[e]] = [];
|
|
1691
|
+
let ne = this.trackStartLines, re = this.config.lineTerminatorsPattern, ie = 0, T = [], E = [], D = [], ae = [];
|
|
1692
|
+
Object.freeze(ae);
|
|
1693
|
+
let O = !1, k = (e) => {
|
|
1694
|
+
if (D.length === 1 && e.tokenType.PUSH_MODE === void 0) {
|
|
1668
1695
|
let t = this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);
|
|
1669
|
-
|
|
1696
|
+
ee.push({
|
|
1670
1697
|
offset: e.startOffset,
|
|
1671
1698
|
line: e.startLine,
|
|
1672
1699
|
column: e.startColumn,
|
|
@@ -1674,42 +1701,60 @@ var W = class {
|
|
|
1674
1701
|
message: t
|
|
1675
1702
|
});
|
|
1676
1703
|
} else {
|
|
1677
|
-
|
|
1678
|
-
let e =
|
|
1679
|
-
|
|
1704
|
+
D.pop();
|
|
1705
|
+
let e = D.at(-1);
|
|
1706
|
+
T = this.patternIdxToConfig[e], E = this.charCodeToPatternIdxToConfig[e], ie = T.length;
|
|
1680
1707
|
let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
|
|
1681
|
-
|
|
1708
|
+
O = !(!E || !t);
|
|
1682
1709
|
}
|
|
1683
1710
|
};
|
|
1684
|
-
function
|
|
1685
|
-
|
|
1711
|
+
function A(e) {
|
|
1712
|
+
D.push(e), E = this.charCodeToPatternIdxToConfig[e], T = this.patternIdxToConfig[e], ie = T.length;
|
|
1686
1713
|
let t = this.canModeBeOptimized[e] && !1 === this.config.safeMode;
|
|
1687
|
-
|
|
1714
|
+
O = !(!E || !t);
|
|
1688
1715
|
}
|
|
1689
|
-
let
|
|
1690
|
-
|
|
1691
|
-
let
|
|
1716
|
+
let j;
|
|
1717
|
+
A.call(this, t);
|
|
1718
|
+
let M = this.config.recoveryEnabled;
|
|
1692
1719
|
for (; y < v;) {
|
|
1693
1720
|
s = null, u = -1;
|
|
1694
1721
|
let t = _.charCodeAt(y), x;
|
|
1695
|
-
if (
|
|
1696
|
-
let e =
|
|
1697
|
-
x = n === void 0 ?
|
|
1698
|
-
} else x =
|
|
1699
|
-
let
|
|
1700
|
-
for (n = 0; n <
|
|
1701
|
-
|
|
1702
|
-
let r =
|
|
1703
|
-
c = null
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1722
|
+
if (O) {
|
|
1723
|
+
let e = K(t), n = E[e];
|
|
1724
|
+
x = n === void 0 ? ae : n;
|
|
1725
|
+
} else x = T;
|
|
1726
|
+
let N = x.length;
|
|
1727
|
+
for (n = 0; n < N; n++) {
|
|
1728
|
+
j = x[n];
|
|
1729
|
+
let r = j.pattern;
|
|
1730
|
+
switch (c = null, j.matchType) {
|
|
1731
|
+
case 0:
|
|
1732
|
+
t === j.short && (u = 1, s = r);
|
|
1733
|
+
break;
|
|
1734
|
+
case 1:
|
|
1735
|
+
g = r.exec(_, y, S, w), g === null ? s = null : (s = g[0], u = s.length, g.payload !== void 0 && (c = g.payload));
|
|
1736
|
+
break;
|
|
1737
|
+
case 3: {
|
|
1738
|
+
let e = j.asciiClass;
|
|
1739
|
+
if (e[t] !== 1) {
|
|
1740
|
+
r.lastIndex = 0;
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
let n = y + 1;
|
|
1744
|
+
for (; e[_.charCodeAt(n)] === 1;) n++;
|
|
1745
|
+
u = n - y, r.lastIndex = n;
|
|
1746
|
+
break;
|
|
1747
|
+
}
|
|
1748
|
+
case 2: r.lastIndex = y, u = this.matchLength(r, e, y);
|
|
1749
|
+
}
|
|
1750
|
+
if (u !== -1) {
|
|
1751
|
+
if (o = j.longerAlt, o !== void 0) {
|
|
1707
1752
|
s = e.substring(y, y + u);
|
|
1708
1753
|
let t = o.length;
|
|
1709
1754
|
for (i = 0; i < t; i++) {
|
|
1710
|
-
let t =
|
|
1711
|
-
if (l = null,
|
|
1712
|
-
s = a, u = a.length, c = l,
|
|
1755
|
+
let t = T[o[i]], n = t.pattern;
|
|
1756
|
+
if (l = null, t.matchType === 1 ? (g = n.exec(_, y, S, w), g === null ? a = null : (a = g[0], g.payload !== void 0 && (l = g.payload))) : (n.lastIndex = y, a = this.match(n, e, y)), a && a.length > s.length) {
|
|
1757
|
+
s = a, u = a.length, c = l, j = t;
|
|
1713
1758
|
break;
|
|
1714
1759
|
}
|
|
1715
1760
|
}
|
|
@@ -1718,34 +1763,44 @@ var W = class {
|
|
|
1718
1763
|
}
|
|
1719
1764
|
}
|
|
1720
1765
|
if (u !== -1) {
|
|
1721
|
-
if (d =
|
|
1766
|
+
if (d = j.group, d !== void 0 && (s = s === null ? e.substring(y, y + u) : s, f = j.tokenTypeIdx, p = this.createTokenInstance(s, y, f, j.tokenType, te, C, u), this.handlePayload(p, c), !1 === d ? b = this.addToken(S, b, p) : w[d].push(p)), !0 === ne && !0 === j.canLineTerminator) {
|
|
1722
1767
|
let t, n, r = 0;
|
|
1723
|
-
|
|
1768
|
+
re.lastIndex = 0;
|
|
1724
1769
|
do
|
|
1725
|
-
s = s === null ? e.substring(y, y + u) : s, t =
|
|
1770
|
+
s = s === null ? e.substring(y, y + u) : s, t = re.test(s), !0 === t && (n = re.lastIndex - 1, r++);
|
|
1726
1771
|
while (!0 === t);
|
|
1727
|
-
r === 0 ?
|
|
1728
|
-
} else
|
|
1729
|
-
y += u, this.handleModes(
|
|
1772
|
+
r === 0 ? C = this.computeNewColumn(C, u) : (te += r, C = u - n, this.updateTokenEndLineColumnLocation(p, d, n, r, te, C, u));
|
|
1773
|
+
} else C = this.computeNewColumn(C, u);
|
|
1774
|
+
y += u, this.handleModes(j, k, A, p);
|
|
1730
1775
|
} else {
|
|
1731
|
-
let t = y, n =
|
|
1732
|
-
for (; !1 === a && y < v;) for (y++, r = 0; r <
|
|
1733
|
-
let t =
|
|
1734
|
-
|
|
1776
|
+
let t = y, n = te, i = C, a = !1 === M;
|
|
1777
|
+
for (; !1 === a && y < v;) for (y++, r = 0; r < ie; r++) {
|
|
1778
|
+
let t = T[r], n = t.pattern;
|
|
1779
|
+
switch (t.matchType) {
|
|
1780
|
+
case 0:
|
|
1781
|
+
_.charCodeAt(y) === t.short && (a = !0);
|
|
1782
|
+
break;
|
|
1783
|
+
case 1:
|
|
1784
|
+
a = n.exec(_, y, S, w) !== null;
|
|
1785
|
+
break;
|
|
1786
|
+
case 3:
|
|
1787
|
+
case 2: n.lastIndex = y, a = n.exec(e) !== null;
|
|
1788
|
+
}
|
|
1789
|
+
if (!0 === a) break;
|
|
1735
1790
|
}
|
|
1736
|
-
if (m = y - t,
|
|
1791
|
+
if (m = y - t, C = this.computeNewColumn(C, m), h = this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_, t, m, n, i, D.at(-1)), ee.push({
|
|
1737
1792
|
offset: t,
|
|
1738
1793
|
line: n,
|
|
1739
1794
|
column: i,
|
|
1740
1795
|
length: m,
|
|
1741
1796
|
message: h
|
|
1742
|
-
}), !1 ===
|
|
1797
|
+
}), !1 === M) break;
|
|
1743
1798
|
}
|
|
1744
1799
|
}
|
|
1745
1800
|
return this.hasCustom || (S.length = b), {
|
|
1746
1801
|
tokens: S,
|
|
1747
|
-
groups:
|
|
1748
|
-
errors:
|
|
1802
|
+
groups: w,
|
|
1803
|
+
errors: ee
|
|
1749
1804
|
};
|
|
1750
1805
|
}
|
|
1751
1806
|
handleModes(e, t, n, r) {
|
|
@@ -1809,26 +1864,26 @@ var W = class {
|
|
|
1809
1864
|
return !0 === e.test(t) ? e.lastIndex - n : -1;
|
|
1810
1865
|
}
|
|
1811
1866
|
};
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1867
|
+
function st(e) {
|
|
1868
|
+
return ct(e) ? e.LABEL : e.name;
|
|
1814
1869
|
}
|
|
1815
|
-
function
|
|
1870
|
+
function ct(e) {
|
|
1816
1871
|
return typeof e.LABEL == "string" && e.LABEL !== "";
|
|
1817
1872
|
}
|
|
1818
|
-
|
|
1819
|
-
var
|
|
1820
|
-
function
|
|
1873
|
+
J.SKIPPED = "This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.", J.NA = /NOT_APPLICABLE/;
|
|
1874
|
+
var lt = "parent", ut = "categories", dt = "label", ft = "group", pt = "push_mode", mt = "pop_mode", ht = "longer_alt", gt = "line_breaks", _t = "start_chars_hint";
|
|
1875
|
+
function Y(e) {
|
|
1821
1876
|
return function(e) {
|
|
1822
1877
|
let t = e.pattern, n = {};
|
|
1823
|
-
if (n.name = e.name, t !== void 0 && (n.PATTERN = t), Object.hasOwn(e,
|
|
1824
|
-
return Object.hasOwn(e,
|
|
1878
|
+
if (n.name = e.name, t !== void 0 && (n.PATTERN = t), Object.hasOwn(e, lt)) throw "The parent property is no longer supported.\nSee: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.";
|
|
1879
|
+
return Object.hasOwn(e, ut) && (n.CATEGORIES = e[ut]), et([n]), Object.hasOwn(e, dt) && (n.LABEL = e[dt]), Object.hasOwn(e, ft) && (n.GROUP = e[ft]), Object.hasOwn(e, mt) && (n.POP_MODE = e[mt]), Object.hasOwn(e, pt) && (n.PUSH_MODE = e[pt]), Object.hasOwn(e, ht) && (n.LONGER_ALT = e[ht]), Object.hasOwn(e, gt) && (n.LINE_BREAKS = e[gt]), Object.hasOwn(e, _t) && (n.START_CHARS_HINT = e[_t]), n;
|
|
1825
1880
|
}(e);
|
|
1826
1881
|
}
|
|
1827
|
-
var
|
|
1882
|
+
var X = Y({
|
|
1828
1883
|
name: "EOF",
|
|
1829
|
-
pattern:
|
|
1884
|
+
pattern: J.NA
|
|
1830
1885
|
});
|
|
1831
|
-
function
|
|
1886
|
+
function vt(e, t, n, r, i, a, o, s) {
|
|
1832
1887
|
return {
|
|
1833
1888
|
image: t,
|
|
1834
1889
|
startOffset: n,
|
|
@@ -1841,38 +1896,38 @@ function Ke(e, t, n, r, i, a, o, s) {
|
|
|
1841
1896
|
tokenType: e
|
|
1842
1897
|
};
|
|
1843
1898
|
}
|
|
1844
|
-
|
|
1845
|
-
var
|
|
1846
|
-
buildMismatchTokenMessage: ({ expected: e, actual: t, previous: n, ruleName: r }) => `Expecting ${
|
|
1899
|
+
et([X]);
|
|
1900
|
+
var yt = {
|
|
1901
|
+
buildMismatchTokenMessage: ({ expected: e, actual: t, previous: n, ruleName: r }) => `Expecting ${ct(e) ? `--\x3e ${st(e)} <--` : `token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,
|
|
1847
1902
|
buildNotAllInputParsedMessage: ({ firstRedundant: e, ruleName: t }) => "Redundant input, expecting EOF but found: " + e.image,
|
|
1848
1903
|
buildNoViableAltMessage({ expectedPathsPerAlt: e, actual: t, previous: n, customUserDescription: r, ruleName: i }) {
|
|
1849
1904
|
let a = "\nbut found: '" + t[0].image + "'";
|
|
1850
|
-
return r ? "Expecting: " + r + a : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) =>
|
|
1905
|
+
return r ? "Expecting: " + r + a : `Expecting: one of these possible Token sequences:\n${e.reduce((e, t) => e.concat(t), []).map((e) => `[${e.map((e) => st(e)).join(", ")}]`).map((e, t) => ` ${t + 1}. ${e}`).join("\n")}` + a;
|
|
1851
1906
|
},
|
|
1852
1907
|
buildEarlyExitMessage({ expectedIterationPaths: e, actual: t, customUserDescription: n, ruleName: r }) {
|
|
1853
1908
|
let i = "\nbut found: '" + t[0].image + "'";
|
|
1854
|
-
return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) =>
|
|
1909
|
+
return n ? "Expecting: " + n + i : `Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map((e) => `[${e.map((e) => st(e)).join(",")}]`).join(" ,")}>` + i;
|
|
1855
1910
|
}
|
|
1856
1911
|
};
|
|
1857
|
-
Object.freeze(
|
|
1858
|
-
var
|
|
1912
|
+
Object.freeze(yt);
|
|
1913
|
+
var bt = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a rule which is not defined: ->" + t.nonTerminalName + "<-\ninside top level rule: ->" + e.name + "<-" }, xt = {
|
|
1859
1914
|
buildDuplicateFoundError(e, t) {
|
|
1860
|
-
let n = e.name, r = t[0], i = r.idx, a =
|
|
1861
|
-
var
|
|
1862
|
-
let
|
|
1863
|
-
return
|
|
1915
|
+
let n = e.name, r = t[0], i = r.idx, a = V(r), o = (s = r) instanceof z ? s.terminalType.name : s instanceof A ? s.nonTerminalName : "";
|
|
1916
|
+
var s;
|
|
1917
|
+
let c = `->${a}${i > 0 ? i : ""}<- ${o ? `with argument: ->${o}<-` : ""}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;
|
|
1918
|
+
return c = c.replace(/[ \t]+/g, " "), c = c.replace(/\s\s+/g, "\n"), c;
|
|
1864
1919
|
},
|
|
1865
1920
|
buildNamespaceConflictError: (e) => `Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,
|
|
1866
1921
|
buildAlternationPrefixAmbiguityError(e) {
|
|
1867
|
-
let t = e.prefixPath.map((e) =>
|
|
1922
|
+
let t = e.prefixPath.map((e) => st(e)).join(", "), n = e.alternation.idx === 0 ? "" : e.alternation.idx;
|
|
1868
1923
|
return `Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`;
|
|
1869
1924
|
},
|
|
1870
1925
|
buildAlternationAmbiguityError(e) {
|
|
1871
1926
|
let t = e.alternation.idx === 0 ? "" : e.alternation.idx, n = e.prefixPath.length === 0, r = `Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;
|
|
1872
|
-
return n ?
|
|
1927
|
+
return r += n ? "These alternatives are all empty (match no tokens), making them indistinguishable.\nOnly the last alternative may be empty.\n" : `<${e.prefixPath.map((e) => st(e)).join(", ")}> may appears as a prefix path in all these alternatives.\n`, r += "See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details.", r;
|
|
1873
1928
|
},
|
|
1874
1929
|
buildEmptyRepetitionError(e) {
|
|
1875
|
-
let t =
|
|
1930
|
+
let t = V(e.repetition);
|
|
1876
1931
|
return e.repetition.idx !== 0 && (t += e.repetition.idx), `The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`;
|
|
1877
1932
|
},
|
|
1878
1933
|
buildTokenNameError: (e) => "deprecated",
|
|
@@ -1885,9 +1940,9 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
|
|
|
1885
1940
|
buildInvalidRuleNameError: (e) => "deprecated",
|
|
1886
1941
|
buildDuplicateRuleNameError(e) {
|
|
1887
1942
|
let t;
|
|
1888
|
-
return t = e.topLevelRule instanceof
|
|
1943
|
+
return t = e.topLevelRule instanceof j ? e.topLevelRule.name : e.topLevelRule, `Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`;
|
|
1889
1944
|
}
|
|
1890
|
-
},
|
|
1945
|
+
}, Z, St = class extends se {
|
|
1891
1946
|
constructor(e, t) {
|
|
1892
1947
|
super(), this.nameToTopRule = e, this.errMsgProvider = t, this.errors = [];
|
|
1893
1948
|
}
|
|
@@ -1909,7 +1964,7 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
|
|
|
1909
1964
|
});
|
|
1910
1965
|
}
|
|
1911
1966
|
}
|
|
1912
|
-
},
|
|
1967
|
+
}, Ct = class extends le {
|
|
1913
1968
|
constructor(e, t) {
|
|
1914
1969
|
super(), this.topProd = e, this.path = t, this.possibleTokTypes = [], this.nextProductionName = "", this.nextProductionOccurrence = 0, this.found = !1, this.isAtEndOfPath = !1;
|
|
1915
1970
|
}
|
|
@@ -1929,17 +1984,17 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
|
|
|
1929
1984
|
updateExpectedNext() {
|
|
1930
1985
|
this.ruleStack.length === 0 ? (this.nextProductionName = "", this.nextProductionOccurrence = 0, this.isAtEndOfPath = !0) : (this.nextProductionName = this.ruleStack.pop(), this.nextProductionOccurrence = this.occurrenceStack.pop());
|
|
1931
1986
|
}
|
|
1932
|
-
},
|
|
1987
|
+
}, wt = class extends Ct {
|
|
1933
1988
|
constructor(e, t) {
|
|
1934
1989
|
super(e, t), this.path = t, this.nextTerminalName = "", this.nextTerminalOccurrence = 0, this.nextTerminalName = this.path.lastTok.name, this.nextTerminalOccurrence = this.path.lastTokOccurrence;
|
|
1935
1990
|
}
|
|
1936
1991
|
walkTerminal(e, t, n) {
|
|
1937
1992
|
if (this.isAtEndOfPath && e.terminalType.name === this.nextTerminalName && e.idx === this.nextTerminalOccurrence && !this.found) {
|
|
1938
|
-
let e = new
|
|
1939
|
-
this.possibleTokTypes =
|
|
1993
|
+
let e = new M({ definition: t.concat(n) });
|
|
1994
|
+
this.possibleTokTypes = de(e), this.found = !0;
|
|
1940
1995
|
}
|
|
1941
1996
|
}
|
|
1942
|
-
},
|
|
1997
|
+
}, Tt = class extends le {
|
|
1943
1998
|
constructor(e, t) {
|
|
1944
1999
|
super(), this.topRule = e, this.occurrence = t, this.result = {
|
|
1945
2000
|
token: void 0,
|
|
@@ -1950,56 +2005,56 @@ var Je = { buildRuleNotFoundError: (e, t) => "Invalid grammar, reference to a ru
|
|
|
1950
2005
|
startWalking() {
|
|
1951
2006
|
return this.walk(this.topRule), this.result;
|
|
1952
2007
|
}
|
|
1953
|
-
},
|
|
2008
|
+
}, Et = class extends Tt {
|
|
1954
2009
|
walkMany(e, t, n) {
|
|
1955
2010
|
if (e.idx === this.occurrence) {
|
|
1956
2011
|
let e = t.concat(n)[0];
|
|
1957
|
-
this.result.isEndOfRule = e === void 0, e instanceof
|
|
2012
|
+
this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
1958
2013
|
} else super.walkMany(e, t, n);
|
|
1959
2014
|
}
|
|
1960
|
-
},
|
|
2015
|
+
}, Dt = class extends Tt {
|
|
1961
2016
|
walkManySep(e, t, n) {
|
|
1962
2017
|
if (e.idx === this.occurrence) {
|
|
1963
2018
|
let e = t.concat(n)[0];
|
|
1964
|
-
this.result.isEndOfRule = e === void 0, e instanceof
|
|
2019
|
+
this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
1965
2020
|
} else super.walkManySep(e, t, n);
|
|
1966
2021
|
}
|
|
1967
|
-
},
|
|
2022
|
+
}, Ot = class extends Tt {
|
|
1968
2023
|
walkAtLeastOne(e, t, n) {
|
|
1969
2024
|
if (e.idx === this.occurrence) {
|
|
1970
2025
|
let e = t.concat(n)[0];
|
|
1971
|
-
this.result.isEndOfRule = e === void 0, e instanceof
|
|
2026
|
+
this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
1972
2027
|
} else super.walkAtLeastOne(e, t, n);
|
|
1973
2028
|
}
|
|
1974
|
-
},
|
|
2029
|
+
}, kt = class extends Tt {
|
|
1975
2030
|
walkAtLeastOneSep(e, t, n) {
|
|
1976
2031
|
if (e.idx === this.occurrence) {
|
|
1977
2032
|
let e = t.concat(n)[0];
|
|
1978
|
-
this.result.isEndOfRule = e === void 0, e instanceof
|
|
2033
|
+
this.result.isEndOfRule = e === void 0, e instanceof z && (this.result.token = e.terminalType, this.result.occurrence = e.idx);
|
|
1979
2034
|
} else super.walkAtLeastOneSep(e, t, n);
|
|
1980
2035
|
}
|
|
1981
2036
|
};
|
|
1982
|
-
function
|
|
2037
|
+
function At(e, t, n = []) {
|
|
1983
2038
|
n = [...n];
|
|
1984
2039
|
let r = [], i = 0;
|
|
1985
2040
|
function a(a) {
|
|
1986
|
-
let o =
|
|
2041
|
+
let o = At(a.concat(e.slice(i + 1)), t, n);
|
|
1987
2042
|
return r.concat(o);
|
|
1988
2043
|
}
|
|
1989
2044
|
for (; n.length < t && i < e.length;) {
|
|
1990
2045
|
let t = e[i];
|
|
1991
|
-
if (t instanceof
|
|
1992
|
-
if (t instanceof
|
|
2046
|
+
if (t instanceof M || t instanceof A) return a(t.definition);
|
|
2047
|
+
if (t instanceof N) r = a(t.definition);
|
|
1993
2048
|
else {
|
|
1994
|
-
if (t instanceof
|
|
1995
|
-
if (t instanceof
|
|
1996
|
-
if (t instanceof
|
|
1997
|
-
else if (t instanceof
|
|
2049
|
+
if (t instanceof P) return a(t.definition.concat([new I({ definition: t.definition })]));
|
|
2050
|
+
if (t instanceof F) return a([new M({ definition: t.definition }), new I({ definition: [new z({ terminalType: t.separator })].concat(t.definition) })]);
|
|
2051
|
+
if (t instanceof L) r = a(t.definition.concat([new I({ definition: [new z({ terminalType: t.separator })].concat(t.definition) })]));
|
|
2052
|
+
else if (t instanceof I) r = a(t.definition.concat([new I({ definition: t.definition })]));
|
|
1998
2053
|
else {
|
|
1999
|
-
if (t instanceof
|
|
2054
|
+
if (t instanceof R) return t.definition.forEach((e) => {
|
|
2000
2055
|
e.definition.length !== 0 && (r = a(e.definition));
|
|
2001
2056
|
}), r;
|
|
2002
|
-
if (!(t instanceof
|
|
2057
|
+
if (!(t instanceof z)) throw Error("non exhaustive match");
|
|
2003
2058
|
n.push(t.terminalType);
|
|
2004
2059
|
}
|
|
2005
2060
|
}
|
|
@@ -2010,7 +2065,7 @@ function rt(e, t, n = []) {
|
|
|
2010
2065
|
suffixDef: e.slice(i)
|
|
2011
2066
|
}), r;
|
|
2012
2067
|
}
|
|
2013
|
-
function
|
|
2068
|
+
function jt(e, t, n, r) {
|
|
2014
2069
|
let i = [...n];
|
|
2015
2070
|
i.push(e.name);
|
|
2016
2071
|
let a = [...r];
|
|
@@ -2021,16 +2076,16 @@ function it(e, t, n, r) {
|
|
|
2021
2076
|
occurrenceStack: a
|
|
2022
2077
|
};
|
|
2023
2078
|
}
|
|
2024
|
-
function
|
|
2025
|
-
if (e instanceof
|
|
2026
|
-
if (e instanceof
|
|
2027
|
-
if (e instanceof
|
|
2028
|
-
if (e instanceof
|
|
2029
|
-
if (e instanceof
|
|
2030
|
-
if (e instanceof
|
|
2079
|
+
function Mt(e) {
|
|
2080
|
+
if (e instanceof N || e === "Option") return Z.OPTION;
|
|
2081
|
+
if (e instanceof I || e === "Repetition") return Z.REPETITION;
|
|
2082
|
+
if (e instanceof P || e === "RepetitionMandatory") return Z.REPETITION_MANDATORY;
|
|
2083
|
+
if (e instanceof F || e === "RepetitionMandatoryWithSeparator") return Z.REPETITION_MANDATORY_WITH_SEPARATOR;
|
|
2084
|
+
if (e instanceof L || e === "RepetitionWithSeparator") return Z.REPETITION_WITH_SEPARATOR;
|
|
2085
|
+
if (e instanceof R || e === "Alternation") return Z.ALTERNATION;
|
|
2031
2086
|
throw Error("non exhaustive match");
|
|
2032
2087
|
}
|
|
2033
|
-
function
|
|
2088
|
+
function Nt(e, t, n, r) {
|
|
2034
2089
|
let i = e.length, a = e.every((e) => e.every((e) => e.length === 1));
|
|
2035
2090
|
if (t) return function(t) {
|
|
2036
2091
|
let r = t.map((e) => e.GATE);
|
|
@@ -2065,7 +2120,7 @@ function ot(e, t, n, r) {
|
|
|
2065
2120
|
}
|
|
2066
2121
|
};
|
|
2067
2122
|
}
|
|
2068
|
-
function
|
|
2123
|
+
function Pt(e, t, n) {
|
|
2069
2124
|
let r = e.every((e) => e.length === 1), i = e.length;
|
|
2070
2125
|
if (r && !n) {
|
|
2071
2126
|
let t = e.flat();
|
|
@@ -2096,8 +2151,8 @@ function st(e, t, n) {
|
|
|
2096
2151
|
}
|
|
2097
2152
|
(function(e) {
|
|
2098
2153
|
e[e.OPTION = 0] = "OPTION", e[e.REPETITION = 1] = "REPETITION", e[e.REPETITION_MANDATORY = 2] = "REPETITION_MANDATORY", e[e.REPETITION_MANDATORY_WITH_SEPARATOR = 3] = "REPETITION_MANDATORY_WITH_SEPARATOR", e[e.REPETITION_WITH_SEPARATOR = 4] = "REPETITION_WITH_SEPARATOR", e[e.ALTERNATION = 5] = "ALTERNATION";
|
|
2099
|
-
})(
|
|
2100
|
-
var
|
|
2154
|
+
})(Z ||= {});
|
|
2155
|
+
var Ft = class extends le {
|
|
2101
2156
|
constructor(e, t, n) {
|
|
2102
2157
|
super(), this.topProd = e, this.targetOccurrence = t, this.targetProdType = n;
|
|
2103
2158
|
}
|
|
@@ -2108,21 +2163,21 @@ var ct = class extends S {
|
|
|
2108
2163
|
return e.idx === this.targetOccurrence && this.targetProdType === t && (this.restDef = n.concat(r), !0);
|
|
2109
2164
|
}
|
|
2110
2165
|
walkOption(e, t, n) {
|
|
2111
|
-
this.checkIsTarget(e,
|
|
2166
|
+
this.checkIsTarget(e, Z.OPTION, t, n) || super.walkOption(e, t, n);
|
|
2112
2167
|
}
|
|
2113
2168
|
walkAtLeastOne(e, t, n) {
|
|
2114
|
-
this.checkIsTarget(e,
|
|
2169
|
+
this.checkIsTarget(e, Z.REPETITION_MANDATORY, t, n) || super.walkOption(e, t, n);
|
|
2115
2170
|
}
|
|
2116
2171
|
walkAtLeastOneSep(e, t, n) {
|
|
2117
|
-
this.checkIsTarget(e,
|
|
2172
|
+
this.checkIsTarget(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
|
|
2118
2173
|
}
|
|
2119
2174
|
walkMany(e, t, n) {
|
|
2120
|
-
this.checkIsTarget(e,
|
|
2175
|
+
this.checkIsTarget(e, Z.REPETITION, t, n) || super.walkOption(e, t, n);
|
|
2121
2176
|
}
|
|
2122
2177
|
walkManySep(e, t, n) {
|
|
2123
|
-
this.checkIsTarget(e,
|
|
2178
|
+
this.checkIsTarget(e, Z.REPETITION_WITH_SEPARATOR, t, n) || super.walkOption(e, t, n);
|
|
2124
2179
|
}
|
|
2125
|
-
},
|
|
2180
|
+
}, It = class extends se {
|
|
2126
2181
|
constructor(e, t, n) {
|
|
2127
2182
|
super(), this.targetOccurrence = e, this.targetProdType = t, this.targetRef = n, this.result = [];
|
|
2128
2183
|
}
|
|
@@ -2130,30 +2185,30 @@ var ct = class extends S {
|
|
|
2130
2185
|
e.idx !== this.targetOccurrence || this.targetProdType !== t || this.targetRef !== void 0 && e !== this.targetRef || (this.result = e.definition);
|
|
2131
2186
|
}
|
|
2132
2187
|
visitOption(e) {
|
|
2133
|
-
this.checkIsTarget(e,
|
|
2188
|
+
this.checkIsTarget(e, Z.OPTION);
|
|
2134
2189
|
}
|
|
2135
2190
|
visitRepetition(e) {
|
|
2136
|
-
this.checkIsTarget(e,
|
|
2191
|
+
this.checkIsTarget(e, Z.REPETITION);
|
|
2137
2192
|
}
|
|
2138
2193
|
visitRepetitionMandatory(e) {
|
|
2139
|
-
this.checkIsTarget(e,
|
|
2194
|
+
this.checkIsTarget(e, Z.REPETITION_MANDATORY);
|
|
2140
2195
|
}
|
|
2141
2196
|
visitRepetitionMandatoryWithSeparator(e) {
|
|
2142
|
-
this.checkIsTarget(e,
|
|
2197
|
+
this.checkIsTarget(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR);
|
|
2143
2198
|
}
|
|
2144
2199
|
visitRepetitionWithSeparator(e) {
|
|
2145
|
-
this.checkIsTarget(e,
|
|
2200
|
+
this.checkIsTarget(e, Z.REPETITION_WITH_SEPARATOR);
|
|
2146
2201
|
}
|
|
2147
2202
|
visitAlternation(e) {
|
|
2148
|
-
this.checkIsTarget(e,
|
|
2203
|
+
this.checkIsTarget(e, Z.ALTERNATION);
|
|
2149
2204
|
}
|
|
2150
2205
|
};
|
|
2151
|
-
function
|
|
2206
|
+
function Lt(e) {
|
|
2152
2207
|
let t = Array(e);
|
|
2153
2208
|
for (let n = 0; n < e; n++) t[n] = [];
|
|
2154
2209
|
return t;
|
|
2155
2210
|
}
|
|
2156
|
-
function
|
|
2211
|
+
function Rt(e) {
|
|
2157
2212
|
let t = [""];
|
|
2158
2213
|
for (let n = 0; n < e.length; n++) {
|
|
2159
2214
|
let r = e[n], i = [];
|
|
@@ -2169,7 +2224,7 @@ function dt(e) {
|
|
|
2169
2224
|
}
|
|
2170
2225
|
return t;
|
|
2171
2226
|
}
|
|
2172
|
-
function
|
|
2227
|
+
function zt(e, t, n) {
|
|
2173
2228
|
for (let r = 0; r < e.length; r++) {
|
|
2174
2229
|
if (r === n) continue;
|
|
2175
2230
|
let i = e[r];
|
|
@@ -2177,25 +2232,25 @@ function ft(e, t, n) {
|
|
|
2177
2232
|
}
|
|
2178
2233
|
return !0;
|
|
2179
2234
|
}
|
|
2180
|
-
function
|
|
2181
|
-
let n = e.map((e) =>
|
|
2235
|
+
function Bt(e, t) {
|
|
2236
|
+
let n = e.map((e) => At([e], 1)), r = Lt(n.length), i = n.map((e) => {
|
|
2182
2237
|
let t = {};
|
|
2183
2238
|
return e.forEach((e) => {
|
|
2184
|
-
|
|
2239
|
+
Rt(e.partialPath).forEach((e) => {
|
|
2185
2240
|
t[e] = !0;
|
|
2186
2241
|
});
|
|
2187
2242
|
}), t;
|
|
2188
2243
|
}), a = n;
|
|
2189
2244
|
for (let e = 1; e <= t; e++) {
|
|
2190
2245
|
let n = a;
|
|
2191
|
-
a =
|
|
2246
|
+
a = Lt(n.length);
|
|
2192
2247
|
for (let o = 0; o < n.length; o++) {
|
|
2193
2248
|
let s = n[o];
|
|
2194
2249
|
for (let n = 0; n < s.length; n++) {
|
|
2195
|
-
let c = s[n].partialPath, l = s[n].suffixDef, u =
|
|
2196
|
-
if (
|
|
2250
|
+
let c = s[n].partialPath, l = s[n].suffixDef, u = Rt(c);
|
|
2251
|
+
if (zt(i, u, o) || l.length === 0 || c.length === t) {
|
|
2197
2252
|
let e = r[o];
|
|
2198
|
-
if (!1 ===
|
|
2253
|
+
if (!1 === Ut(e, c)) {
|
|
2199
2254
|
e.push(c);
|
|
2200
2255
|
for (let e = 0; e < u.length; e++) {
|
|
2201
2256
|
let t = u[e];
|
|
@@ -2203,9 +2258,9 @@ function pt(e, t) {
|
|
|
2203
2258
|
}
|
|
2204
2259
|
}
|
|
2205
2260
|
} else {
|
|
2206
|
-
let t =
|
|
2261
|
+
let t = At(l, e + 1, c);
|
|
2207
2262
|
a[o] = a[o].concat(t), t.forEach((e) => {
|
|
2208
|
-
|
|
2263
|
+
Rt(e.partialPath).forEach((e) => {
|
|
2209
2264
|
i[o][e] = !0;
|
|
2210
2265
|
});
|
|
2211
2266
|
});
|
|
@@ -2215,17 +2270,17 @@ function pt(e, t) {
|
|
|
2215
2270
|
}
|
|
2216
2271
|
return r;
|
|
2217
2272
|
}
|
|
2218
|
-
function
|
|
2219
|
-
let i = new
|
|
2220
|
-
return t.accept(i),
|
|
2273
|
+
function Vt(e, t, n, r) {
|
|
2274
|
+
let i = new It(e, Z.ALTERNATION, r);
|
|
2275
|
+
return t.accept(i), Bt(i.result, n);
|
|
2221
2276
|
}
|
|
2222
|
-
function
|
|
2223
|
-
let i = new
|
|
2277
|
+
function Ht(e, t, n, r) {
|
|
2278
|
+
let i = new It(e, n);
|
|
2224
2279
|
t.accept(i);
|
|
2225
|
-
let a = i.result, o = new
|
|
2226
|
-
return
|
|
2280
|
+
let a = i.result, o = new Ft(t, e, n).startWalking();
|
|
2281
|
+
return Bt([new M({ definition: a }), new M({ definition: o })], r);
|
|
2227
2282
|
}
|
|
2228
|
-
function
|
|
2283
|
+
function Ut(e, t) {
|
|
2229
2284
|
e: for (let n = 0; n < e.length; n++) {
|
|
2230
2285
|
let r = e[n];
|
|
2231
2286
|
if (r.length === t.length) {
|
|
@@ -2238,22 +2293,22 @@ function gt(e, t) {
|
|
|
2238
2293
|
}
|
|
2239
2294
|
return !1;
|
|
2240
2295
|
}
|
|
2241
|
-
function
|
|
2296
|
+
function Wt(e) {
|
|
2242
2297
|
return e.every((e) => e.every((e) => e.every((e) => e.categoryMatches.length === 0)));
|
|
2243
2298
|
}
|
|
2244
|
-
function
|
|
2299
|
+
function Gt(e, t, n, r) {
|
|
2245
2300
|
let i = e.flatMap((e) => function(e, t) {
|
|
2246
|
-
let n = new
|
|
2301
|
+
let n = new Jt();
|
|
2247
2302
|
e.accept(n);
|
|
2248
|
-
let r = n.allProductions, i = Object.groupBy(r,
|
|
2303
|
+
let r = n.allProductions, i = Object.groupBy(r, Kt), a = Object.fromEntries(Object.entries(i).filter(([e, t]) => t.length > 1));
|
|
2249
2304
|
return Object.values(a).map((n) => {
|
|
2250
|
-
let r = n[0], i = t.buildDuplicateFoundError(e, n), a =
|
|
2305
|
+
let r = n[0], i = t.buildDuplicateFoundError(e, n), a = V(r), o = {
|
|
2251
2306
|
message: i,
|
|
2252
2307
|
type: Q.DUPLICATE_PRODUCTIONS,
|
|
2253
2308
|
ruleName: e.name,
|
|
2254
2309
|
dslName: a,
|
|
2255
2310
|
occurrence: r.idx
|
|
2256
|
-
}, s =
|
|
2311
|
+
}, s = qt(r);
|
|
2257
2312
|
return s && (o.parameter = s), o;
|
|
2258
2313
|
});
|
|
2259
2314
|
}(e, n)), a = function(e, t, n) {
|
|
@@ -2270,7 +2325,7 @@ function vt(e, t, n, r) {
|
|
|
2270
2325
|
}
|
|
2271
2326
|
}), r;
|
|
2272
2327
|
}(e, t, n), o = e.flatMap((e) => function(e, t) {
|
|
2273
|
-
let n = new
|
|
2328
|
+
let n = new Zt();
|
|
2274
2329
|
return e.accept(n), n.alternations.flatMap((n) => n.definition.length > 255 ? [{
|
|
2275
2330
|
message: t.buildTooManyAlternativesError({
|
|
2276
2331
|
topLevelRule: e,
|
|
@@ -2297,13 +2352,13 @@ function vt(e, t, n, r) {
|
|
|
2297
2352
|
}(t, e, r, n));
|
|
2298
2353
|
return i.concat(a, o, s);
|
|
2299
2354
|
}
|
|
2300
|
-
function
|
|
2301
|
-
return `${
|
|
2355
|
+
function Kt(e) {
|
|
2356
|
+
return `${V(e)}_#_${e.idx}_#_${qt(e)}`;
|
|
2302
2357
|
}
|
|
2303
|
-
function
|
|
2304
|
-
return e instanceof
|
|
2358
|
+
function qt(e) {
|
|
2359
|
+
return e instanceof z ? e.terminalType.name : e instanceof A ? e.nonTerminalName : "";
|
|
2305
2360
|
}
|
|
2306
|
-
var
|
|
2361
|
+
var Jt = class extends se {
|
|
2307
2362
|
constructor() {
|
|
2308
2363
|
super(...arguments), this.allProductions = [];
|
|
2309
2364
|
}
|
|
@@ -2332,8 +2387,8 @@ var xt = class extends y {
|
|
|
2332
2387
|
this.allProductions.push(e);
|
|
2333
2388
|
}
|
|
2334
2389
|
};
|
|
2335
|
-
function
|
|
2336
|
-
let i = [], a =
|
|
2390
|
+
function Yt(e, t, n, r = []) {
|
|
2391
|
+
let i = [], a = Xt(t.definition);
|
|
2337
2392
|
if (a.length === 0) return [];
|
|
2338
2393
|
{
|
|
2339
2394
|
let t = e.name;
|
|
@@ -2347,27 +2402,27 @@ function St(e, t, n, r = []) {
|
|
|
2347
2402
|
});
|
|
2348
2403
|
let o = r.concat([e]), s = a.filter((e) => !o.includes(e)).flatMap((t) => {
|
|
2349
2404
|
let i = [...r];
|
|
2350
|
-
return i.push(t),
|
|
2405
|
+
return i.push(t), Yt(e, t, n, i);
|
|
2351
2406
|
});
|
|
2352
2407
|
return i.concat(s);
|
|
2353
2408
|
}
|
|
2354
2409
|
}
|
|
2355
|
-
function
|
|
2410
|
+
function Xt(e) {
|
|
2356
2411
|
let t = [];
|
|
2357
2412
|
if (e.length === 0) return t;
|
|
2358
2413
|
let n = e[0];
|
|
2359
|
-
if (n instanceof
|
|
2360
|
-
else if (n instanceof
|
|
2361
|
-
else if (n instanceof
|
|
2362
|
-
else if (!(n instanceof
|
|
2363
|
-
let r =
|
|
2414
|
+
if (n instanceof A) t.push(n.referencedRule);
|
|
2415
|
+
else if (n instanceof M || n instanceof N || n instanceof P || n instanceof F || n instanceof L || n instanceof I) t = t.concat(Xt(n.definition));
|
|
2416
|
+
else if (n instanceof R) t = n.definition.map((e) => Xt(e.definition)).flat();
|
|
2417
|
+
else if (!(n instanceof z)) throw Error("non exhaustive match");
|
|
2418
|
+
let r = ce(n), i = e.length > 1;
|
|
2364
2419
|
if (r && i) {
|
|
2365
2420
|
let n = e.slice(1);
|
|
2366
|
-
return t.concat(
|
|
2421
|
+
return t.concat(Xt(n));
|
|
2367
2422
|
}
|
|
2368
2423
|
return t;
|
|
2369
2424
|
}
|
|
2370
|
-
var
|
|
2425
|
+
var Zt = class extends se {
|
|
2371
2426
|
constructor() {
|
|
2372
2427
|
super(...arguments), this.alternations = [];
|
|
2373
2428
|
}
|
|
@@ -2375,159 +2430,160 @@ var wt = class extends y {
|
|
|
2375
2430
|
this.alternations.push(e);
|
|
2376
2431
|
}
|
|
2377
2432
|
};
|
|
2378
|
-
function
|
|
2379
|
-
let n = new
|
|
2433
|
+
function Qt(e, t) {
|
|
2434
|
+
let n = new Zt();
|
|
2380
2435
|
return e.accept(n), n.alternations.flatMap((n) => n.definition.slice(0, -1).flatMap((r, i) => function(e, t, n, r) {
|
|
2381
|
-
let i = "EXIT_NONE_TERMINAL", a = [i], o = "EXIT_ALTERNATIVE",
|
|
2382
|
-
for (
|
|
2436
|
+
let i = "EXIT_NONE_TERMINAL", a = [i], o = "EXIT_ALTERNATIVE", s = !1, c = t.length, l = c - r - 1, u = [], d = [];
|
|
2437
|
+
for (d.push({
|
|
2383
2438
|
idx: -1,
|
|
2384
2439
|
def: e,
|
|
2385
2440
|
ruleStack: [],
|
|
2386
2441
|
occurrenceStack: []
|
|
2387
|
-
});
|
|
2388
|
-
let e =
|
|
2442
|
+
}); d.length !== 0;) {
|
|
2443
|
+
let e = d.pop();
|
|
2389
2444
|
if (e === o) {
|
|
2390
|
-
|
|
2445
|
+
s && d.at(-1).idx <= l && d.pop();
|
|
2391
2446
|
continue;
|
|
2392
2447
|
}
|
|
2393
|
-
let r = e.def,
|
|
2448
|
+
let r = e.def, f = e.idx, p = e.ruleStack, m = e.occurrenceStack;
|
|
2394
2449
|
if (r.length === 0) continue;
|
|
2395
|
-
let
|
|
2396
|
-
if (
|
|
2450
|
+
let h = r[0];
|
|
2451
|
+
if (h === i) {
|
|
2397
2452
|
let e = {
|
|
2398
|
-
idx:
|
|
2453
|
+
idx: f,
|
|
2399
2454
|
def: r.slice(1),
|
|
2400
|
-
ruleStack:
|
|
2401
|
-
occurrenceStack:
|
|
2455
|
+
ruleStack: p.slice(0, -1),
|
|
2456
|
+
occurrenceStack: m.slice(0, -1)
|
|
2402
2457
|
};
|
|
2403
|
-
|
|
2404
|
-
} else if (
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2458
|
+
d.push(e);
|
|
2459
|
+
} else if (h instanceof z) {
|
|
2460
|
+
if (f < c - 1) {
|
|
2461
|
+
let e = f + 1;
|
|
2462
|
+
if (n(t[e], h.terminalType)) {
|
|
2463
|
+
let t = {
|
|
2464
|
+
idx: e,
|
|
2465
|
+
def: r.slice(1),
|
|
2466
|
+
ruleStack: p,
|
|
2467
|
+
occurrenceStack: m
|
|
2468
|
+
};
|
|
2469
|
+
d.push(t);
|
|
2470
|
+
}
|
|
2471
|
+
} else {
|
|
2472
|
+
if (f !== c - 1) throw Error("non exhaustive match");
|
|
2473
|
+
u.push({
|
|
2474
|
+
nextTokenType: h.terminalType,
|
|
2475
|
+
nextTokenOccurrence: h.idx,
|
|
2476
|
+
ruleStack: p,
|
|
2477
|
+
occurrenceStack: m
|
|
2478
|
+
}), s = !0;
|
|
2414
2479
|
}
|
|
2415
|
-
} else {
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
ruleStack: C,
|
|
2421
|
-
occurrenceStack: w
|
|
2422
|
-
}), _ = !0;
|
|
2423
|
-
}
|
|
2424
|
-
else if (T instanceof s) {
|
|
2425
|
-
let e = [...C];
|
|
2426
|
-
e.push(T.nonTerminalName);
|
|
2427
|
-
let t = [...w];
|
|
2428
|
-
t.push(T.idx);
|
|
2480
|
+
} else if (h instanceof A) {
|
|
2481
|
+
let e = [...p];
|
|
2482
|
+
e.push(h.nonTerminalName);
|
|
2483
|
+
let t = [...m];
|
|
2484
|
+
t.push(h.idx);
|
|
2429
2485
|
let n = {
|
|
2430
|
-
idx:
|
|
2431
|
-
def:
|
|
2486
|
+
idx: f,
|
|
2487
|
+
def: h.definition.concat(a, r.slice(1)),
|
|
2432
2488
|
ruleStack: e,
|
|
2433
2489
|
occurrenceStack: t
|
|
2434
2490
|
};
|
|
2435
|
-
|
|
2436
|
-
} else if (
|
|
2491
|
+
d.push(n);
|
|
2492
|
+
} else if (h instanceof N) {
|
|
2437
2493
|
let e = {
|
|
2438
|
-
idx:
|
|
2494
|
+
idx: f,
|
|
2439
2495
|
def: r.slice(1),
|
|
2440
|
-
ruleStack:
|
|
2441
|
-
occurrenceStack:
|
|
2496
|
+
ruleStack: p,
|
|
2497
|
+
occurrenceStack: m
|
|
2442
2498
|
};
|
|
2443
|
-
|
|
2499
|
+
d.push(e), d.push(o);
|
|
2444
2500
|
let t = {
|
|
2445
|
-
idx:
|
|
2446
|
-
def:
|
|
2447
|
-
ruleStack:
|
|
2448
|
-
occurrenceStack:
|
|
2501
|
+
idx: f,
|
|
2502
|
+
def: h.definition.concat(r.slice(1)),
|
|
2503
|
+
ruleStack: p,
|
|
2504
|
+
occurrenceStack: m
|
|
2449
2505
|
};
|
|
2450
|
-
|
|
2451
|
-
} else if (
|
|
2452
|
-
let e = new
|
|
2453
|
-
definition:
|
|
2454
|
-
idx:
|
|
2506
|
+
d.push(t);
|
|
2507
|
+
} else if (h instanceof P) {
|
|
2508
|
+
let e = new I({
|
|
2509
|
+
definition: h.definition,
|
|
2510
|
+
idx: h.idx
|
|
2455
2511
|
}), t = {
|
|
2456
|
-
idx:
|
|
2457
|
-
def:
|
|
2458
|
-
ruleStack:
|
|
2459
|
-
occurrenceStack:
|
|
2512
|
+
idx: f,
|
|
2513
|
+
def: h.definition.concat([e], r.slice(1)),
|
|
2514
|
+
ruleStack: p,
|
|
2515
|
+
occurrenceStack: m
|
|
2460
2516
|
};
|
|
2461
|
-
|
|
2462
|
-
} else if (
|
|
2463
|
-
let e = new
|
|
2464
|
-
definition: [new
|
|
2465
|
-
idx:
|
|
2517
|
+
d.push(t);
|
|
2518
|
+
} else if (h instanceof F) {
|
|
2519
|
+
let e = new I({
|
|
2520
|
+
definition: [new z({ terminalType: h.separator })].concat(h.definition),
|
|
2521
|
+
idx: h.idx
|
|
2466
2522
|
}), t = {
|
|
2467
|
-
idx:
|
|
2468
|
-
def:
|
|
2469
|
-
ruleStack:
|
|
2470
|
-
occurrenceStack:
|
|
2523
|
+
idx: f,
|
|
2524
|
+
def: h.definition.concat([e], r.slice(1)),
|
|
2525
|
+
ruleStack: p,
|
|
2526
|
+
occurrenceStack: m
|
|
2471
2527
|
};
|
|
2472
|
-
|
|
2473
|
-
} else if (
|
|
2528
|
+
d.push(t);
|
|
2529
|
+
} else if (h instanceof L) {
|
|
2474
2530
|
let e = {
|
|
2475
|
-
idx:
|
|
2531
|
+
idx: f,
|
|
2476
2532
|
def: r.slice(1),
|
|
2477
|
-
ruleStack:
|
|
2478
|
-
occurrenceStack:
|
|
2533
|
+
ruleStack: p,
|
|
2534
|
+
occurrenceStack: m
|
|
2479
2535
|
};
|
|
2480
|
-
|
|
2481
|
-
let t = new
|
|
2482
|
-
definition: [new
|
|
2483
|
-
idx:
|
|
2536
|
+
d.push(e), d.push(o);
|
|
2537
|
+
let t = new I({
|
|
2538
|
+
definition: [new z({ terminalType: h.separator })].concat(h.definition),
|
|
2539
|
+
idx: h.idx
|
|
2484
2540
|
}), n = {
|
|
2485
|
-
idx:
|
|
2486
|
-
def:
|
|
2487
|
-
ruleStack:
|
|
2488
|
-
occurrenceStack:
|
|
2541
|
+
idx: f,
|
|
2542
|
+
def: h.definition.concat([t], r.slice(1)),
|
|
2543
|
+
ruleStack: p,
|
|
2544
|
+
occurrenceStack: m
|
|
2489
2545
|
};
|
|
2490
|
-
|
|
2491
|
-
} else if (
|
|
2546
|
+
d.push(n);
|
|
2547
|
+
} else if (h instanceof I) {
|
|
2492
2548
|
let e = {
|
|
2493
|
-
idx:
|
|
2549
|
+
idx: f,
|
|
2494
2550
|
def: r.slice(1),
|
|
2495
|
-
ruleStack:
|
|
2496
|
-
occurrenceStack:
|
|
2551
|
+
ruleStack: p,
|
|
2552
|
+
occurrenceStack: m
|
|
2497
2553
|
};
|
|
2498
|
-
|
|
2499
|
-
let t = new
|
|
2500
|
-
definition:
|
|
2501
|
-
idx:
|
|
2554
|
+
d.push(e), d.push(o);
|
|
2555
|
+
let t = new I({
|
|
2556
|
+
definition: h.definition,
|
|
2557
|
+
idx: h.idx
|
|
2502
2558
|
}), n = {
|
|
2503
|
-
idx:
|
|
2504
|
-
def:
|
|
2505
|
-
ruleStack:
|
|
2506
|
-
occurrenceStack:
|
|
2559
|
+
idx: f,
|
|
2560
|
+
def: h.definition.concat([t], r.slice(1)),
|
|
2561
|
+
ruleStack: p,
|
|
2562
|
+
occurrenceStack: m
|
|
2507
2563
|
};
|
|
2508
|
-
|
|
2509
|
-
} else if (
|
|
2564
|
+
d.push(n);
|
|
2565
|
+
} else if (h instanceof R) for (let e = h.definition.length - 1; e >= 0; e--) {
|
|
2510
2566
|
let t = {
|
|
2511
|
-
idx:
|
|
2512
|
-
def:
|
|
2513
|
-
ruleStack:
|
|
2514
|
-
occurrenceStack:
|
|
2567
|
+
idx: f,
|
|
2568
|
+
def: h.definition[e].definition.concat(r.slice(1)),
|
|
2569
|
+
ruleStack: p,
|
|
2570
|
+
occurrenceStack: m
|
|
2515
2571
|
};
|
|
2516
|
-
|
|
2572
|
+
d.push(t), d.push(o);
|
|
2517
2573
|
}
|
|
2518
|
-
else if (
|
|
2519
|
-
idx:
|
|
2520
|
-
def:
|
|
2521
|
-
ruleStack:
|
|
2522
|
-
occurrenceStack:
|
|
2574
|
+
else if (h instanceof M) d.push({
|
|
2575
|
+
idx: f,
|
|
2576
|
+
def: h.definition.concat(r.slice(1)),
|
|
2577
|
+
ruleStack: p,
|
|
2578
|
+
occurrenceStack: m
|
|
2523
2579
|
});
|
|
2524
2580
|
else {
|
|
2525
|
-
if (!(
|
|
2526
|
-
|
|
2581
|
+
if (!(h instanceof j)) throw Error("non exhaustive match");
|
|
2582
|
+
d.push(jt(h, f, p, m));
|
|
2527
2583
|
}
|
|
2528
2584
|
}
|
|
2529
|
-
return
|
|
2530
|
-
}([r], [],
|
|
2585
|
+
return u;
|
|
2586
|
+
}([r], [], Xe, 1).length === 0 ? [{
|
|
2531
2587
|
message: t.buildEmptyAlternationError({
|
|
2532
2588
|
topLevelRule: e,
|
|
2533
2589
|
alternation: n,
|
|
@@ -2539,18 +2595,18 @@ function Tt(e, t) {
|
|
|
2539
2595
|
alternative: i + 1
|
|
2540
2596
|
}] : []));
|
|
2541
2597
|
}
|
|
2542
|
-
function
|
|
2543
|
-
let r = new
|
|
2598
|
+
function $t(e, t, n) {
|
|
2599
|
+
let r = new Zt();
|
|
2544
2600
|
e.accept(r);
|
|
2545
2601
|
let i = r.alternations;
|
|
2546
2602
|
return i = i.filter((e) => !0 !== e.ignoreAmbiguities), i.flatMap((r) => {
|
|
2547
|
-
let i =
|
|
2603
|
+
let i = r.idx, a = Vt(i, e, r.maxLookahead || t, r), o = function(e, t, n, r) {
|
|
2548
2604
|
let i = [];
|
|
2549
2605
|
return e.reduce((n, r, a) => (!0 === t.definition[a].ignoreAmbiguities || r.forEach((r) => {
|
|
2550
2606
|
let o = [a];
|
|
2551
2607
|
e.forEach((e, n) => {
|
|
2552
|
-
a !== n &&
|
|
2553
|
-
}), o.length > 1 && !
|
|
2608
|
+
a !== n && Ut(e, r) && !0 !== t.definition[n].ignoreAmbiguities && o.push(n);
|
|
2609
|
+
}), o.length > 1 && !Ut(i, r) && (i.push(r), n.push({
|
|
2554
2610
|
alts: o,
|
|
2555
2611
|
path: r
|
|
2556
2612
|
}));
|
|
@@ -2569,7 +2625,7 @@ function Et(e, t, n) {
|
|
|
2569
2625
|
alternatives: e.alts
|
|
2570
2626
|
};
|
|
2571
2627
|
});
|
|
2572
|
-
}(
|
|
2628
|
+
}(a, r, e, n), s = function(e, t, n, r) {
|
|
2573
2629
|
let i = e.reduce((e, t, n) => {
|
|
2574
2630
|
let r = t.map((e) => ({
|
|
2575
2631
|
idx: n,
|
|
@@ -2602,11 +2658,11 @@ function Et(e, t, n) {
|
|
|
2602
2658
|
};
|
|
2603
2659
|
});
|
|
2604
2660
|
});
|
|
2605
|
-
}(
|
|
2606
|
-
return
|
|
2661
|
+
}(a, r, e, n);
|
|
2662
|
+
return o.concat(s);
|
|
2607
2663
|
});
|
|
2608
2664
|
}
|
|
2609
|
-
var
|
|
2665
|
+
var en = class extends se {
|
|
2610
2666
|
constructor() {
|
|
2611
2667
|
super(...arguments), this.allProductions = [];
|
|
2612
2668
|
}
|
|
@@ -2623,64 +2679,61 @@ var Dt = class extends y {
|
|
|
2623
2679
|
this.allProductions.push(e);
|
|
2624
2680
|
}
|
|
2625
2681
|
};
|
|
2626
|
-
function
|
|
2627
|
-
let t = Object.assign({ errMsgProvider:
|
|
2682
|
+
function tn(e) {
|
|
2683
|
+
let t = Object.assign({ errMsgProvider: bt }, e), n = {};
|
|
2628
2684
|
return e.rules.forEach((e) => {
|
|
2629
2685
|
n[e.name] = e;
|
|
2630
2686
|
}), function(e, t) {
|
|
2631
|
-
let n = new
|
|
2687
|
+
let n = new St(e, t);
|
|
2632
2688
|
return n.resolveRefs(), n.errors;
|
|
2633
2689
|
}(n, t.errMsgProvider);
|
|
2634
2690
|
}
|
|
2635
|
-
var
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2691
|
+
var nn = "MismatchedTokenException", rn = "NoViableAltException", an = "EarlyExitException", on = "NotAllInputParsedException", sn = [
|
|
2692
|
+
nn,
|
|
2693
|
+
rn,
|
|
2694
|
+
an,
|
|
2695
|
+
on
|
|
2640
2696
|
];
|
|
2641
|
-
function
|
|
2642
|
-
return
|
|
2697
|
+
function cn(e) {
|
|
2698
|
+
return sn.includes(e.name);
|
|
2643
2699
|
}
|
|
2644
|
-
Object.freeze(
|
|
2645
|
-
var
|
|
2700
|
+
Object.freeze(sn);
|
|
2701
|
+
var ln = class extends Error {
|
|
2646
2702
|
constructor(e, t) {
|
|
2647
2703
|
super(e), this.token = t, this.resyncedTokens = [], Object.setPrototypeOf(this, new.target.prototype), Error.captureStackTrace && Error.captureStackTrace(this, this.constructor);
|
|
2648
2704
|
}
|
|
2649
|
-
},
|
|
2705
|
+
}, un = class extends ln {
|
|
2650
2706
|
constructor(e, t, n) {
|
|
2651
|
-
super(e, t), this.previousToken = n, this.name =
|
|
2707
|
+
super(e, t), this.previousToken = n, this.name = nn;
|
|
2652
2708
|
}
|
|
2653
|
-
},
|
|
2709
|
+
}, dn = class extends ln {
|
|
2654
2710
|
constructor(e, t, n) {
|
|
2655
|
-
super(e, t), this.previousToken = n, this.name =
|
|
2711
|
+
super(e, t), this.previousToken = n, this.name = rn;
|
|
2656
2712
|
}
|
|
2657
|
-
},
|
|
2713
|
+
}, fn = class extends ln {
|
|
2658
2714
|
constructor(e, t) {
|
|
2659
|
-
super(e, t), this.name =
|
|
2715
|
+
super(e, t), this.name = on;
|
|
2660
2716
|
}
|
|
2661
|
-
},
|
|
2717
|
+
}, pn = class extends ln {
|
|
2662
2718
|
constructor(e, t, n) {
|
|
2663
|
-
super(e, t), this.previousToken = n, this.name =
|
|
2719
|
+
super(e, t), this.previousToken = n, this.name = an;
|
|
2664
2720
|
}
|
|
2665
|
-
},
|
|
2721
|
+
}, mn = {}, hn = class extends Error {
|
|
2666
2722
|
constructor(e) {
|
|
2667
2723
|
super(e), this.name = "InRuleRecoveryException";
|
|
2668
2724
|
}
|
|
2669
2725
|
};
|
|
2670
|
-
function
|
|
2671
|
-
|
|
2672
|
-
|
|
2726
|
+
function gn(e, t, n, r, i, a, o) {
|
|
2727
|
+
var s, c;
|
|
2728
|
+
let l = r | i, u = (s = this.firstAfterRepMap)[c = this.currRuleShortName] ?? (s[c] = []), d = u[l];
|
|
2729
|
+
if (d === void 0) {
|
|
2673
2730
|
let e = this.getCurrRuleFullName();
|
|
2674
|
-
|
|
2731
|
+
d = new a(this.getGAstProductions()[e], i).startWalking(), u[l] = d;
|
|
2675
2732
|
}
|
|
2676
|
-
let
|
|
2677
|
-
this.RULE_STACK_IDX === 0 &&
|
|
2678
|
-
}
|
|
2679
|
-
var Ut = 1024, Wt = 1280, Gt = 1536;
|
|
2680
|
-
function Kt(e, t, n) {
|
|
2681
|
-
return n | t | e;
|
|
2733
|
+
let f = d.token, p = d.occurrence, m = d.isEndOfRule;
|
|
2734
|
+
this.RULE_STACK_IDX === 0 && m && f === void 0 && (f = X, p = 1), f !== void 0 && p !== void 0 && this.shouldInRepetitionRecoveryBeTried(f, p, o) && this.tryInRepetitionRecovery(e, t, n, f);
|
|
2682
2735
|
}
|
|
2683
|
-
var
|
|
2736
|
+
var _n = 1024, vn = 1280, yn = 1536, bn = class {
|
|
2684
2737
|
constructor(e) {
|
|
2685
2738
|
this.maxLookahead = e?.maxLookahead ?? $.maxLookahead;
|
|
2686
2739
|
}
|
|
@@ -2698,22 +2751,22 @@ var qt = class {
|
|
|
2698
2751
|
return t;
|
|
2699
2752
|
}
|
|
2700
2753
|
validateNoLeftRecursion(e) {
|
|
2701
|
-
return e.flatMap((e) =>
|
|
2754
|
+
return e.flatMap((e) => Yt(e, e, xt));
|
|
2702
2755
|
}
|
|
2703
2756
|
validateEmptyOrAlternatives(e) {
|
|
2704
|
-
return e.flatMap((e) =>
|
|
2757
|
+
return e.flatMap((e) => Qt(e, xt));
|
|
2705
2758
|
}
|
|
2706
2759
|
validateAmbiguousAlternationAlternatives(e, t) {
|
|
2707
|
-
return e.flatMap((e) =>
|
|
2760
|
+
return e.flatMap((e) => $t(e, t, xt));
|
|
2708
2761
|
}
|
|
2709
2762
|
validateSomeNonEmptyLookaheadPath(e, t) {
|
|
2710
2763
|
return function(e, t, n) {
|
|
2711
2764
|
let r = [];
|
|
2712
2765
|
return e.forEach((e) => {
|
|
2713
|
-
let i = new
|
|
2766
|
+
let i = new en();
|
|
2714
2767
|
e.accept(i), i.allProductions.forEach((i) => {
|
|
2715
|
-
let a =
|
|
2716
|
-
if (
|
|
2768
|
+
let a = Mt(i), o = i.maxLookahead || t;
|
|
2769
|
+
if (Ht(i.idx, e, a, o)[0].flat().length === 0) {
|
|
2717
2770
|
let t = n.buildEmptyRepetitionError({
|
|
2718
2771
|
topLevelRule: e,
|
|
2719
2772
|
repetition: i
|
|
@@ -2726,21 +2779,21 @@ var qt = class {
|
|
|
2726
2779
|
}
|
|
2727
2780
|
});
|
|
2728
2781
|
}), r;
|
|
2729
|
-
}(e, t,
|
|
2782
|
+
}(e, t, xt);
|
|
2730
2783
|
}
|
|
2731
2784
|
buildLookaheadForAlternation(e) {
|
|
2732
2785
|
return function(e, t, n, r, i, a) {
|
|
2733
|
-
let o =
|
|
2734
|
-
return a(o, r,
|
|
2735
|
-
}(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled,
|
|
2786
|
+
let o = Vt(e, t, n);
|
|
2787
|
+
return a(o, r, Wt(o) ? Ze : Xe, i);
|
|
2788
|
+
}(e.prodOccurrence, e.rule, e.maxLookahead, e.hasPredicates, e.dynamicTokensEnabled, Nt);
|
|
2736
2789
|
}
|
|
2737
2790
|
buildLookaheadForOptional(e) {
|
|
2738
2791
|
return function(e, t, n, r, i, a) {
|
|
2739
|
-
let o =
|
|
2792
|
+
let o = Ht(e, t, i, n), s = Wt(o) ? Ze : Xe;
|
|
2740
2793
|
return a(o[0], s, r);
|
|
2741
|
-
}(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled,
|
|
2794
|
+
}(e.prodOccurrence, e.rule, e.maxLookahead, e.dynamicTokensEnabled, Mt(e.prodType), Pt);
|
|
2742
2795
|
}
|
|
2743
|
-
},
|
|
2796
|
+
}, xn = new class extends se {
|
|
2744
2797
|
constructor() {
|
|
2745
2798
|
super(...arguments), this.dslMethods = {
|
|
2746
2799
|
option: [],
|
|
@@ -2780,14 +2833,14 @@ var qt = class {
|
|
|
2780
2833
|
this.dslMethods.alternation.push(e);
|
|
2781
2834
|
}
|
|
2782
2835
|
}();
|
|
2783
|
-
function
|
|
2836
|
+
function Sn(e, t) {
|
|
2784
2837
|
e.startOffset === -1 ? (e.startOffset = t.startOffset, e.endOffset = t.endOffset) : e.endOffset < t.endOffset == 1 && (e.endOffset = t.endOffset);
|
|
2785
2838
|
}
|
|
2786
|
-
function
|
|
2839
|
+
function Cn(e, t) {
|
|
2787
2840
|
e.startOffset === -1 ? (e.startOffset = t.startOffset, e.startColumn = t.startColumn, e.startLine = t.startLine, e.endOffset = t.endOffset, e.endColumn = t.endColumn, e.endLine = t.endLine) : e.endOffset < t.endOffset == 1 && (e.endOffset = t.endOffset, e.endColumn = t.endColumn, e.endLine = t.endLine);
|
|
2788
2841
|
}
|
|
2789
|
-
var
|
|
2790
|
-
function
|
|
2842
|
+
var wn;
|
|
2843
|
+
function Tn(e, t) {
|
|
2791
2844
|
Object.defineProperty(e, "name", {
|
|
2792
2845
|
enumerable: !1,
|
|
2793
2846
|
configurable: !0,
|
|
@@ -2795,7 +2848,7 @@ function Qt(e, t) {
|
|
|
2795
2848
|
value: t
|
|
2796
2849
|
});
|
|
2797
2850
|
}
|
|
2798
|
-
function
|
|
2851
|
+
function En(e, t) {
|
|
2799
2852
|
let n = Object.keys(e), r = n.length;
|
|
2800
2853
|
for (let i = 0; i < r; i++) {
|
|
2801
2854
|
let r = e[n[i]], a = r.length;
|
|
@@ -2805,9 +2858,9 @@ function $t(e, t) {
|
|
|
2805
2858
|
}
|
|
2806
2859
|
}
|
|
2807
2860
|
}
|
|
2808
|
-
function
|
|
2861
|
+
function Dn(e, t) {
|
|
2809
2862
|
let n = function() {};
|
|
2810
|
-
return
|
|
2863
|
+
return Tn(n, e + "BaseSemantics"), n.prototype = {
|
|
2811
2864
|
visit: function(e, t) {
|
|
2812
2865
|
if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
|
|
2813
2866
|
},
|
|
@@ -2816,7 +2869,7 @@ function en(e, t) {
|
|
|
2816
2869
|
return function(e, t) {
|
|
2817
2870
|
return t.filter((t) => typeof e[t] == "function" == 0).map((t) => ({
|
|
2818
2871
|
msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
|
|
2819
|
-
type:
|
|
2872
|
+
type: wn.MISSING_METHOD,
|
|
2820
2873
|
methodName: t
|
|
2821
2874
|
})).filter(Boolean);
|
|
2822
2875
|
}(e, t);
|
|
@@ -2830,68 +2883,68 @@ function en(e, t) {
|
|
|
2830
2883
|
}
|
|
2831
2884
|
(function(e) {
|
|
2832
2885
|
e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
|
|
2833
|
-
})(
|
|
2834
|
-
var
|
|
2835
|
-
Object.freeze(
|
|
2836
|
-
var
|
|
2886
|
+
})(wn ||= {});
|
|
2887
|
+
var On = { description: "This Object indicates the Parser is during Recording Phase" };
|
|
2888
|
+
Object.freeze(On);
|
|
2889
|
+
var kn = !0, An = Y({
|
|
2837
2890
|
name: "RECORDING_PHASE_TOKEN",
|
|
2838
|
-
pattern:
|
|
2891
|
+
pattern: J.NA
|
|
2839
2892
|
});
|
|
2840
|
-
|
|
2841
|
-
var
|
|
2842
|
-
Object.freeze(
|
|
2843
|
-
var
|
|
2893
|
+
et([An]);
|
|
2894
|
+
var jn = vt(An, "This IToken indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details", -1, -1, -1, -1, -1, -1);
|
|
2895
|
+
Object.freeze(jn);
|
|
2896
|
+
var Mn = {
|
|
2844
2897
|
name: "This CSTNode indicates the Parser is in Recording Phase\n See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details",
|
|
2845
2898
|
children: {}
|
|
2846
2899
|
};
|
|
2847
|
-
function
|
|
2848
|
-
|
|
2900
|
+
function Nn(e, t, n, r = !1) {
|
|
2901
|
+
In(n);
|
|
2849
2902
|
let i = this.recordingProdStack.at(-1), a = typeof t == "function" ? t : t.DEF, o = new e({
|
|
2850
2903
|
definition: [],
|
|
2851
2904
|
idx: n
|
|
2852
2905
|
});
|
|
2853
|
-
return r && (o.separator = t.SEP), Object.hasOwn(t, "MAX_LOOKAHEAD") && (o.maxLookahead = t.MAX_LOOKAHEAD), this.recordingProdStack.push(o), a.call(this), i.definition.push(o), this.recordingProdStack.pop(),
|
|
2906
|
+
return r && (o.separator = t.SEP), Object.hasOwn(t, "MAX_LOOKAHEAD") && (o.maxLookahead = t.MAX_LOOKAHEAD), this.recordingProdStack.push(o), a.call(this), i.definition.push(o), this.recordingProdStack.pop(), On;
|
|
2854
2907
|
}
|
|
2855
|
-
function
|
|
2856
|
-
|
|
2857
|
-
let n = this.recordingProdStack.at(-1), r = !1 === Array.isArray(e), i = !1 === r ? e : e.DEF, a = new
|
|
2908
|
+
function Pn(e, t) {
|
|
2909
|
+
In(t);
|
|
2910
|
+
let n = this.recordingProdStack.at(-1), r = !1 === Array.isArray(e), i = !1 === r ? e : e.DEF, a = new R({
|
|
2858
2911
|
definition: [],
|
|
2859
2912
|
idx: t,
|
|
2860
2913
|
ignoreAmbiguities: r && !0 === e.IGNORE_AMBIGUITIES
|
|
2861
2914
|
});
|
|
2862
2915
|
return Object.hasOwn(e, "MAX_LOOKAHEAD") && (a.maxLookahead = e.MAX_LOOKAHEAD), a.hasPredicates = i.some((e) => typeof e.GATE == "function"), n.definition.push(a), i.forEach((e) => {
|
|
2863
|
-
let t = new
|
|
2916
|
+
let t = new M({ definition: [] });
|
|
2864
2917
|
a.definition.push(t), Object.hasOwn(e, "IGNORE_AMBIGUITIES") ? t.ignoreAmbiguities = e.IGNORE_AMBIGUITIES : Object.hasOwn(e, "GATE") && (t.ignoreAmbiguities = !0), this.recordingProdStack.push(t), e.ALT.call(this), this.recordingProdStack.pop();
|
|
2865
|
-
}),
|
|
2918
|
+
}), On;
|
|
2866
2919
|
}
|
|
2867
|
-
function
|
|
2920
|
+
function Fn(e) {
|
|
2868
2921
|
return e === 0 ? "" : `${e}`;
|
|
2869
2922
|
}
|
|
2870
|
-
function
|
|
2871
|
-
if (e < 0 || e >
|
|
2872
|
-
let t = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than
|
|
2923
|
+
function In(e) {
|
|
2924
|
+
if (e < 0 || e > 255) {
|
|
2925
|
+
let t = /* @__PURE__ */ Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than 256`);
|
|
2873
2926
|
throw t.KNOWN_RECORDER_ERROR = !0, t;
|
|
2874
2927
|
}
|
|
2875
2928
|
}
|
|
2876
|
-
var
|
|
2877
|
-
Object.freeze(
|
|
2929
|
+
var Ln = vt(X, "", -1, -1, -1, -1, -1, -1);
|
|
2930
|
+
Object.freeze(Ln);
|
|
2878
2931
|
var Q, $ = Object.freeze({
|
|
2879
2932
|
recoveryEnabled: !1,
|
|
2880
2933
|
maxLookahead: 3,
|
|
2881
2934
|
dynamicTokensEnabled: !1,
|
|
2882
2935
|
outputCst: !0,
|
|
2883
|
-
errorMessageProvider:
|
|
2936
|
+
errorMessageProvider: yt,
|
|
2884
2937
|
nodeLocationTracking: "none",
|
|
2885
2938
|
traceInitPerf: !1,
|
|
2886
2939
|
skipValidations: !1
|
|
2887
|
-
}),
|
|
2940
|
+
}), Rn = Object.freeze({
|
|
2888
2941
|
recoveryValueFunc: () => {},
|
|
2889
2942
|
resyncEnabled: !0
|
|
2890
2943
|
});
|
|
2891
2944
|
(function(e) {
|
|
2892
2945
|
e[e.INVALID_RULE_NAME = 0] = "INVALID_RULE_NAME", e[e.DUPLICATE_RULE_NAME = 1] = "DUPLICATE_RULE_NAME", e[e.INVALID_RULE_OVERRIDE = 2] = "INVALID_RULE_OVERRIDE", e[e.DUPLICATE_PRODUCTIONS = 3] = "DUPLICATE_PRODUCTIONS", e[e.UNRESOLVED_SUBRULE_REF = 4] = "UNRESOLVED_SUBRULE_REF", e[e.LEFT_RECURSION = 5] = "LEFT_RECURSION", e[e.NONE_LAST_EMPTY_ALT = 6] = "NONE_LAST_EMPTY_ALT", e[e.AMBIGUOUS_ALTS = 7] = "AMBIGUOUS_ALTS", e[e.CONFLICT_TOKENS_RULES_NAMESPACE = 8] = "CONFLICT_TOKENS_RULES_NAMESPACE", e[e.INVALID_TOKEN_NAME = 9] = "INVALID_TOKEN_NAME", e[e.NO_NON_EMPTY_LOOKAHEAD = 10] = "NO_NON_EMPTY_LOOKAHEAD", e[e.AMBIGUOUS_PREFIX_ALTS = 11] = "AMBIGUOUS_PREFIX_ALTS", e[e.TOO_MANY_ALTS = 12] = "TOO_MANY_ALTS", e[e.CUSTOM_LOOKAHEAD_VALIDATION = 13] = "CUSTOM_LOOKAHEAD_VALIDATION";
|
|
2893
2946
|
})(Q ||= {});
|
|
2894
|
-
var
|
|
2947
|
+
var zn, Bn = class e {
|
|
2895
2948
|
static performSelfAnalysis(e) {
|
|
2896
2949
|
throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.");
|
|
2897
2950
|
}
|
|
@@ -2901,7 +2954,7 @@ var fn, pn = class e {
|
|
|
2901
2954
|
this.selfAnalysisDone = !0;
|
|
2902
2955
|
let n = this.className;
|
|
2903
2956
|
this.TRACE_INIT("toFastProps", () => {
|
|
2904
|
-
|
|
2957
|
+
O(this);
|
|
2905
2958
|
}), this.TRACE_INIT("Grammar Recording", () => {
|
|
2906
2959
|
try {
|
|
2907
2960
|
this.enableRecording(), this.definedRulesNames.forEach((e) => {
|
|
@@ -2916,16 +2969,16 @@ var fn, pn = class e {
|
|
|
2916
2969
|
});
|
|
2917
2970
|
let r = [];
|
|
2918
2971
|
if (this.TRACE_INIT("Grammar Resolving", () => {
|
|
2919
|
-
r =
|
|
2972
|
+
r = tn({ rules: Object.values(this.gastProductionsCache) }), this.definitionErrors = this.definitionErrors.concat(r);
|
|
2920
2973
|
}), this.TRACE_INIT("Grammar Validations", () => {
|
|
2921
2974
|
if (r.length === 0 && !1 === this.skipValidations) {
|
|
2922
2975
|
let t = function(e) {
|
|
2923
|
-
let t = e.errMsgProvider ??
|
|
2924
|
-
return
|
|
2976
|
+
let t = e.errMsgProvider ?? xt;
|
|
2977
|
+
return Gt(e.rules, e.tokenTypes, t, e.grammarName);
|
|
2925
2978
|
}({
|
|
2926
2979
|
rules: Object.values(this.gastProductionsCache),
|
|
2927
2980
|
tokenTypes: Object.values(this.tokensMap),
|
|
2928
|
-
errMsgProvider:
|
|
2981
|
+
errMsgProvider: xt,
|
|
2929
2982
|
grammarName: n
|
|
2930
2983
|
}), r = (e = {
|
|
2931
2984
|
lookaheadStrategy: this.lookaheadStrategy,
|
|
@@ -2944,7 +2997,7 @@ var fn, pn = class e {
|
|
|
2944
2997
|
let e = function(e) {
|
|
2945
2998
|
let t = {};
|
|
2946
2999
|
return e.forEach((e) => {
|
|
2947
|
-
let n = new
|
|
3000
|
+
let n = new pe(e).startWalking();
|
|
2948
3001
|
Object.assign(t, n);
|
|
2949
3002
|
}), t;
|
|
2950
3003
|
}(Object.values(this.gastProductionsCache));
|
|
@@ -2962,13 +3015,13 @@ var fn, pn = class e {
|
|
|
2962
3015
|
this.skipValidations = Object.hasOwn(t, "skipValidations") ? t.skipValidations : $.skipValidations;
|
|
2963
3016
|
}
|
|
2964
3017
|
};
|
|
2965
|
-
|
|
3018
|
+
Bn.DEFER_DEFINITION_ERRORS_HANDLING = !1, zn = Bn, [
|
|
2966
3019
|
class {
|
|
2967
3020
|
initRecoverable(e) {
|
|
2968
|
-
this.firstAfterRepMap =
|
|
3021
|
+
this.firstAfterRepMap = [], this.resyncFollows = {}, this.recoveryEnabled = Object.hasOwn(e, "recoveryEnabled") ? e.recoveryEnabled : $.recoveryEnabled, this.recoveryEnabled && (this.attemptInRepetitionRecovery = gn);
|
|
2969
3022
|
}
|
|
2970
3023
|
getTokenToInsert(e) {
|
|
2971
|
-
let t =
|
|
3024
|
+
let t = vt(e, "", -1, -1, -1, -1, -1, -1);
|
|
2972
3025
|
return t.isInsertedInRecovery = !0, t;
|
|
2973
3026
|
}
|
|
2974
3027
|
canTokenTypeBeInsertedInRecovery(e) {
|
|
@@ -2979,7 +3032,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
2979
3032
|
}
|
|
2980
3033
|
tryInRepetitionRecovery(e, t, n, r) {
|
|
2981
3034
|
let i = this.findReSyncTokenType(), a = this.exportLexerState(), o = [], s = !1, c = this.LA_FAST(1), l = this.LA_FAST(1), u = () => {
|
|
2982
|
-
let e = this.LA(0), t = new
|
|
3035
|
+
let e = this.LA(0), t = new un(this.errorMessageProvider.buildMismatchTokenMessage({
|
|
2983
3036
|
expected: r,
|
|
2984
3037
|
actual: c,
|
|
2985
3038
|
previous: e,
|
|
@@ -2999,7 +3052,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
2999
3052
|
}
|
|
3000
3053
|
getNextPossibleTokenTypes(e) {
|
|
3001
3054
|
let t = e.ruleStack[0], n = this.getGAstProductions()[t];
|
|
3002
|
-
return new
|
|
3055
|
+
return new wt(n, e).startWalking();
|
|
3003
3056
|
}
|
|
3004
3057
|
getFollowsForInRuleRecovery(e, t) {
|
|
3005
3058
|
let n = this.getCurrentGrammarPath(e, t);
|
|
@@ -3011,7 +3064,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3011
3064
|
let e = this.SKIP_TOKEN();
|
|
3012
3065
|
return this.consumeToken(), e;
|
|
3013
3066
|
}
|
|
3014
|
-
throw new
|
|
3067
|
+
throw new hn("sad sad panda");
|
|
3015
3068
|
}
|
|
3016
3069
|
canPerformInRuleRecovery(e, t) {
|
|
3017
3070
|
return this.canRecoverWithSingleTokenInsertion(e, t) || this.canRecoverWithSingleTokenDeletion(e);
|
|
@@ -3031,13 +3084,13 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3031
3084
|
findReSyncTokenType() {
|
|
3032
3085
|
let e = this.flattenFollowSet(), t = this.LA_FAST(1), n = 2;
|
|
3033
3086
|
for (;;) {
|
|
3034
|
-
let r = e.find((e) =>
|
|
3087
|
+
let r = e.find((e) => Xe(t, e));
|
|
3035
3088
|
if (r !== void 0) return r;
|
|
3036
3089
|
t = this.LA(n), n++;
|
|
3037
3090
|
}
|
|
3038
3091
|
}
|
|
3039
3092
|
getCurrFollowKey() {
|
|
3040
|
-
if (this.RULE_STACK_IDX === 0) return
|
|
3093
|
+
if (this.RULE_STACK_IDX === 0) return mn;
|
|
3041
3094
|
let e = this.currRuleShortName, t = this.getLastExplicitRuleOccurrenceIndex(), n = this.getPreviousExplicitRuleShortName();
|
|
3042
3095
|
return {
|
|
3043
3096
|
ruleName: this.shortRuleNameToFullName(e),
|
|
@@ -3047,7 +3100,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3047
3100
|
}
|
|
3048
3101
|
buildFullFollowKeyStack() {
|
|
3049
3102
|
let e = this.RULE_STACK, t = this.RULE_OCCURRENCE_STACK, n = this.RULE_STACK_IDX + 1, r = Array(n);
|
|
3050
|
-
for (let i = 0; i < n; i++) r[i] = i === 0 ?
|
|
3103
|
+
for (let i = 0; i < n; i++) r[i] = i === 0 ? mn : {
|
|
3051
3104
|
ruleName: this.shortRuleNameToFullName(e[i]),
|
|
3052
3105
|
idxInCallingRule: t[i],
|
|
3053
3106
|
inRule: this.shortRuleNameToFullName(e[i - 1])
|
|
@@ -3058,12 +3111,12 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3058
3111
|
return this.buildFullFollowKeyStack().map((e) => this.getFollowSetFromFollowKey(e)).flat();
|
|
3059
3112
|
}
|
|
3060
3113
|
getFollowSetFromFollowKey(e) {
|
|
3061
|
-
if (e ===
|
|
3062
|
-
let t = e.ruleName + e.idxInCallingRule +
|
|
3114
|
+
if (e === mn) return [X];
|
|
3115
|
+
let t = e.ruleName + e.idxInCallingRule + fe + e.inRule;
|
|
3063
3116
|
return this.resyncFollows[t];
|
|
3064
3117
|
}
|
|
3065
3118
|
addToResyncTokens(e, t) {
|
|
3066
|
-
return this.tokenMatcher(e,
|
|
3119
|
+
return this.tokenMatcher(e, X) || t.push(e), t;
|
|
3067
3120
|
}
|
|
3068
3121
|
reSyncTo(e) {
|
|
3069
3122
|
let t = [], n = this.LA_FAST(1);
|
|
@@ -3087,38 +3140,38 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3087
3140
|
},
|
|
3088
3141
|
class {
|
|
3089
3142
|
initLooksAhead(e) {
|
|
3090
|
-
this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : $.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : $.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new
|
|
3143
|
+
this.dynamicTokensEnabled = Object.hasOwn(e, "dynamicTokensEnabled") ? e.dynamicTokensEnabled : $.dynamicTokensEnabled, this.maxLookahead = Object.hasOwn(e, "maxLookahead") ? e.maxLookahead : $.maxLookahead, this.lookaheadStrategy = Object.hasOwn(e, "lookaheadStrategy") ? e.lookaheadStrategy : new bn({ maxLookahead: this.maxLookahead }), this.lookAheadFuncsCache = [], this.currRuleLookaheadFuncs = [];
|
|
3091
3144
|
}
|
|
3092
3145
|
preComputeLookaheadFunctions(e) {
|
|
3093
3146
|
e.forEach((e) => {
|
|
3094
3147
|
this.TRACE_INIT(`${e.name} Rule Lookahead`, () => {
|
|
3095
3148
|
let { alternation: t, repetition: n, option: r, repetitionMandatory: i, repetitionMandatoryWithSeparator: a, repetitionWithSeparator: o } = function(e) {
|
|
3096
|
-
|
|
3097
|
-
let t =
|
|
3098
|
-
return
|
|
3149
|
+
xn.reset(), e.accept(xn);
|
|
3150
|
+
let t = xn.dslMethods;
|
|
3151
|
+
return xn.reset(), t;
|
|
3099
3152
|
}(e);
|
|
3100
3153
|
t.forEach((t) => {
|
|
3101
3154
|
let n = t.idx === 0 ? "" : t.idx;
|
|
3102
|
-
this.TRACE_INIT(`${
|
|
3155
|
+
this.TRACE_INIT(`${V(t)}${n}`, () => {
|
|
3103
3156
|
let n = this.lookaheadStrategy.buildLookaheadForAlternation({
|
|
3104
3157
|
prodOccurrence: t.idx,
|
|
3105
3158
|
rule: e,
|
|
3106
3159
|
maxLookahead: t.maxLookahead || this.maxLookahead,
|
|
3107
3160
|
hasPredicates: t.hasPredicates,
|
|
3108
3161
|
dynamicTokensEnabled: this.dynamicTokensEnabled
|
|
3109
|
-
})
|
|
3110
|
-
this.setLaFuncCache(
|
|
3162
|
+
});
|
|
3163
|
+
this.setLaFuncCache(this.fullRuleNameToShort[e.name], 256 | t.idx, n);
|
|
3111
3164
|
});
|
|
3112
3165
|
}), n.forEach((t) => {
|
|
3113
|
-
this.computeLookaheadFunc(e, t.idx, 768, "Repetition", t.maxLookahead,
|
|
3166
|
+
this.computeLookaheadFunc(e, t.idx, 768, "Repetition", t.maxLookahead, V(t));
|
|
3114
3167
|
}), r.forEach((t) => {
|
|
3115
|
-
this.computeLookaheadFunc(e, t.idx, 512, "Option", t.maxLookahead,
|
|
3168
|
+
this.computeLookaheadFunc(e, t.idx, 512, "Option", t.maxLookahead, V(t));
|
|
3116
3169
|
}), i.forEach((t) => {
|
|
3117
|
-
this.computeLookaheadFunc(e, t.idx,
|
|
3170
|
+
this.computeLookaheadFunc(e, t.idx, _n, "RepetitionMandatory", t.maxLookahead, V(t));
|
|
3118
3171
|
}), a.forEach((t) => {
|
|
3119
|
-
this.computeLookaheadFunc(e, t.idx,
|
|
3172
|
+
this.computeLookaheadFunc(e, t.idx, yn, "RepetitionMandatoryWithSeparator", t.maxLookahead, V(t));
|
|
3120
3173
|
}), o.forEach((t) => {
|
|
3121
|
-
this.computeLookaheadFunc(e, t.idx,
|
|
3174
|
+
this.computeLookaheadFunc(e, t.idx, vn, "RepetitionWithSeparator", t.maxLookahead, V(t));
|
|
3122
3175
|
});
|
|
3123
3176
|
});
|
|
3124
3177
|
});
|
|
@@ -3131,29 +3184,25 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3131
3184
|
maxLookahead: i || this.maxLookahead,
|
|
3132
3185
|
dynamicTokensEnabled: this.dynamicTokensEnabled,
|
|
3133
3186
|
prodType: r
|
|
3134
|
-
})
|
|
3135
|
-
this.setLaFuncCache(
|
|
3187
|
+
});
|
|
3188
|
+
this.setLaFuncCache(this.fullRuleNameToShort[e.name], n | t, a);
|
|
3136
3189
|
});
|
|
3137
3190
|
}
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
getLaFuncFromCache(e) {
|
|
3142
|
-
return this.lookAheadFuncsCache.get(e);
|
|
3143
|
-
}
|
|
3144
|
-
setLaFuncCache(e, t) {
|
|
3145
|
-
this.lookAheadFuncsCache.set(e, t);
|
|
3191
|
+
setLaFuncCache(e, t, n) {
|
|
3192
|
+
let r = this.lookAheadFuncsCache[e];
|
|
3193
|
+
r === void 0 && (r = [], this.lookAheadFuncsCache[e] = r), r[t] = n;
|
|
3146
3194
|
}
|
|
3147
3195
|
},
|
|
3148
3196
|
class {
|
|
3149
3197
|
initTreeBuilder(e) {
|
|
3150
|
-
if (this.CST_STACK = [], this.outputCst = e.outputCst, this.nodeLocationTracking = Object.hasOwn(e, "nodeLocationTracking") ? e.nodeLocationTracking : $.nodeLocationTracking, this.outputCst)
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3198
|
+
if (this.CST_STACK = [], this.outputCst = e.outputCst, this.nodeLocationTracking = Object.hasOwn(e, "nodeLocationTracking") ? e.nodeLocationTracking : $.nodeLocationTracking, this.outputCst) {
|
|
3199
|
+
if (/full/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Cn, this.setNodeLocationFromNode = Cn, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationFullRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleFull, this.setInitialNodeLocation = this.setInitialNodeLocationFullRegular);
|
|
3200
|
+
else if (/onlyOffset/i.test(this.nodeLocationTracking)) this.recoveryEnabled ? (this.setNodeLocationFromToken = Sn, this.setNodeLocationFromNode = Sn, this.cstPostRule = () => {}, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRecovery) : (this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = this.cstPostRuleOnlyOffset, this.setInitialNodeLocation = this.setInitialNodeLocationOnlyOffsetRegular);
|
|
3201
|
+
else {
|
|
3202
|
+
if (!/none/i.test(this.nodeLocationTracking)) throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);
|
|
3203
|
+
this.setNodeLocationFromToken = () => {}, this.setNodeLocationFromNode = () => {}, this.cstPostRule = () => {}, this.setInitialNodeLocation = () => {};
|
|
3204
|
+
}
|
|
3205
|
+
} else this.cstInvocationStateUpdate = () => {}, this.cstFinallyStateUpdate = () => {}, this.cstPostTerminal = () => {}, this.cstPostNonTerminal = () => {}, this.cstPostRule = () => {};
|
|
3157
3206
|
}
|
|
3158
3207
|
setInitialNodeLocationOnlyOffsetRecovery(e) {
|
|
3159
3208
|
e.location = {
|
|
@@ -3222,7 +3271,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3222
3271
|
}
|
|
3223
3272
|
getBaseCstVisitorConstructor() {
|
|
3224
3273
|
if (this.baseCstVisitorConstructor === void 0) {
|
|
3225
|
-
let e =
|
|
3274
|
+
let e = Dn(this.className, Object.keys(this.gastProductionsCache));
|
|
3226
3275
|
return this.baseCstVisitorConstructor = e, e;
|
|
3227
3276
|
}
|
|
3228
3277
|
return this.baseCstVisitorConstructor;
|
|
@@ -3231,10 +3280,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3231
3280
|
if (this.baseCstVisitorWithDefaultsConstructor === void 0) {
|
|
3232
3281
|
let e = function(e, t, n) {
|
|
3233
3282
|
let r = function() {};
|
|
3234
|
-
|
|
3283
|
+
Tn(r, e + "BaseSemanticsWithDefaults");
|
|
3235
3284
|
let i = Object.create(n.prototype);
|
|
3236
3285
|
return t.forEach((e) => {
|
|
3237
|
-
i[e] =
|
|
3286
|
+
i[e] = En;
|
|
3238
3287
|
}), (r.prototype = i).constructor = r, r;
|
|
3239
3288
|
}(this.className, Object.keys(this.gastProductionsCache), this.getBaseCstVisitorConstructor());
|
|
3240
3289
|
return this.baseCstVisitorWithDefaultsConstructor = e, e;
|
|
@@ -3260,7 +3309,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3260
3309
|
return this.tokVector;
|
|
3261
3310
|
}
|
|
3262
3311
|
SKIP_TOKEN() {
|
|
3263
|
-
return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) :
|
|
3312
|
+
return this.currIdx <= this.tokVectorLength - 2 ? (this.consumeToken(), this.LA_FAST(1)) : Ln;
|
|
3264
3313
|
}
|
|
3265
3314
|
LA_FAST(e) {
|
|
3266
3315
|
let t = this.currIdx + e;
|
|
@@ -3268,7 +3317,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3268
3317
|
}
|
|
3269
3318
|
LA(e) {
|
|
3270
3319
|
let t = this.currIdx + e;
|
|
3271
|
-
return t < 0 || this.tokVectorLength <= t ?
|
|
3320
|
+
return t < 0 || this.tokVectorLength <= t ? Ln : this.tokVector[t];
|
|
3272
3321
|
}
|
|
3273
3322
|
consumeToken() {
|
|
3274
3323
|
this.currIdx++;
|
|
@@ -3291,27 +3340,27 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3291
3340
|
},
|
|
3292
3341
|
class {
|
|
3293
3342
|
initRecognizerEngine(e, t) {
|
|
3294
|
-
if (this.className = this.constructor.name, this.shortRuleNameToFull =
|
|
3343
|
+
if (this.className = this.constructor.name, this.shortRuleNameToFull = [], this.fullRuleNameToShort = {}, this.ruleShortNameIdx = 0, this.tokenMatcher = Ze, this.subruleIdx = 0, this.currRuleShortName = -1, this.definedRulesNames = [], this.tokensMap = {}, this.isBackTrackingStack = [], this.RULE_STACK = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK = [], this.RULE_OCCURRENCE_STACK_IDX = -1, this.gastProductionsCache = {}, Object.hasOwn(t, "serializedGrammar")) throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0\n For Further details.");
|
|
3295
3344
|
if (Array.isArray(e)) {
|
|
3296
3345
|
if (e.length === 0) throw Error("A Token Vocabulary cannot be empty.\n Note that the first argument for the parser constructor\n is no longer a Token vector (since v4.0).");
|
|
3297
3346
|
if (typeof e[0].startOffset == "number") throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0\n For Further details.");
|
|
3298
3347
|
}
|
|
3299
3348
|
if (Array.isArray(e)) this.tokensMap = e.reduce((e, t) => (e[t.name] = t, e), {});
|
|
3300
|
-
else if (Object.hasOwn(e, "modes") && Object.values(e.modes).flat().every(
|
|
3349
|
+
else if (Object.hasOwn(e, "modes") && Object.values(e.modes).flat().every(it)) {
|
|
3301
3350
|
let t = Object.values(e.modes).flat(), n = [...new Set(t)];
|
|
3302
3351
|
this.tokensMap = n.reduce((e, t) => (e[t.name] = t, e), {});
|
|
3303
3352
|
} else {
|
|
3304
3353
|
if (typeof e != "object" || !e) throw Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");
|
|
3305
3354
|
this.tokensMap = Object.assign({}, e);
|
|
3306
3355
|
}
|
|
3307
|
-
this.tokensMap.EOF =
|
|
3356
|
+
this.tokensMap.EOF = X;
|
|
3308
3357
|
let n = (Object.hasOwn(e, "modes") ? Object.values(e.modes).flat() : Object.values(e)).every((e) => e.categoryMatches?.length == 0);
|
|
3309
|
-
this.tokenMatcher = n ?
|
|
3358
|
+
this.tokenMatcher = n ? Ze : Xe, et(Object.values(this.tokensMap));
|
|
3310
3359
|
}
|
|
3311
3360
|
defineRule(e, t, n) {
|
|
3312
3361
|
if (this.selfAnalysisDone) throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);
|
|
3313
|
-
let r = Object.hasOwn(n, "resyncEnabled") ? n.resyncEnabled :
|
|
3314
|
-
return this.
|
|
3362
|
+
let r = Object.hasOwn(n, "resyncEnabled") ? n.resyncEnabled : Rn.resyncEnabled, i = Object.hasOwn(n, "recoveryValueFunc") ? n.recoveryValueFunc : Rn.recoveryValueFunc, a = this.ruleShortNameIdx++, o;
|
|
3363
|
+
return this.shortRuleNameToFull[a] = e, this.fullRuleNameToShort[e] = a, o = !0 === this.outputCst ? function(...n) {
|
|
3315
3364
|
try {
|
|
3316
3365
|
this.ruleInvocationStateUpdate(a, e, this.subruleIdx), t.apply(this, n);
|
|
3317
3366
|
let r = this.CST_STACK[this.CST_STACK.length - 1];
|
|
@@ -3344,7 +3393,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3344
3393
|
}
|
|
3345
3394
|
invokeRuleCatch(e, t, n) {
|
|
3346
3395
|
let r = this.RULE_STACK_IDX === 0, i = t && !this.isBackTracking() && this.recoveryEnabled;
|
|
3347
|
-
if (
|
|
3396
|
+
if (cn(e)) {
|
|
3348
3397
|
let t = e;
|
|
3349
3398
|
if (i) {
|
|
3350
3399
|
let r = this.findReSyncTokenType();
|
|
@@ -3367,11 +3416,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3367
3416
|
throw e;
|
|
3368
3417
|
}
|
|
3369
3418
|
optionInternal(e, t) {
|
|
3370
|
-
let n =
|
|
3419
|
+
let n = 512 | t;
|
|
3371
3420
|
return this.optionInternalLogic(e, t, n);
|
|
3372
3421
|
}
|
|
3373
3422
|
optionInternalLogic(e, t, n) {
|
|
3374
|
-
let r, i = this.
|
|
3423
|
+
let r, i = this.currRuleLookaheadFuncs[n];
|
|
3375
3424
|
if (typeof e != "function") {
|
|
3376
3425
|
r = e.DEF;
|
|
3377
3426
|
let t = e.GATE;
|
|
@@ -3383,11 +3432,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3383
3432
|
if (!0 === i.call(this)) return r.call(this);
|
|
3384
3433
|
}
|
|
3385
3434
|
atLeastOneInternal(e, t) {
|
|
3386
|
-
let n =
|
|
3435
|
+
let n = _n | e;
|
|
3387
3436
|
return this.atLeastOneInternalLogic(e, t, n);
|
|
3388
3437
|
}
|
|
3389
3438
|
atLeastOneInternalLogic(e, t, n) {
|
|
3390
|
-
let r, i = this.
|
|
3439
|
+
let r, i = this.currRuleLookaheadFuncs[n];
|
|
3391
3440
|
if (typeof t != "function") {
|
|
3392
3441
|
r = t.DEF;
|
|
3393
3442
|
let e = t.GATE;
|
|
@@ -3396,20 +3445,20 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3396
3445
|
i = () => e.call(this) && t.call(this);
|
|
3397
3446
|
}
|
|
3398
3447
|
} else r = t;
|
|
3399
|
-
if (!0 !== i.call(this)) throw this.raiseEarlyExitException(e,
|
|
3448
|
+
if (!0 !== i.call(this)) throw this.raiseEarlyExitException(e, Z.REPETITION_MANDATORY, t.ERR_MSG);
|
|
3400
3449
|
{
|
|
3401
3450
|
let e = this.doSingleRepetition(r);
|
|
3402
3451
|
for (; !0 === i.call(this) && !0 === e;) e = this.doSingleRepetition(r);
|
|
3403
3452
|
}
|
|
3404
|
-
this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, t], i,
|
|
3453
|
+
this.attemptInRepetitionRecovery(this.atLeastOneInternal, [e, t], i, _n, e, Ot);
|
|
3405
3454
|
}
|
|
3406
3455
|
atLeastOneSepFirstInternal(e, t) {
|
|
3407
|
-
let n =
|
|
3456
|
+
let n = yn | e;
|
|
3408
3457
|
this.atLeastOneSepFirstInternalLogic(e, t, n);
|
|
3409
3458
|
}
|
|
3410
3459
|
atLeastOneSepFirstInternalLogic(e, t, n) {
|
|
3411
3460
|
let r = t.DEF, i = t.SEP;
|
|
3412
|
-
if (!0 !== this.
|
|
3461
|
+
if (!0 !== this.currRuleLookaheadFuncs[n].call(this)) throw this.raiseEarlyExitException(e, Z.REPETITION_MANDATORY_WITH_SEPARATOR, t.ERR_MSG);
|
|
3413
3462
|
{
|
|
3414
3463
|
r.call(this);
|
|
3415
3464
|
let t = () => this.tokenMatcher(this.LA_FAST(1), i);
|
|
@@ -3419,16 +3468,16 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3419
3468
|
i,
|
|
3420
3469
|
t,
|
|
3421
3470
|
r,
|
|
3422
|
-
|
|
3423
|
-
], t,
|
|
3471
|
+
kt
|
|
3472
|
+
], t, yn, e, kt);
|
|
3424
3473
|
}
|
|
3425
3474
|
}
|
|
3426
3475
|
manyInternal(e, t) {
|
|
3427
|
-
let n =
|
|
3476
|
+
let n = 768 | e;
|
|
3428
3477
|
return this.manyInternalLogic(e, t, n);
|
|
3429
3478
|
}
|
|
3430
3479
|
manyInternalLogic(e, t, n) {
|
|
3431
|
-
let r, i = this.
|
|
3480
|
+
let r, i = this.currRuleLookaheadFuncs[n];
|
|
3432
3481
|
if (typeof t != "function") {
|
|
3433
3482
|
r = t.DEF;
|
|
3434
3483
|
let e = t.GATE;
|
|
@@ -3439,15 +3488,15 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3439
3488
|
} else r = t;
|
|
3440
3489
|
let a = !0;
|
|
3441
3490
|
for (; !0 === i.call(this) && !0 === a;) a = this.doSingleRepetition(r);
|
|
3442
|
-
this.attemptInRepetitionRecovery(this.manyInternal, [e, t], i, 768, e,
|
|
3491
|
+
this.attemptInRepetitionRecovery(this.manyInternal, [e, t], i, 768, e, Et, a);
|
|
3443
3492
|
}
|
|
3444
3493
|
manySepFirstInternal(e, t) {
|
|
3445
|
-
let n =
|
|
3494
|
+
let n = vn | e;
|
|
3446
3495
|
this.manySepFirstInternalLogic(e, t, n);
|
|
3447
3496
|
}
|
|
3448
3497
|
manySepFirstInternalLogic(e, t, n) {
|
|
3449
3498
|
let r = t.DEF, i = t.SEP;
|
|
3450
|
-
if (!0 === this.
|
|
3499
|
+
if (!0 === this.currRuleLookaheadFuncs[n].call(this)) {
|
|
3451
3500
|
r.call(this);
|
|
3452
3501
|
let t = () => this.tokenMatcher(this.LA_FAST(1), i);
|
|
3453
3502
|
for (; !0 === this.tokenMatcher(this.LA_FAST(1), i);) this.CONSUME(i), r.call(this);
|
|
@@ -3456,8 +3505,8 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3456
3505
|
i,
|
|
3457
3506
|
t,
|
|
3458
3507
|
r,
|
|
3459
|
-
|
|
3460
|
-
], t,
|
|
3508
|
+
Dt
|
|
3509
|
+
], t, vn, e, Dt);
|
|
3461
3510
|
}
|
|
3462
3511
|
}
|
|
3463
3512
|
repetitionSepSecondInternal(e, t, n, r, i) {
|
|
@@ -3468,19 +3517,19 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3468
3517
|
n,
|
|
3469
3518
|
r,
|
|
3470
3519
|
i
|
|
3471
|
-
], n,
|
|
3520
|
+
], n, yn, e, i);
|
|
3472
3521
|
}
|
|
3473
3522
|
doSingleRepetition(e) {
|
|
3474
3523
|
let t = this.getLexerPosition();
|
|
3475
3524
|
return e.call(this), this.getLexerPosition() > t;
|
|
3476
3525
|
}
|
|
3477
3526
|
orInternal(e, t) {
|
|
3478
|
-
let n =
|
|
3527
|
+
let n = 256 | t, r = Array.isArray(e) ? e : e.DEF, i = this.currRuleLookaheadFuncs[n].call(this, r);
|
|
3479
3528
|
if (i !== void 0) return r[i].ALT.call(this);
|
|
3480
3529
|
this.raiseNoAltException(t, e.ERR_MSG);
|
|
3481
3530
|
}
|
|
3482
3531
|
ruleFinallyStateUpdate() {
|
|
3483
|
-
this.RULE_STACK_IDX--, this.RULE_OCCURRENCE_STACK_IDX--, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]), this.cstFinallyStateUpdate();
|
|
3532
|
+
this.RULE_STACK_IDX--, this.RULE_OCCURRENCE_STACK_IDX--, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX], this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[this.currRuleShortName]), this.cstFinallyStateUpdate();
|
|
3484
3533
|
}
|
|
3485
3534
|
subruleInternal(e, t, n) {
|
|
3486
3535
|
let r;
|
|
@@ -3492,7 +3541,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3492
3541
|
}
|
|
3493
3542
|
}
|
|
3494
3543
|
subruleInternalError(e, t, n) {
|
|
3495
|
-
throw
|
|
3544
|
+
throw cn(e) && e.partialCstResult !== void 0 && (this.cstPostNonTerminal(e.partialCstResult, t !== void 0 && t.LABEL !== void 0 ? t.LABEL : n), delete e.partialCstResult), e;
|
|
3496
3545
|
}
|
|
3497
3546
|
consumeInternal(e, t, n) {
|
|
3498
3547
|
let r;
|
|
@@ -3511,7 +3560,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3511
3560
|
actual: t,
|
|
3512
3561
|
previous: i,
|
|
3513
3562
|
ruleName: this.getCurrRuleFullName()
|
|
3514
|
-
}), this.SAVE_ERROR(new
|
|
3563
|
+
}), this.SAVE_ERROR(new un(r, t, i));
|
|
3515
3564
|
}
|
|
3516
3565
|
consumeInternalRecovery(e, t, n) {
|
|
3517
3566
|
if (!this.recoveryEnabled || n.name !== "MismatchedTokenException" || this.isBackTracking()) throw n;
|
|
@@ -3537,10 +3586,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3537
3586
|
this.errors = e.errors, this.importLexerState(e.lexerState);
|
|
3538
3587
|
let t = e.RULE_STACK;
|
|
3539
3588
|
for (let e = 0; e < t.length; e++) this.RULE_STACK[e] = t[e];
|
|
3540
|
-
this.RULE_STACK_IDX = t.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX]);
|
|
3589
|
+
this.RULE_STACK_IDX = t.length - 1, this.RULE_STACK_IDX >= 0 && (this.currRuleShortName = this.RULE_STACK[this.RULE_STACK_IDX], this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[this.currRuleShortName]);
|
|
3541
3590
|
}
|
|
3542
3591
|
ruleInvocationStateUpdate(e, t, n) {
|
|
3543
|
-
this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = n, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.cstInvocationStateUpdate(t);
|
|
3592
|
+
this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX] = n, this.RULE_STACK[++this.RULE_STACK_IDX] = e, this.currRuleShortName = e, this.currRuleLookaheadFuncs = this.lookAheadFuncsCache[e], this.cstInvocationStateUpdate(t);
|
|
3544
3593
|
}
|
|
3545
3594
|
isBackTracking() {
|
|
3546
3595
|
return this.isBackTrackingStack.length !== 0;
|
|
@@ -3553,13 +3602,13 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3553
3602
|
return this.shortRuleNameToFull[e];
|
|
3554
3603
|
}
|
|
3555
3604
|
isAtEndOfInput() {
|
|
3556
|
-
return this.tokenMatcher(this.LA(1),
|
|
3605
|
+
return this.tokenMatcher(this.LA(1), X);
|
|
3557
3606
|
}
|
|
3558
3607
|
reset() {
|
|
3559
|
-
this.resetLexerState(), this.subruleIdx = 0, this.currRuleShortName =
|
|
3608
|
+
this.resetLexerState(), this.subruleIdx = 0, this.currRuleShortName = -1, this.currRuleLookaheadFuncs = [], this.isBackTrackingStack = [], this.errors = [], this.RULE_STACK_IDX = -1, this.RULE_OCCURRENCE_STACK_IDX = -1, this.CST_STACK = [];
|
|
3560
3609
|
}
|
|
3561
3610
|
onBeforeParse(e) {
|
|
3562
|
-
for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(
|
|
3611
|
+
for (let e = 0; e < this.maxLookahead + 1; e++) this.tokVector.push(Ln);
|
|
3563
3612
|
}
|
|
3564
3613
|
onAfterParse(e) {
|
|
3565
3614
|
if (!1 === this.isAtEndOfInput()) {
|
|
@@ -3567,9 +3616,9 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3567
3616
|
firstRedundant: e,
|
|
3568
3617
|
ruleName: this.getCurrRuleFullName()
|
|
3569
3618
|
});
|
|
3570
|
-
this.SAVE_ERROR(new
|
|
3619
|
+
this.SAVE_ERROR(new fn(t, e));
|
|
3571
3620
|
}
|
|
3572
|
-
for (; this.tokVector.at(-1) ===
|
|
3621
|
+
for (; this.tokVector.at(-1) === Ln;) this.tokVector.pop();
|
|
3573
3622
|
}
|
|
3574
3623
|
},
|
|
3575
3624
|
class {
|
|
@@ -3834,10 +3883,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3834
3883
|
AT_LEAST_ONE_SEP9(e) {
|
|
3835
3884
|
this.atLeastOneSepFirstInternal(9, e);
|
|
3836
3885
|
}
|
|
3837
|
-
RULE(e, t, n =
|
|
3886
|
+
RULE(e, t, n = Rn) {
|
|
3838
3887
|
if (this.definedRulesNames.includes(e)) {
|
|
3839
3888
|
let t = {
|
|
3840
|
-
message:
|
|
3889
|
+
message: xt.buildDuplicateRuleNameError({
|
|
3841
3890
|
topLevelRule: e,
|
|
3842
3891
|
grammarName: this.className
|
|
3843
3892
|
}),
|
|
@@ -3850,7 +3899,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3850
3899
|
let r = this.defineRule(e, t, n);
|
|
3851
3900
|
return this[e] = r, r;
|
|
3852
3901
|
}
|
|
3853
|
-
OVERRIDE_RULE(e, t, n =
|
|
3902
|
+
OVERRIDE_RULE(e, t, n = Rn) {
|
|
3854
3903
|
let r = function(e, t, n) {
|
|
3855
3904
|
let r = [], i;
|
|
3856
3905
|
return t.includes(e) || (i = `Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `, r.push({
|
|
@@ -3871,7 +3920,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3871
3920
|
try {
|
|
3872
3921
|
return n.apply(this, t), !0;
|
|
3873
3922
|
} catch (e) {
|
|
3874
|
-
if (
|
|
3923
|
+
if (cn(e)) return !1;
|
|
3875
3924
|
throw e;
|
|
3876
3925
|
} finally {
|
|
3877
3926
|
this.reloadRecogState(e), this.isBackTrackingStack.pop();
|
|
@@ -3882,7 +3931,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3882
3931
|
return this.gastProductionsCache;
|
|
3883
3932
|
}
|
|
3884
3933
|
getSerializedGastProductions() {
|
|
3885
|
-
return Object.values(this.gastProductionsCache).map(
|
|
3934
|
+
return Object.values(this.gastProductionsCache).map(oe);
|
|
3886
3935
|
}
|
|
3887
3936
|
},
|
|
3888
3937
|
class {
|
|
@@ -3890,7 +3939,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3890
3939
|
this._errors = [], this.errorMessageProvider = Object.hasOwn(e, "errorMessageProvider") ? e.errorMessageProvider : $.errorMessageProvider;
|
|
3891
3940
|
}
|
|
3892
3941
|
SAVE_ERROR(e) {
|
|
3893
|
-
if (
|
|
3942
|
+
if (cn(e)) return e.context = {
|
|
3894
3943
|
ruleStack: this.getHumanReadableRuleStack(),
|
|
3895
3944
|
ruleOccurrenceStack: this.RULE_OCCURRENCE_STACK.slice(0, this.RULE_OCCURRENCE_STACK_IDX + 1)
|
|
3896
3945
|
}, this._errors.push(e), e;
|
|
@@ -3903,7 +3952,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3903
3952
|
this._errors = e;
|
|
3904
3953
|
}
|
|
3905
3954
|
raiseEarlyExitException(e, t, n) {
|
|
3906
|
-
let r = this.getCurrRuleFullName(), i =
|
|
3955
|
+
let r = this.getCurrRuleFullName(), i = Ht(e, this.getGAstProductions()[r], t, this.maxLookahead)[0], a = [];
|
|
3907
3956
|
for (let e = 1; e <= this.maxLookahead; e++) a.push(this.LA(e));
|
|
3908
3957
|
let o = this.errorMessageProvider.buildEarlyExitMessage({
|
|
3909
3958
|
expectedIterationPaths: i,
|
|
@@ -3912,10 +3961,10 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3912
3961
|
customUserDescription: n,
|
|
3913
3962
|
ruleName: r
|
|
3914
3963
|
});
|
|
3915
|
-
throw this.SAVE_ERROR(new
|
|
3964
|
+
throw this.SAVE_ERROR(new pn(o, this.LA(1), this.LA(0)));
|
|
3916
3965
|
}
|
|
3917
3966
|
raiseNoAltException(e, t) {
|
|
3918
|
-
let n = this.getCurrRuleFullName(), r =
|
|
3967
|
+
let n = this.getCurrRuleFullName(), r = Vt(e, this.getGAstProductions()[n], this.maxLookahead), i = [];
|
|
3919
3968
|
for (let e = 1; e <= this.maxLookahead; e++) i.push(this.LA(e));
|
|
3920
3969
|
let a = this.LA(0), o = this.errorMessageProvider.buildNoViableAltMessage({
|
|
3921
3970
|
expectedPathsPerAlt: r,
|
|
@@ -3924,7 +3973,7 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3924
3973
|
customUserDescription: t,
|
|
3925
3974
|
ruleName: this.getCurrRuleFullName()
|
|
3926
3975
|
});
|
|
3927
|
-
throw this.SAVE_ERROR(new
|
|
3976
|
+
throw this.SAVE_ERROR(new dn(o, this.LA(1), a));
|
|
3928
3977
|
}
|
|
3929
3978
|
},
|
|
3930
3979
|
class {
|
|
@@ -3983,11 +4032,11 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
3983
4032
|
return () => !0;
|
|
3984
4033
|
}
|
|
3985
4034
|
LA_RECORD(e) {
|
|
3986
|
-
return
|
|
4035
|
+
return Ln;
|
|
3987
4036
|
}
|
|
3988
4037
|
topLevelRuleRecord(e, t) {
|
|
3989
4038
|
try {
|
|
3990
|
-
let n = new
|
|
4039
|
+
let n = new j({
|
|
3991
4040
|
definition: [],
|
|
3992
4041
|
name: e
|
|
3993
4042
|
});
|
|
@@ -4002,54 +4051,54 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
4002
4051
|
}
|
|
4003
4052
|
}
|
|
4004
4053
|
optionInternalRecord(e, t) {
|
|
4005
|
-
return
|
|
4054
|
+
return Nn.call(this, N, e, t);
|
|
4006
4055
|
}
|
|
4007
4056
|
atLeastOneInternalRecord(e, t) {
|
|
4008
|
-
|
|
4057
|
+
Nn.call(this, P, t, e);
|
|
4009
4058
|
}
|
|
4010
4059
|
atLeastOneSepFirstInternalRecord(e, t) {
|
|
4011
|
-
|
|
4060
|
+
Nn.call(this, F, t, e, kn);
|
|
4012
4061
|
}
|
|
4013
4062
|
manyInternalRecord(e, t) {
|
|
4014
|
-
|
|
4063
|
+
Nn.call(this, I, t, e);
|
|
4015
4064
|
}
|
|
4016
4065
|
manySepFirstInternalRecord(e, t) {
|
|
4017
|
-
|
|
4066
|
+
Nn.call(this, L, t, e, kn);
|
|
4018
4067
|
}
|
|
4019
4068
|
orInternalRecord(e, t) {
|
|
4020
|
-
return
|
|
4069
|
+
return Pn.call(this, e, t);
|
|
4021
4070
|
}
|
|
4022
4071
|
subruleInternalRecord(e, t, n) {
|
|
4023
|
-
if (
|
|
4024
|
-
let n = /* @__PURE__ */ Error(`<SUBRULE${
|
|
4072
|
+
if (In(t), !e || !Object.hasOwn(e, "ruleName")) {
|
|
4073
|
+
let n = /* @__PURE__ */ Error(`<SUBRULE${Fn(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
|
|
4025
4074
|
throw n.KNOWN_RECORDER_ERROR = !0, n;
|
|
4026
4075
|
}
|
|
4027
|
-
let r = this.recordingProdStack.at(-1), i = e.ruleName, a = new
|
|
4076
|
+
let r = this.recordingProdStack.at(-1), i = e.ruleName, a = new A({
|
|
4028
4077
|
idx: t,
|
|
4029
4078
|
nonTerminalName: i,
|
|
4030
4079
|
label: n?.LABEL,
|
|
4031
4080
|
referencedRule: void 0
|
|
4032
4081
|
});
|
|
4033
|
-
return r.definition.push(a), this.outputCst ?
|
|
4082
|
+
return r.definition.push(a), this.outputCst ? Mn : On;
|
|
4034
4083
|
}
|
|
4035
4084
|
consumeInternalRecord(e, t, n) {
|
|
4036
|
-
if (
|
|
4037
|
-
let n = /* @__PURE__ */ Error(`<CONSUME${
|
|
4085
|
+
if (In(t), !nt(e)) {
|
|
4086
|
+
let n = /* @__PURE__ */ Error(`<CONSUME${Fn(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);
|
|
4038
4087
|
throw n.KNOWN_RECORDER_ERROR = !0, n;
|
|
4039
4088
|
}
|
|
4040
|
-
let r = this.recordingProdStack.at(-1), i = new
|
|
4089
|
+
let r = this.recordingProdStack.at(-1), i = new z({
|
|
4041
4090
|
idx: t,
|
|
4042
4091
|
terminalType: e,
|
|
4043
4092
|
label: n?.LABEL
|
|
4044
4093
|
});
|
|
4045
|
-
return r.definition.push(i),
|
|
4094
|
+
return r.definition.push(i), jn;
|
|
4046
4095
|
}
|
|
4047
4096
|
},
|
|
4048
4097
|
class {
|
|
4049
4098
|
initPerformanceTracer(e) {
|
|
4050
4099
|
if (Object.hasOwn(e, "traceInitPerf")) {
|
|
4051
4100
|
let t = e.traceInitPerf, n = typeof t == "number";
|
|
4052
|
-
this.traceInitMaxIdent = n ? t :
|
|
4101
|
+
this.traceInitMaxIdent = n ? t : 1 / 0, this.traceInitPerf = n ? t > 0 : t;
|
|
4053
4102
|
} else this.traceInitMaxIdent = 0, this.traceInitPerf = $.traceInitPerf;
|
|
4054
4103
|
this.traceInitIndent = -1;
|
|
4055
4104
|
}
|
|
@@ -4058,8 +4107,8 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
4058
4107
|
this.traceInitIndent++;
|
|
4059
4108
|
let n = Array(this.traceInitIndent + 1).join(" ");
|
|
4060
4109
|
this.traceInitIndent < this.traceInitMaxIdent && console.log(`${n}--\x3e <${e}>`);
|
|
4061
|
-
let { time: r, value:
|
|
4062
|
-
return this.traceInitIndent < this.traceInitMaxIdent &&
|
|
4110
|
+
let { time: r, value: i } = ae(t), a = r > 10 ? console.warn : console.log;
|
|
4111
|
+
return this.traceInitIndent < this.traceInitMaxIdent && a(`${n}<-- <${e}> time: ${r}ms`), this.traceInitIndent--, i;
|
|
4063
4112
|
}
|
|
4064
4113
|
return t();
|
|
4065
4114
|
}
|
|
@@ -4069,67 +4118,84 @@ pn.DEFER_DEFINITION_ERRORS_HANDLING = !1, fn = pn, [
|
|
|
4069
4118
|
Object.getOwnPropertyNames(t).forEach((n) => {
|
|
4070
4119
|
if (n === "constructor") return;
|
|
4071
4120
|
let r = Object.getOwnPropertyDescriptor(t, n);
|
|
4072
|
-
r && (r.get || r.set) ? Object.defineProperty(
|
|
4121
|
+
r && (r.get || r.set) ? Object.defineProperty(zn.prototype, n, r) : zn.prototype[n] = e.prototype[n];
|
|
4073
4122
|
});
|
|
4074
4123
|
});
|
|
4075
|
-
var
|
|
4124
|
+
var Vn = class extends Bn {
|
|
4076
4125
|
constructor(e, t = $) {
|
|
4077
4126
|
let n = Object.assign({}, t);
|
|
4078
4127
|
n.outputCst = !1, super(e, n);
|
|
4079
4128
|
}
|
|
4080
|
-
},
|
|
4129
|
+
}, Hn = class e {
|
|
4081
4130
|
static shared(t) {
|
|
4082
|
-
let
|
|
4083
|
-
|
|
4084
|
-
let
|
|
4085
|
-
return
|
|
4086
|
-
locale:
|
|
4087
|
-
maxColumn:
|
|
4088
|
-
maxRow:
|
|
4089
|
-
}),
|
|
4090
|
-
}
|
|
4091
|
-
constructor(
|
|
4092
|
-
let
|
|
4093
|
-
this._locale =
|
|
4094
|
-
let { separatorFunction:
|
|
4095
|
-
if (
|
|
4096
|
-
let
|
|
4131
|
+
let n = t?.locale ?? re, r = t?.maxColumn ?? Kn, i = t?.maxRow ?? qn, a = Gn.get(n);
|
|
4132
|
+
a || (a = /* @__PURE__ */ new Map(), Gn.set(n, a));
|
|
4133
|
+
let o = `${r}:${i}`, s = a.get(o);
|
|
4134
|
+
return s || (s = new e({
|
|
4135
|
+
locale: n,
|
|
4136
|
+
maxColumn: r,
|
|
4137
|
+
maxRow: i
|
|
4138
|
+
}), a.set(o, s)), s;
|
|
4139
|
+
}
|
|
4140
|
+
constructor(e) {
|
|
4141
|
+
let t = e?.maxColumn ?? Kn, n = e?.maxRow ?? qn, r = e?.locale ?? re;
|
|
4142
|
+
this._locale = r, this._maxColumn = t, this._maxRow = n;
|
|
4143
|
+
let { separatorFunction: i, separatorColumn: a, separatorRow: o, separatorDecimal: s } = r.separators;
|
|
4144
|
+
if (a === o) throw Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${a}')`);
|
|
4145
|
+
let c = Y({
|
|
4097
4146
|
name: "WhiteSpace",
|
|
4098
|
-
pattern:
|
|
4099
|
-
group:
|
|
4100
|
-
}),
|
|
4147
|
+
pattern: /[ \n\v\f\r\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,
|
|
4148
|
+
group: J.SKIPPED
|
|
4149
|
+
}), l = Y({
|
|
4101
4150
|
name: "StringToken",
|
|
4102
4151
|
pattern: /"(""|[^"])*"/
|
|
4103
|
-
}),
|
|
4152
|
+
}), u = Y({
|
|
4104
4153
|
name: "FunctionToken",
|
|
4105
4154
|
pattern: /[a-zA-Z_\u007F-\uFFFF]+[a-zA-Z0-9_.\u007F-\uFFFF]*(?=\()/
|
|
4106
|
-
}),
|
|
4155
|
+
}), d = Y({
|
|
4107
4156
|
name: "TableReference",
|
|
4108
|
-
pattern: { exec:
|
|
4157
|
+
pattern: { exec: ne },
|
|
4109
4158
|
line_breaks: !1,
|
|
4110
|
-
start_chars_hint:
|
|
4111
|
-
}),
|
|
4159
|
+
start_chars_hint: Wn
|
|
4160
|
+
}), f = Y({
|
|
4112
4161
|
name: "BracketedString",
|
|
4113
|
-
pattern: { exec:
|
|
4162
|
+
pattern: { exec: te },
|
|
4114
4163
|
line_breaks: !1,
|
|
4115
4164
|
start_chars_hint: [91],
|
|
4116
|
-
longer_alt: [
|
|
4117
|
-
}),
|
|
4165
|
+
longer_alt: [d, l]
|
|
4166
|
+
}), p = (e) => (e ?? []).map((e) => e?.trim()).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).map((e) => e + "|").join(""), m = (e) => e.replace(/[A-Za-z]/g, (e) => `[${e.toUpperCase()}${e.toLowerCase()}]`), h = Y({
|
|
4118
4167
|
name: "LiteralError",
|
|
4119
|
-
pattern: RegExp(
|
|
4120
|
-
|
|
4168
|
+
pattern: new RegExp(p(r.errorLiterals) + [
|
|
4169
|
+
"#PARSE!",
|
|
4170
|
+
"#NULL!",
|
|
4171
|
+
"#DIV\\/0!",
|
|
4172
|
+
"#VALUE!",
|
|
4173
|
+
"#NUM!",
|
|
4174
|
+
"#FIELD!",
|
|
4175
|
+
"#N\\/A",
|
|
4176
|
+
"#GETTING_DATA",
|
|
4177
|
+
"#SPILL!",
|
|
4178
|
+
"#CONNECT!",
|
|
4179
|
+
"#BLOCKED!",
|
|
4180
|
+
"#UNKNOWN!",
|
|
4181
|
+
"#CALC!",
|
|
4182
|
+
"#BUSY!",
|
|
4183
|
+
"#PYTHON!",
|
|
4184
|
+
"#TIMEOUT!"
|
|
4185
|
+
].map(m).join("|"))
|
|
4186
|
+
}), g = Y({
|
|
4121
4187
|
name: "RefError",
|
|
4122
|
-
pattern: RegExp(
|
|
4123
|
-
}), _ =
|
|
4188
|
+
pattern: new RegExp(p(r.errorRefs) + ["#REF!", "#NAME\\?"].map(m).join("|"))
|
|
4189
|
+
}), _ = Y({
|
|
4124
4190
|
name: "SingleQuotedString",
|
|
4125
4191
|
pattern: /'(''|[^'])*'/
|
|
4126
|
-
}), v =
|
|
4192
|
+
}), v = Y({
|
|
4127
4193
|
name: "SheetQuoted",
|
|
4128
4194
|
pattern: /'(?:''|[^'])*?'!/
|
|
4129
|
-
}), y =
|
|
4195
|
+
}), y = Y({
|
|
4130
4196
|
name: "Sheet",
|
|
4131
4197
|
pattern: /[A-Za-z_.\d\u007F-\uFFFF]*!/
|
|
4132
|
-
}), b = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, x =
|
|
4198
|
+
}), b = /[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y, x = Y({
|
|
4133
4199
|
name: "NamedToken",
|
|
4134
4200
|
pattern: { exec: (e, t) => {
|
|
4135
4201
|
b.lastIndex = t;
|
|
@@ -4139,186 +4205,186 @@ var mn = class extends pn {
|
|
|
4139
4205
|
return i === -1 ? r.endsWith(":") && (r = r.slice(0, -1)) : r = r.substring(0, i), [r];
|
|
4140
4206
|
} },
|
|
4141
4207
|
line_breaks: !1,
|
|
4142
|
-
start_chars_hint:
|
|
4143
|
-
}), S =
|
|
4208
|
+
start_chars_hint: Wn
|
|
4209
|
+
}), S = Y({
|
|
4144
4210
|
name: "Cell",
|
|
4145
|
-
pattern: { exec:
|
|
4211
|
+
pattern: { exec: Xn(t, n) },
|
|
4146
4212
|
line_breaks: !1,
|
|
4147
|
-
start_chars_hint: [36, ...
|
|
4213
|
+
start_chars_hint: [36, ...Un],
|
|
4148
4214
|
longer_alt: x
|
|
4149
|
-
}),
|
|
4215
|
+
}), ee = Y({
|
|
4150
4216
|
name: "Column",
|
|
4151
|
-
pattern: { exec:
|
|
4217
|
+
pattern: { exec: Yn(t) },
|
|
4152
4218
|
line_breaks: !1,
|
|
4153
|
-
start_chars_hint: [36, ...
|
|
4219
|
+
start_chars_hint: [36, ...Un],
|
|
4154
4220
|
longer_alt: x
|
|
4155
|
-
}),
|
|
4221
|
+
}), C = Y({
|
|
4156
4222
|
name: "AbsRow",
|
|
4157
4223
|
pattern: /[$][0-9]+/
|
|
4158
|
-
}),
|
|
4224
|
+
}), w = s === "." ? "\\." : s, ie = Y({
|
|
4159
4225
|
name: "NumberToken",
|
|
4160
|
-
pattern: RegExp(`[0-9]+${
|
|
4161
|
-
}),
|
|
4226
|
+
pattern: RegExp(`[0-9]+${w}(?!:)[0-9]*([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|${w}[0-9]+([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+`)
|
|
4227
|
+
}), T = Y({
|
|
4162
4228
|
name: "ScientificDigit",
|
|
4163
4229
|
pattern: /[0-9]+\*\*[+-]?[0-9]+/
|
|
4164
|
-
}),
|
|
4230
|
+
}), E = Y({
|
|
4165
4231
|
name: "DigitToken",
|
|
4166
4232
|
pattern: /[0-9]+/
|
|
4167
|
-
}),
|
|
4168
|
-
for (let e of [
|
|
4233
|
+
}), D = ["TRUE", "FALSE"];
|
|
4234
|
+
for (let e of [r.booleanTrue, r.booleanFalse]) {
|
|
4169
4235
|
let t = e?.trim();
|
|
4170
|
-
t && !
|
|
4236
|
+
t && !D.some((e) => e.toLowerCase() === t.toLowerCase()) && D.push(t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
4171
4237
|
}
|
|
4172
|
-
let
|
|
4238
|
+
let ae = Y({
|
|
4173
4239
|
name: "BooleanToken",
|
|
4174
|
-
pattern: new RegExp(
|
|
4175
|
-
}),
|
|
4240
|
+
pattern: new RegExp(D.join("|"), "i")
|
|
4241
|
+
}), O = Y({
|
|
4176
4242
|
name: "ArgSeparator",
|
|
4177
|
-
pattern:
|
|
4178
|
-
}),
|
|
4243
|
+
pattern: Zn(i)
|
|
4244
|
+
}), k = Y({
|
|
4179
4245
|
name: "ColSeparator",
|
|
4180
|
-
pattern:
|
|
4181
|
-
}),
|
|
4246
|
+
pattern: Zn(a)
|
|
4247
|
+
}), A = Y({
|
|
4182
4248
|
name: "RowSeparator",
|
|
4183
|
-
pattern:
|
|
4184
|
-
}),
|
|
4249
|
+
pattern: Zn(o)
|
|
4250
|
+
}), j = Y({
|
|
4185
4251
|
name: "RangeOp",
|
|
4186
4252
|
pattern: /:/
|
|
4187
|
-
}),
|
|
4253
|
+
}), M = Y({
|
|
4188
4254
|
name: "RangeTrimFullOp",
|
|
4189
4255
|
pattern: /\.:\./
|
|
4190
|
-
}),
|
|
4256
|
+
}), N = Y({
|
|
4191
4257
|
name: "RangeTrimLeadingOp",
|
|
4192
4258
|
pattern: /\.:/
|
|
4193
|
-
}),
|
|
4259
|
+
}), P = Y({
|
|
4194
4260
|
name: "RangeTrimTrailingOp",
|
|
4195
4261
|
pattern: /:\./
|
|
4196
|
-
}),
|
|
4262
|
+
}), F = Y({
|
|
4197
4263
|
name: "OpenParen",
|
|
4198
4264
|
pattern: /\(/
|
|
4199
|
-
}), I =
|
|
4265
|
+
}), I = Y({
|
|
4200
4266
|
name: "CloseParen",
|
|
4201
4267
|
pattern: /\)/
|
|
4202
|
-
}), L =
|
|
4268
|
+
}), L = Y({
|
|
4203
4269
|
name: "OpenCurlyParen",
|
|
4204
4270
|
pattern: /{/
|
|
4205
|
-
}),
|
|
4271
|
+
}), R = Y({
|
|
4206
4272
|
name: "CloseCurlyParen",
|
|
4207
4273
|
pattern: /}/
|
|
4208
|
-
}),
|
|
4274
|
+
}), z = Y({
|
|
4209
4275
|
name: "QuoteS",
|
|
4210
4276
|
pattern: /'/
|
|
4211
|
-
}),
|
|
4277
|
+
}), oe = Y({
|
|
4212
4278
|
name: "MulOp",
|
|
4213
4279
|
pattern: /\*(?!\*)/
|
|
4214
|
-
}),
|
|
4280
|
+
}), B = Y({
|
|
4215
4281
|
name: "PlusOp",
|
|
4216
4282
|
pattern: /\+/
|
|
4217
|
-
}), se =
|
|
4283
|
+
}), se = Y({
|
|
4218
4284
|
name: "DivOp",
|
|
4219
4285
|
pattern: /\//
|
|
4220
|
-
}), ce =
|
|
4286
|
+
}), ce = Y({
|
|
4221
4287
|
name: "MinOp",
|
|
4222
4288
|
pattern: /-/
|
|
4223
|
-
}),
|
|
4289
|
+
}), V = Y({
|
|
4224
4290
|
name: "ImplicitIntersectOp",
|
|
4225
4291
|
pattern: /@/
|
|
4226
|
-
}),
|
|
4292
|
+
}), le = Y({
|
|
4227
4293
|
name: "ConcatOp",
|
|
4228
4294
|
pattern: /&/
|
|
4229
|
-
}),
|
|
4295
|
+
}), ue = Y({
|
|
4230
4296
|
name: "ExOp",
|
|
4231
4297
|
pattern: /\^/
|
|
4232
|
-
}),
|
|
4298
|
+
}), de = Y({
|
|
4233
4299
|
name: "PercentOp",
|
|
4234
4300
|
pattern: /%/
|
|
4235
|
-
}),
|
|
4301
|
+
}), fe = Y({
|
|
4236
4302
|
name: "ArrayAnchorOp",
|
|
4237
4303
|
pattern: /#/,
|
|
4238
4304
|
longer_alt: [h, g]
|
|
4239
|
-
}),
|
|
4305
|
+
}), pe = Y({
|
|
4240
4306
|
name: "GtOp",
|
|
4241
4307
|
pattern: />/
|
|
4242
|
-
}),
|
|
4308
|
+
}), H = Y({
|
|
4243
4309
|
name: "EqOp",
|
|
4244
4310
|
pattern: /=/
|
|
4245
|
-
}),
|
|
4311
|
+
}), me = Y({
|
|
4246
4312
|
name: "LtOp",
|
|
4247
4313
|
pattern: /</
|
|
4248
|
-
}),
|
|
4314
|
+
}), U = [
|
|
4315
|
+
c,
|
|
4249
4316
|
l,
|
|
4250
|
-
u,
|
|
4251
4317
|
v,
|
|
4252
4318
|
_,
|
|
4253
4319
|
y,
|
|
4320
|
+
u,
|
|
4254
4321
|
d,
|
|
4255
4322
|
f,
|
|
4256
|
-
p,
|
|
4257
4323
|
h,
|
|
4258
4324
|
g,
|
|
4259
|
-
|
|
4260
|
-
...
|
|
4325
|
+
O,
|
|
4326
|
+
...a === i ? [] : [k],
|
|
4327
|
+
A,
|
|
4328
|
+
M,
|
|
4261
4329
|
N,
|
|
4262
|
-
ee,
|
|
4263
|
-
te,
|
|
4264
|
-
F,
|
|
4265
4330
|
P,
|
|
4331
|
+
j,
|
|
4266
4332
|
S,
|
|
4267
|
-
|
|
4333
|
+
ae,
|
|
4334
|
+
ee,
|
|
4268
4335
|
C,
|
|
4269
|
-
|
|
4336
|
+
ie,
|
|
4337
|
+
T,
|
|
4270
4338
|
E,
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
pe,
|
|
4274
|
-
le,
|
|
4339
|
+
fe,
|
|
4340
|
+
V,
|
|
4275
4341
|
x,
|
|
4276
|
-
|
|
4342
|
+
F,
|
|
4277
4343
|
I,
|
|
4278
4344
|
L,
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
ae,
|
|
4345
|
+
R,
|
|
4346
|
+
z,
|
|
4282
4347
|
oe,
|
|
4348
|
+
B,
|
|
4283
4349
|
se,
|
|
4284
4350
|
ce,
|
|
4351
|
+
le,
|
|
4285
4352
|
ue,
|
|
4286
4353
|
de,
|
|
4287
|
-
|
|
4288
|
-
K({
|
|
4354
|
+
Y({
|
|
4289
4355
|
name: "NeqOp",
|
|
4290
4356
|
pattern: /<>/
|
|
4291
4357
|
}),
|
|
4292
|
-
|
|
4358
|
+
Y({
|
|
4293
4359
|
name: "GteOp",
|
|
4294
4360
|
pattern: />=/
|
|
4295
4361
|
}),
|
|
4296
|
-
|
|
4362
|
+
Y({
|
|
4297
4363
|
name: "LteOp",
|
|
4298
4364
|
pattern: /<=/
|
|
4299
4365
|
}),
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4366
|
+
pe,
|
|
4367
|
+
H,
|
|
4368
|
+
me
|
|
4303
4369
|
];
|
|
4304
|
-
this._lexer = new
|
|
4305
|
-
let
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
}),
|
|
4309
|
-
}
|
|
4310
|
-
tokenize(e,
|
|
4311
|
-
let
|
|
4312
|
-
if (
|
|
4313
|
-
let
|
|
4314
|
-
throw new
|
|
4315
|
-
line:
|
|
4316
|
-
column:
|
|
4317
|
-
offset:
|
|
4318
|
-
length:
|
|
4370
|
+
this._lexer = new J(U, { ensureOptimizations: !0 });
|
|
4371
|
+
let W = {};
|
|
4372
|
+
U.forEach((e) => {
|
|
4373
|
+
W[e.name] = e;
|
|
4374
|
+
}), a === i && (W.ColSeparator = O), this._vocabulary = W;
|
|
4375
|
+
}
|
|
4376
|
+
tokenize(e, t = !0) {
|
|
4377
|
+
let n = this._lexer.tokenize(e);
|
|
4378
|
+
if (t && n.errors.length > 0) {
|
|
4379
|
+
let t = n.errors[0], r = t.line, i = t.column, a = e.substr(t.offset, t.length || 1), o = a ? `Unexpected character '${a}'` : t.message;
|
|
4380
|
+
throw new T.Parse(o, {
|
|
4381
|
+
line: r,
|
|
4382
|
+
column: i,
|
|
4383
|
+
offset: t.offset,
|
|
4384
|
+
length: t.length
|
|
4319
4385
|
});
|
|
4320
4386
|
}
|
|
4321
|
-
return
|
|
4387
|
+
return n;
|
|
4322
4388
|
}
|
|
4323
4389
|
getVocabulary() {
|
|
4324
4390
|
return this._vocabulary;
|
|
@@ -4335,22 +4401,22 @@ var mn = class extends pn {
|
|
|
4335
4401
|
getSeparators() {
|
|
4336
4402
|
return this._locale.separators;
|
|
4337
4403
|
}
|
|
4338
|
-
},
|
|
4404
|
+
}, Un = (() => {
|
|
4339
4405
|
let e = [];
|
|
4340
4406
|
for (let t = 65; t <= 90; t++) e.push(t);
|
|
4341
4407
|
for (let t = 97; t <= 122; t++) e.push(t);
|
|
4342
4408
|
for (let t = 48; t <= 57; t++) e.push(t);
|
|
4343
4409
|
return e;
|
|
4344
|
-
})().filter((e) => e < 48 || e > 57),
|
|
4410
|
+
})().filter((e) => e < 48 || e > 57), Wn = (() => {
|
|
4345
4411
|
let e = [
|
|
4346
|
-
...
|
|
4412
|
+
...Un,
|
|
4347
4413
|
95,
|
|
4348
4414
|
92
|
|
4349
4415
|
];
|
|
4350
4416
|
for (let t = 127; t <= 65535; t++) e.push(t);
|
|
4351
4417
|
return e;
|
|
4352
|
-
})(),
|
|
4353
|
-
function
|
|
4418
|
+
})(), Gn = /* @__PURE__ */ new WeakMap(), Kn = 16384, qn = 1048576;
|
|
4419
|
+
function Jn(e, t, n) {
|
|
4354
4420
|
let r = 0;
|
|
4355
4421
|
for (let i = t; i < n; i++) {
|
|
4356
4422
|
let t = e.charCodeAt(i);
|
|
@@ -4358,7 +4424,7 @@ function xn(e, t, n) {
|
|
|
4358
4424
|
}
|
|
4359
4425
|
return r;
|
|
4360
4426
|
}
|
|
4361
|
-
function
|
|
4427
|
+
function Yn(e) {
|
|
4362
4428
|
return (t, n) => {
|
|
4363
4429
|
let r = n;
|
|
4364
4430
|
t.charCodeAt(r) === 36 && r++;
|
|
@@ -4368,7 +4434,7 @@ function Sn(e) {
|
|
|
4368
4434
|
if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
|
|
4369
4435
|
r++;
|
|
4370
4436
|
}
|
|
4371
|
-
if (r - i === 0 ||
|
|
4437
|
+
if (r - i === 0 || Jn(t, i, r) > e) return null;
|
|
4372
4438
|
if (r < t.length) {
|
|
4373
4439
|
let e = t.charCodeAt(r);
|
|
4374
4440
|
if (e >= 48 && e <= 57) return null;
|
|
@@ -4376,7 +4442,7 @@ function Sn(e) {
|
|
|
4376
4442
|
return [t.substring(n, r)];
|
|
4377
4443
|
};
|
|
4378
4444
|
}
|
|
4379
|
-
function
|
|
4445
|
+
function Xn(e, t) {
|
|
4380
4446
|
return (n, r) => {
|
|
4381
4447
|
let i = r;
|
|
4382
4448
|
n.charCodeAt(i) === 36 && i++;
|
|
@@ -4386,51 +4452,681 @@ function Cn(e, t) {
|
|
|
4386
4452
|
if (!(e >= 65 && e <= 90 || e >= 97 && e <= 122)) break;
|
|
4387
4453
|
i++;
|
|
4388
4454
|
}
|
|
4389
|
-
if (i - a === 0 ||
|
|
4455
|
+
if (i - a === 0 || Jn(n, a, i) > e) return null;
|
|
4390
4456
|
i < n.length && n.charCodeAt(i) === 36 && i++;
|
|
4391
4457
|
let o = i;
|
|
4392
|
-
|
|
4393
|
-
let s = n.charCodeAt(i);
|
|
4394
|
-
if (s < 49 || s > 57) return null;
|
|
4395
|
-
for (i++; i < n.length;) {
|
|
4458
|
+
for (; i < n.length;) {
|
|
4396
4459
|
let e = n.charCodeAt(i);
|
|
4397
4460
|
if (!(e >= 48 && e <= 57)) break;
|
|
4398
4461
|
i++;
|
|
4399
4462
|
}
|
|
4400
|
-
|
|
4463
|
+
if (i === o) return null;
|
|
4464
|
+
let s = parseInt(n.substring(o, i), 10);
|
|
4465
|
+
return s < 1 || s > t ? null : [n.substring(r, i)];
|
|
4401
4466
|
};
|
|
4402
4467
|
}
|
|
4403
|
-
function
|
|
4404
|
-
let n = e.charCodeAt(t);
|
|
4405
|
-
if (!(n >= 65 && n <= 90 || n >= 97 && n <= 122 || n === 95 || n >= 127 && n <= 65535)) return null;
|
|
4406
|
-
let r = t + 1;
|
|
4407
|
-
for (; r < e.length;) {
|
|
4408
|
-
let t = e.charCodeAt(r);
|
|
4409
|
-
if (!(t >= 65 && t <= 90 || t >= 97 && t <= 122 || t >= 48 && t <= 57 || t === 95 || t === 46 || t >= 127 && t <= 65535)) break;
|
|
4410
|
-
r++;
|
|
4411
|
-
}
|
|
4412
|
-
if (r >= e.length || e.charCodeAt(r) !== 91) return null;
|
|
4413
|
-
let i = 0;
|
|
4414
|
-
for (; r < e.length;) {
|
|
4415
|
-
let n = e.charCodeAt(r);
|
|
4416
|
-
if (n === 91) i++;
|
|
4417
|
-
else if (n === 93 && (i--, i === 0)) return [e.substring(t, r + 1)];
|
|
4418
|
-
r++;
|
|
4419
|
-
}
|
|
4420
|
-
return null;
|
|
4421
|
-
}
|
|
4422
|
-
function Tn(e) {
|
|
4468
|
+
function Zn(e) {
|
|
4423
4469
|
return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
4424
4470
|
}
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4471
|
+
var Qn = class {
|
|
4472
|
+
constructor(e = re) {
|
|
4473
|
+
let t = function(e) {
|
|
4474
|
+
let t = [...p];
|
|
4475
|
+
if (e) for (let n of Object.values(e)) {
|
|
4476
|
+
let e = n?.trim();
|
|
4477
|
+
e && !t.some((t) => t.toLowerCase() === e.toLowerCase()) && t.push(e);
|
|
4478
|
+
}
|
|
4479
|
+
return t.sort((e, t) => t.length - e.length), t.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
4480
|
+
}(e.specifiers), n = Y({
|
|
4481
|
+
name: "WhiteSpace",
|
|
4482
|
+
pattern: /\s+/,
|
|
4483
|
+
group: J.SKIPPED
|
|
4484
|
+
}), r = Y({
|
|
4485
|
+
name: "TableSpecifier",
|
|
4486
|
+
pattern: RegExp(`\\[#(?:${t})\\]`, "i")
|
|
4487
|
+
}), i = [
|
|
4488
|
+
n,
|
|
4489
|
+
r,
|
|
4490
|
+
Y({
|
|
4491
|
+
name: "BracketedColumn",
|
|
4492
|
+
pattern: /\[(?:'['#[\]]|'(?!['#[\]])|[^'[\]])*\]/,
|
|
4493
|
+
longer_alt: [r]
|
|
4494
|
+
}),
|
|
4495
|
+
Y({
|
|
4496
|
+
name: "BareSpecifier",
|
|
4497
|
+
pattern: RegExp(`#(?:${t})`, "i")
|
|
4498
|
+
}),
|
|
4499
|
+
Y({
|
|
4500
|
+
name: "ColumnSep",
|
|
4501
|
+
pattern: /:/
|
|
4502
|
+
}),
|
|
4503
|
+
Y({
|
|
4504
|
+
name: "ListSep",
|
|
4505
|
+
pattern: new RegExp(e.separators.separatorFunction.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))
|
|
4506
|
+
})
|
|
4507
|
+
];
|
|
4508
|
+
this._lexer = new J(i, { ensureOptimizations: !0 });
|
|
4509
|
+
let a = {};
|
|
4510
|
+
i.forEach((e) => {
|
|
4511
|
+
a[e.name] = e;
|
|
4512
|
+
}), this._vocabulary = a;
|
|
4513
|
+
}
|
|
4514
|
+
getVocabulary() {
|
|
4515
|
+
return this._vocabulary;
|
|
4516
|
+
}
|
|
4517
|
+
tokenize(e) {
|
|
4518
|
+
return this._lexer.tokenize(e);
|
|
4519
|
+
}
|
|
4520
|
+
}, $n = class extends Vn {
|
|
4521
|
+
constructor(e = re) {
|
|
4522
|
+
let t = new Qn(e), n = t.getVocabulary();
|
|
4523
|
+
super(n, {
|
|
4524
|
+
nodeLocationTracking: "none",
|
|
4525
|
+
maxLookahead: 2,
|
|
4526
|
+
skipValidations: !0,
|
|
4527
|
+
recoveryEnabled: !1
|
|
4528
|
+
}), this._lexer = t;
|
|
4529
|
+
let { TableSpecifier: r, BracketedColumn: i, BareSpecifier: a, ColumnSep: o, ListSep: s } = n, c = this;
|
|
4530
|
+
c.RULE("ruleContent", () => {
|
|
4531
|
+
let e = [], t = c.SUBRULE(c.ruleItem);
|
|
4532
|
+
return c.ACTION(() => {
|
|
4533
|
+
t && e.push(t);
|
|
4534
|
+
}), c.MANY(() => {
|
|
4535
|
+
c.CONSUME(s), c.OPTION(() => {
|
|
4536
|
+
let t = c.SUBRULE2(c.ruleItem);
|
|
4537
|
+
c.ACTION(() => {
|
|
4538
|
+
t && e.push(t);
|
|
4539
|
+
});
|
|
4540
|
+
});
|
|
4541
|
+
}), e;
|
|
4542
|
+
}), c.RULE("ruleItem", () => c.OR([{ ALT: () => c.SUBRULE(c.ruleSpecifier) }, { ALT: () => c.SUBRULE(c.ruleColumnOrRange) }])), c.RULE("ruleSpecifier", () => c.OR([{ ALT: () => {
|
|
4543
|
+
let t = c.CONSUME(r);
|
|
4544
|
+
return c.ACTION(() => {
|
|
4545
|
+
let n = y(t.image, e);
|
|
4546
|
+
return n.image = t.image, n;
|
|
4547
|
+
});
|
|
4548
|
+
} }, { ALT: () => {
|
|
4549
|
+
let t = c.CONSUME(a);
|
|
4550
|
+
return c.ACTION(() => {
|
|
4551
|
+
let n = y(t.image, e);
|
|
4552
|
+
return n.image = t.image, n;
|
|
4553
|
+
});
|
|
4554
|
+
} }])), c.RULE("ruleColumnOrRange", () => {
|
|
4555
|
+
let e = c.CONSUME(i), t, n;
|
|
4556
|
+
return c.OPTION(() => {
|
|
4557
|
+
t = c.CONSUME(o), n = c.CONSUME2(i);
|
|
4558
|
+
}), c.ACTION(() => {
|
|
4559
|
+
let r = v(e.image);
|
|
4560
|
+
if (r.image = e.image, !n) return r;
|
|
4561
|
+
let i = v(n.image);
|
|
4562
|
+
i.image = n.image;
|
|
4563
|
+
let a = l(":", r, i, !0);
|
|
4564
|
+
return a.image = t?.image ?? ":", a;
|
|
4565
|
+
});
|
|
4566
|
+
}), c.performSelfAnalysis();
|
|
4567
|
+
}
|
|
4568
|
+
_parseInner(e) {
|
|
4569
|
+
let t = this._lexer.tokenize(e);
|
|
4570
|
+
return t.errors.length > 0 || t.tokens.length === 0 ? [] : (this.input = t.tokens, this.reset(), this.ruleContent() ?? []);
|
|
4571
|
+
}
|
|
4572
|
+
_parseContent(e) {
|
|
4573
|
+
if (!e) return [];
|
|
4574
|
+
let t = e.trim();
|
|
4575
|
+
if (!t) return [];
|
|
4576
|
+
let n = t[0];
|
|
4577
|
+
if (n === "@") {
|
|
4578
|
+
let e = t.slice(1).trim();
|
|
4579
|
+
if (!e) {
|
|
4580
|
+
let e = g("@", null, !0);
|
|
4581
|
+
return e.image = "@", [e];
|
|
4582
|
+
}
|
|
4583
|
+
if (e.charAt(0) === "[") {
|
|
4584
|
+
let t = this._parseInner(e);
|
|
4585
|
+
if (t.length === 1 && t[0].type === "infix") {
|
|
4586
|
+
let e = g("@", t[0], !0);
|
|
4587
|
+
return e.image = "@", [e];
|
|
4588
|
+
}
|
|
4589
|
+
}
|
|
4590
|
+
let n = v(e);
|
|
4591
|
+
n.image = e;
|
|
4592
|
+
let r = g("@", n, !0);
|
|
4593
|
+
return r.image = "@", [r];
|
|
4594
|
+
}
|
|
4595
|
+
if (n !== "[" && n !== "#") {
|
|
4596
|
+
let t = v(e);
|
|
4597
|
+
return t.image = e, [t];
|
|
4598
|
+
}
|
|
4599
|
+
return this._parseInner(t);
|
|
4600
|
+
}
|
|
4601
|
+
parse(e, t, n) {
|
|
4602
|
+
this.reset();
|
|
4603
|
+
let r = () => ({
|
|
4604
|
+
root: _("", []),
|
|
4605
|
+
errors: []
|
|
4606
|
+
});
|
|
4607
|
+
if (!n) return r();
|
|
4608
|
+
let i = 0;
|
|
4609
|
+
if (n.charAt(0) === "[") {
|
|
4610
|
+
let e = n.indexOf("]");
|
|
4611
|
+
e !== -1 && n.charAt(e + 1) === "!" && (i = e + 2);
|
|
4612
|
+
}
|
|
4613
|
+
let a = n.indexOf("[", i);
|
|
4614
|
+
if (a === -1) return r();
|
|
4615
|
+
let o = n.slice(0, a), s = n.slice(a + 1, -1), c = this._parseContent(s);
|
|
4616
|
+
return {
|
|
4617
|
+
root: _(o, c),
|
|
4618
|
+
errors: this.errors.length > 0 ? [...this.errors] : []
|
|
4619
|
+
};
|
|
4620
|
+
}
|
|
4621
|
+
}, er = /* @__PURE__ */ new Set([
|
|
4622
|
+
":",
|
|
4623
|
+
".:.",
|
|
4624
|
+
".:",
|
|
4625
|
+
":."
|
|
4626
|
+
]), tr = /* @__PURE__ */ new Set([
|
|
4627
|
+
".:.",
|
|
4628
|
+
".:",
|
|
4629
|
+
":."
|
|
4630
|
+
]), nr = (e) => {
|
|
4631
|
+
if (!e) return null;
|
|
4632
|
+
if (e.type === b.Cell) {
|
|
4633
|
+
let t = e.value;
|
|
4634
|
+
return t.rowIndex === -(2 ** 53 - 1) ? "col" : t.colIndex === -(2 ** 53 - 1) ? "row" : null;
|
|
4635
|
+
}
|
|
4636
|
+
return Number.isInteger(e.value) ? "row" : null;
|
|
4637
|
+
}, rr = (e, t) => {
|
|
4638
|
+
let n = parseInt(e.charCodeAt(0) === 36 ? e.substring(1) : e, 10);
|
|
4639
|
+
return n >= 1 && n <= t;
|
|
4640
|
+
}, ir = "A formula must not be empty", ar = (e, t) => `A formula must not be longer than ${t} characters (this one is ${e})`;
|
|
4641
|
+
function or(e, t) {
|
|
4642
|
+
let n = e?.[0]?.image;
|
|
4643
|
+
if (!n) {
|
|
4644
|
+
let e = t?.image;
|
|
4645
|
+
return e ? `Expected a value after '${e}'` : "Expected a value";
|
|
4646
|
+
}
|
|
4647
|
+
return `Unexpected '${n}'`;
|
|
4435
4648
|
}
|
|
4436
|
-
|
|
4649
|
+
var sr = {
|
|
4650
|
+
...yt,
|
|
4651
|
+
buildNoViableAltMessage: (e) => or(e.actual, e.previous),
|
|
4652
|
+
buildEarlyExitMessage: (e) => or(e.actual, e.previous),
|
|
4653
|
+
buildNotAllInputParsedMessage: (e) => {
|
|
4654
|
+
let t = e.firstRedundant?.image;
|
|
4655
|
+
return t ? `Unexpected '${t}'` : yt.buildNotAllInputParsedMessage(e);
|
|
4656
|
+
},
|
|
4657
|
+
buildMismatchTokenMessage: (e) => {
|
|
4658
|
+
let t = e.actual?.image;
|
|
4659
|
+
return e.expected === X && t ? `Unexpected '${t}'` : yt.buildMismatchTokenMessage(e);
|
|
4660
|
+
}
|
|
4661
|
+
}, cr = class extends Vn {
|
|
4662
|
+
constructor(p) {
|
|
4663
|
+
let _ = p?.lexer ?? Hn.shared(p?.lexerOptions), v = _.getVocabulary();
|
|
4664
|
+
super(v, {
|
|
4665
|
+
skipValidations: !0,
|
|
4666
|
+
recoveryEnabled: !0,
|
|
4667
|
+
...p,
|
|
4668
|
+
nodeLocationTracking: "full",
|
|
4669
|
+
errorMessageProvider: sr,
|
|
4670
|
+
maxLookahead: 1
|
|
4671
|
+
}), this._ruleInfixOp = this.RULE("ruleInfixOp", () => {
|
|
4672
|
+
let { PlusOp: e, MinOp: t, MulOp: r, DivOp: i, ExOp: a, ConcatOp: o, GtOp: s, EqOp: c, LtOp: u, NeqOp: d, GteOp: f, LteOp: p } = this._vocab, m = [];
|
|
4673
|
+
return m.push({ node: this.SUBRULE(this._rulePostfixOp) }), this.MANY(() => {
|
|
4674
|
+
let n = this.OR(this._c1 ||= [
|
|
4675
|
+
{ ALT: () => this.CONSUME(e).image },
|
|
4676
|
+
{ ALT: () => this.CONSUME(t).image },
|
|
4677
|
+
{ ALT: () => this.CONSUME(r).image },
|
|
4678
|
+
{ ALT: () => this.CONSUME(i).image },
|
|
4679
|
+
{ ALT: () => this.CONSUME(a).image },
|
|
4680
|
+
{ ALT: () => this.CONSUME(o).image },
|
|
4681
|
+
{ ALT: () => this.CONSUME(s).image },
|
|
4682
|
+
{ ALT: () => this.CONSUME(c).image },
|
|
4683
|
+
{ ALT: () => this.CONSUME(u).image },
|
|
4684
|
+
{ ALT: () => this.CONSUME(d).image },
|
|
4685
|
+
{ ALT: () => this.CONSUME(f).image },
|
|
4686
|
+
{ ALT: () => this.CONSUME(p).image }
|
|
4687
|
+
]), l = {
|
|
4688
|
+
value: n,
|
|
4689
|
+
index: this.getLexerPosition(),
|
|
4690
|
+
isRange: x.includes(n)
|
|
4691
|
+
}, h = this.SUBRULE2(this._rulePostfixOp);
|
|
4692
|
+
m.push({
|
|
4693
|
+
op: l,
|
|
4694
|
+
node: h
|
|
4695
|
+
});
|
|
4696
|
+
}), this.ACTION(() => {
|
|
4697
|
+
let e = m.length - 1, t = n.length;
|
|
4698
|
+
for (let r = 0; e > 0 && r < t; r++) {
|
|
4699
|
+
let t = n[r], i = 1;
|
|
4700
|
+
for (; i < m.length;) {
|
|
4701
|
+
let n = m[i].op;
|
|
4702
|
+
if (t.includes(n.value)) {
|
|
4703
|
+
let t = m[i - 1].node, r = m[i].node, a = l(n.value, t, r, n.isRange);
|
|
4704
|
+
a = this._tag(a, n.index), m[i - 1].node = a, m.splice(i, 1), e--;
|
|
4705
|
+
} else i++;
|
|
4706
|
+
}
|
|
4707
|
+
}
|
|
4708
|
+
}), m[0].node;
|
|
4709
|
+
}), this._rulePlusMinusOp = this.RULE("rulePlusMinusOp", () => {
|
|
4710
|
+
let { PlusOp: e, MinOp: t } = this._vocab;
|
|
4711
|
+
return this.OR([{ ALT: () => this.CONSUME(e) }, { ALT: () => this.CONSUME(t) }]);
|
|
4712
|
+
}), this._rulePostfixOp = this.RULE("rulePostfixOp", () => {
|
|
4713
|
+
let { PercentOp: e } = this._vocab, t = this.SUBRULE(this._rulePrefixOp), n = [];
|
|
4714
|
+
return this.MANY(() => {
|
|
4715
|
+
let t = this.CONSUME(e).image;
|
|
4716
|
+
this.ACTION(() => {
|
|
4717
|
+
n.push([t, this.getLexerPosition()]);
|
|
4718
|
+
});
|
|
4719
|
+
}), this.ACTION(() => {
|
|
4720
|
+
let e = n.length;
|
|
4721
|
+
if (e !== 0) for (let r = 0; r < e; r++) {
|
|
4722
|
+
let e = n[r], i = e[0], a = e[1], o = x.includes(i);
|
|
4723
|
+
t = m(i, t, o), t = this._tag(t, a);
|
|
4724
|
+
}
|
|
4725
|
+
}), t;
|
|
4726
|
+
}), this._rulePrefixOp = this.RULE("rulePrefixOp", () => {
|
|
4727
|
+
let { PlusOp: e, MinOp: t, ImplicitIntersectOp: n } = this._vocab, r = [];
|
|
4728
|
+
this.MANY(() => {
|
|
4729
|
+
let i = this.OR([
|
|
4730
|
+
{ ALT: () => this.CONSUME(e).image },
|
|
4731
|
+
{ ALT: () => this.CONSUME(t).image },
|
|
4732
|
+
{ ALT: () => this.CONSUME(n).image }
|
|
4733
|
+
]);
|
|
4734
|
+
this.ACTION(() => {
|
|
4735
|
+
r.push([i, this.getLexerPosition()]);
|
|
4736
|
+
});
|
|
4737
|
+
});
|
|
4738
|
+
let i = this.SUBRULE(this._ruleRangeOp);
|
|
4739
|
+
return this.ACTION(() => {
|
|
4740
|
+
let e = r.length;
|
|
4741
|
+
if (e !== 0) for (let t = e - 1; t >= 0; t--) {
|
|
4742
|
+
let e = r[t], n = e[0], a = e[1], o = x.includes(n);
|
|
4743
|
+
i = g(n, i, o), i = this._tag(i, a);
|
|
4744
|
+
}
|
|
4745
|
+
}), i;
|
|
4746
|
+
}), this._ruleRangeOp = this.RULE("ruleRangeOp", () => {
|
|
4747
|
+
let { RangeOp: e, RangeTrimFullOp: t, RangeTrimLeadingOp: n, RangeTrimTrailingOp: r, ArrayAnchorOp: i } = this._vocab, a = [];
|
|
4748
|
+
return a.push({ node: this.SUBRULE(this._ruleCallOp) }), this.MANY2(() => {
|
|
4749
|
+
this.CONSUME(i), a.push({ anchor: this.getLexerPosition() });
|
|
4750
|
+
}), this.MANY(() => {
|
|
4751
|
+
let o = {
|
|
4752
|
+
value: this.OR(this._c2 ||= [
|
|
4753
|
+
{ ALT: () => this.CONSUME(e).image },
|
|
4754
|
+
{ ALT: () => this.CONSUME(t).image },
|
|
4755
|
+
{ ALT: () => this.CONSUME(n).image },
|
|
4756
|
+
{ ALT: () => this.CONSUME(r).image }
|
|
4757
|
+
]),
|
|
4758
|
+
index: this.getLexerPosition()
|
|
4759
|
+
}, s = this.SUBRULE2(this._ruleCallOp);
|
|
4760
|
+
a.push({
|
|
4761
|
+
op: o,
|
|
4762
|
+
node: s
|
|
4763
|
+
}), this.MANY3(() => {
|
|
4764
|
+
this.CONSUME2(i), a.push({ anchor: this.getLexerPosition() });
|
|
4765
|
+
});
|
|
4766
|
+
}), this.ACTION(() => {
|
|
4767
|
+
for (let e = 1; e < a.length; e++) {
|
|
4768
|
+
let t = a[e];
|
|
4769
|
+
if (t.anchor !== void 0) {
|
|
4770
|
+
a[0].node = this._tag(m("#", a[0].node, !0), t.anchor);
|
|
4771
|
+
continue;
|
|
4772
|
+
}
|
|
4773
|
+
let n = t.op, r = l(n.value, a[0].node, t.node, !0);
|
|
4774
|
+
r = this._tag(r, n.index), a[0].node = r;
|
|
4775
|
+
}
|
|
4776
|
+
}), a[0].node;
|
|
4777
|
+
}), this._ruleCallOp = this.RULE("ruleCallOp", () => {
|
|
4778
|
+
let { OpenParen: e, CloseParen: t } = this._vocab, n = this.SUBRULE(this._ruleFormula);
|
|
4779
|
+
return this.MANY({
|
|
4780
|
+
GATE: () => {
|
|
4781
|
+
let t = this.LA(0), n = this.LA(1);
|
|
4782
|
+
return !(!t || !n || n.tokenType !== e) && n.startOffset === t.endOffset + 1;
|
|
4783
|
+
},
|
|
4784
|
+
DEF: () => {
|
|
4785
|
+
this.CONSUME(e);
|
|
4786
|
+
let r = this.getLexerPosition(), i = this.SUBRULE(this._ruleFunctionArguments), a = n, o = this.ACTION(() => this._tag(S(a, i), r)), s = this.OPTION(() => this.CONSUME(t));
|
|
4787
|
+
this.ACTION(() => {
|
|
4788
|
+
s || this._reportError(o, "Missing closing parenthesis ')'", r), this._tagClose(o, this.getLexerPosition()), n = o;
|
|
4789
|
+
});
|
|
4790
|
+
}
|
|
4791
|
+
}), n;
|
|
4792
|
+
}), this._ruleIntersectOp = this.RULE("ruleIntersectOp", () => {
|
|
4793
|
+
let e = [this.SUBRULE(this._ruleInfixOp)];
|
|
4794
|
+
return this.MANY(() => {
|
|
4795
|
+
this.OPTION({
|
|
4796
|
+
GATE: () => {
|
|
4797
|
+
let e = this.LA(0);
|
|
4798
|
+
return this.LA(1).startOffset > e.endOffset + 1;
|
|
4799
|
+
},
|
|
4800
|
+
DEF: () => {
|
|
4801
|
+
e.push(this.SUBRULE3(this._ruleInfixOp));
|
|
4802
|
+
}
|
|
4803
|
+
});
|
|
4804
|
+
}), this.ACTION(() => {
|
|
4805
|
+
for (; e.length > 1;) {
|
|
4806
|
+
let t = e.length - 1;
|
|
4807
|
+
for (let n = 0; n < t; n++) {
|
|
4808
|
+
let r = e[n], i = e[n + 1], a = l(" ", r, i, !0), o = this._tokenMap.get(r);
|
|
4809
|
+
o && delete o.tokenIndexClose;
|
|
4810
|
+
let s = this._tokenMap.get(i), c = s?.tokenIndex;
|
|
4811
|
+
if (c !== void 0) {
|
|
4812
|
+
let e = this.input[c], t = this.input[c - 1]?.endOffset ?? -1, n = this._inputText.slice(t + 1, e.startOffset).slice(0, -1);
|
|
4813
|
+
n.length > 0 && (a.wsBefore = n);
|
|
4814
|
+
}
|
|
4815
|
+
s && delete s.tokenIndex, n + 1 < t && s && delete s.tokenIndexClose, e.splice(n, 2, a), n--, t--;
|
|
4816
|
+
}
|
|
4817
|
+
}
|
|
4818
|
+
}), e[0];
|
|
4819
|
+
}), this._ruleFormula = this.RULE("ruleFormula", () => this.OR9([
|
|
4820
|
+
{ ALT: () => this.SUBRULE(this._ruleLiteral) },
|
|
4821
|
+
{ ALT: () => this.SUBRULE(this._ruleReference) },
|
|
4822
|
+
{ ALT: () => this.SUBRULE(this._ruleFunction) },
|
|
4823
|
+
{ ALT: () => this.SUBRULE(this._ruleParen) },
|
|
4824
|
+
{ ALT: () => this.SUBRULE(this._ruleTableReference) },
|
|
4825
|
+
{ ALT: () => this.SUBRULE(this._ruleBracketedString) },
|
|
4826
|
+
{ ALT: () => this.SUBRULE(this._ruleLiteralArray) }
|
|
4827
|
+
])), this._ruleGroup = this.RULE("ruleGroup", () => {
|
|
4828
|
+
let { ArgSeparator: e } = this._vocab, t = [];
|
|
4829
|
+
return this.MANY(() => {
|
|
4830
|
+
this.CONSUME(e);
|
|
4831
|
+
let n = this.SUBRULE2(this._ruleIntersectOp);
|
|
4832
|
+
this.ACTION(() => {
|
|
4833
|
+
t.push(n);
|
|
4834
|
+
});
|
|
4835
|
+
}), t;
|
|
4836
|
+
}), this._ruleParen = this.RULE("ruleParen", () => {
|
|
4837
|
+
let { OpenParen: e, CloseParen: t } = this._vocab;
|
|
4838
|
+
return this._processParen(b.Paren, e, t);
|
|
4839
|
+
}), this._ruleLiteralArray = this.RULE("ruleLiteralArray", () => {
|
|
4840
|
+
let { OpenCurlyParen: e, CloseCurlyParen: n, ColSeparator: r, RowSeparator: i } = this._vocab, a = t();
|
|
4841
|
+
this.CONSUME(e);
|
|
4842
|
+
let o = this.getLexerPosition(), s = this.ACTION(() => this._tag(f(a), o)), c = this.SUBRULE(this._ruleLiteralForArray);
|
|
4843
|
+
this.ACTION(() => {
|
|
4844
|
+
a.value.push(c);
|
|
4845
|
+
}), this.MANY(() => {
|
|
4846
|
+
let e = !1;
|
|
4847
|
+
this.OR([{ ALT: () => {
|
|
4848
|
+
this.CONSUME(r), e = !0;
|
|
4849
|
+
} }, { ALT: () => this.CONSUME(i) }]);
|
|
4850
|
+
let n = this.SUBRULE2(this._ruleLiteralForArray);
|
|
4851
|
+
this.ACTION(() => {
|
|
4852
|
+
e || (a = t(), s.value.push(a)), a.value.push(n);
|
|
4853
|
+
});
|
|
4854
|
+
});
|
|
4855
|
+
let l = this.OPTION(() => this.CONSUME(n));
|
|
4856
|
+
return s = this.ACTION(() => (l || this._reportError(s, "Missing closing parenthesis '}'", o), this._tagClose(s, this.getLexerPosition()))), s;
|
|
4857
|
+
}), this._ruleLiteralForArray = this.RULE("ruleLiteralForArray", () => {
|
|
4858
|
+
let { StringToken: t, BooleanToken: n, LiteralError: r, RefError: o } = this._vocab;
|
|
4859
|
+
return this.OR([
|
|
4860
|
+
{ ALT: () => {
|
|
4861
|
+
let e = this.OPTION(() => this.SUBRULE(this._rulePlusMinusOp)), t = this.SUBRULE(this._ruleNumber), n = this.ACTION(() => this._tag(a(t.image, this._locale), this.getLexerPosition()));
|
|
4862
|
+
return this.ACTION(() => e ? i(e.image, n) : n);
|
|
4863
|
+
} },
|
|
4864
|
+
{ ALT: () => {
|
|
4865
|
+
let e = this.CONSUME(t);
|
|
4866
|
+
return this.ACTION(() => this._tag(s(e.image), this.getLexerPosition()));
|
|
4867
|
+
} },
|
|
4868
|
+
{ ALT: () => {
|
|
4869
|
+
let t = this.CONSUME(n);
|
|
4870
|
+
return this.ACTION(() => this._tag(e(t.image, this._locale), this.getLexerPosition()));
|
|
4871
|
+
} },
|
|
4872
|
+
{ ALT: () => {
|
|
4873
|
+
let e = this.CONSUME(r);
|
|
4874
|
+
return this.ACTION(() => this._tag(ie(e.image, this._locale), this.getLexerPosition()));
|
|
4875
|
+
} },
|
|
4876
|
+
{ ALT: () => {
|
|
4877
|
+
let e = this.CONSUME(o);
|
|
4878
|
+
return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
|
|
4879
|
+
} }
|
|
4880
|
+
]);
|
|
4881
|
+
}), this._ruleLiteral = this.RULE("ruleLiteral", () => {
|
|
4882
|
+
let { StringToken: t, BooleanToken: n, LiteralError: r, RefError: i } = this._vocab;
|
|
4883
|
+
return this.OR([
|
|
4884
|
+
{ ALT: () => {
|
|
4885
|
+
let e = this.SUBRULE(this._ruleNumber);
|
|
4886
|
+
return this.ACTION(() => this._tag(a(e.image, this._locale), this.getLexerPosition()));
|
|
4887
|
+
} },
|
|
4888
|
+
{ ALT: () => {
|
|
4889
|
+
let e = this.CONSUME(t);
|
|
4890
|
+
return this.ACTION(() => this._tag(s(e.image), this.getLexerPosition()));
|
|
4891
|
+
} },
|
|
4892
|
+
{ ALT: () => {
|
|
4893
|
+
let t = this.CONSUME(n);
|
|
4894
|
+
return this.ACTION(() => this._tag(e(t.image, this._locale), this.getLexerPosition()));
|
|
4895
|
+
} },
|
|
4896
|
+
{ ALT: () => {
|
|
4897
|
+
let e = this.CONSUME(r);
|
|
4898
|
+
return this.ACTION(() => this._tag(ie(e.image, this._locale), this.getLexerPosition()));
|
|
4899
|
+
} },
|
|
4900
|
+
{ ALT: () => {
|
|
4901
|
+
let e = this.CONSUME(i);
|
|
4902
|
+
return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
|
|
4903
|
+
} }
|
|
4904
|
+
]);
|
|
4905
|
+
}), this._ruleFunction = this.RULE("ruleFunction", () => {
|
|
4906
|
+
let { FunctionToken: e, OpenParen: t, CloseParen: n } = this._vocab, r = this.CONSUME(e).image, i = this.getLexerPosition();
|
|
4907
|
+
this.CONSUME(t);
|
|
4908
|
+
let a = this.SUBRULE(this._ruleFunctionArguments), s = this.ACTION(() => this._tag(o(r, a), i)), c = this.OPTION(() => this.CONSUME(n));
|
|
4909
|
+
return s = this.ACTION(() => (c || this._reportError(s, "Missing closing parenthesis ')'", i), this._tagClose(s, this.getLexerPosition()))), s;
|
|
4910
|
+
}), this._ruleFunctionArguments = this.RULE("ruleFunctionArguments", () => {
|
|
4911
|
+
let { ArgSeparator: e, CloseParen: t } = this._vocab, n = [];
|
|
4912
|
+
return this.OPTION({
|
|
4913
|
+
GATE: () => this.LA(1).tokenType !== t,
|
|
4914
|
+
DEF: () => {
|
|
4915
|
+
let t;
|
|
4916
|
+
this.OPTION2(() => {
|
|
4917
|
+
t = this.SUBRULE(this._ruleIntersectOp);
|
|
4918
|
+
}), t = this.ACTION(() => t ?? this._tagClose(r(), this.getLexerPosition())), n.push(t), this.MANY(() => {
|
|
4919
|
+
let t;
|
|
4920
|
+
this.CONSUME(e), this.OPTION3(() => {
|
|
4921
|
+
t = this.SUBRULE2(this._ruleIntersectOp);
|
|
4922
|
+
}), t = this.ACTION(() => t ?? this._tagClose(r(), this.getLexerPosition())), n.push(t);
|
|
4923
|
+
});
|
|
4924
|
+
}
|
|
4925
|
+
}), n;
|
|
4926
|
+
}), this._ruleBracketedString = this.RULE("ruleBracketedString", () => {
|
|
4927
|
+
let { BracketedString: e } = this._vocab, t = this.CONSUME(e), n = this.getLexerPosition();
|
|
4928
|
+
return this.ACTION(() => {
|
|
4929
|
+
let e = this._srParser.parse(this.rowIndex, this.colIndex, t.image);
|
|
4930
|
+
for (let t of e.errors) this._astErrors.push(t);
|
|
4931
|
+
return this._tag(e.root, n);
|
|
4932
|
+
});
|
|
4933
|
+
}), this._ruleTableReference = this.RULE("ruleTableReference", () => {
|
|
4934
|
+
let { TableReference: e } = this._vocab, t = this.CONSUME(e), n = this.getLexerPosition();
|
|
4935
|
+
return this.ACTION(() => {
|
|
4936
|
+
let e = this._srParser.parse(this.rowIndex, this.colIndex, t.image);
|
|
4937
|
+
for (let t of e.errors) this._astErrors.push(t);
|
|
4938
|
+
return this._tag(e.root, n);
|
|
4939
|
+
});
|
|
4940
|
+
}), this._ruleReference = this.RULE("ruleReference", () => {
|
|
4941
|
+
let { Sheet: e, SheetQuoted: t, DivOp: n, MulOp: r, PlusOp: i, MinOp: a, ArgSeparator: o, Cell: s, NamedToken: l, SingleQuotedString: f, Column: p, AbsRow: m, DigitToken: g, RefError: _ } = this._vocab, v, y;
|
|
4942
|
+
this.OPTION2({
|
|
4943
|
+
GATE: () => {
|
|
4944
|
+
for (let s = 1; s < 6; s++) {
|
|
4945
|
+
let c = this.LA(s);
|
|
4946
|
+
if (c.tokenType === e || c.tokenType === t) return !0;
|
|
4947
|
+
if (c.image === "" || c.image === ")" || c.tokenType === n || c.tokenType === r || c.tokenType === i || c.tokenType === a || c.tokenType === o) break;
|
|
4948
|
+
}
|
|
4949
|
+
return !1;
|
|
4950
|
+
},
|
|
4951
|
+
DEF: () => {
|
|
4952
|
+
y = this.getLexerPosition() + 1, v = this.SUBRULE(this._rulePrefixSheetName);
|
|
4953
|
+
}
|
|
4954
|
+
});
|
|
4955
|
+
let x = this.OR([
|
|
4956
|
+
{ ALT: () => {
|
|
4957
|
+
let e = this.CONSUME(s), t = this.getLexerPosition();
|
|
4958
|
+
return this.ACTION(() => this._tag(u(e.image, this.rowIndex, this.colIndex), t));
|
|
4959
|
+
} },
|
|
4960
|
+
{ ALT: () => {
|
|
4961
|
+
let e = this.OR2([{ ALT: () => this.CONSUME(l) }, { ALT: () => this.CONSUME(f) }]);
|
|
4962
|
+
return this.ACTION(() => this._tag(h(e.image), this.getLexerPosition()));
|
|
4963
|
+
} },
|
|
4964
|
+
{ ALT: () => this.SUBRULE(this._ruleBracketedString) },
|
|
4965
|
+
{ ALT: () => this.SUBRULE(this._ruleFunction) },
|
|
4966
|
+
{ ALT: () => {
|
|
4967
|
+
let e = this.CONSUME(p);
|
|
4968
|
+
return this.ACTION(() => this._tag(d(e.image, this.colIndex), this.getLexerPosition()));
|
|
4969
|
+
} },
|
|
4970
|
+
{ ALT: () => {
|
|
4971
|
+
let e = this.CONSUME(m);
|
|
4972
|
+
return this.ACTION(() => this._tag(w(e.image, this.rowIndex), this.getLexerPosition()));
|
|
4973
|
+
} },
|
|
4974
|
+
{ ALT: () => {
|
|
4975
|
+
let e = this.CONSUME(g);
|
|
4976
|
+
return this.ACTION(() => this._tag(w(e.image, this.rowIndex), this.getLexerPosition()));
|
|
4977
|
+
} },
|
|
4978
|
+
{ ALT: () => {
|
|
4979
|
+
let e = this.CONSUME(_);
|
|
4980
|
+
return this.ACTION(() => this._tag(c(e.image, this._locale), this.getLexerPosition()));
|
|
4981
|
+
} }
|
|
4982
|
+
]);
|
|
4983
|
+
return this.ACTION(() => {
|
|
4984
|
+
if (v && x) {
|
|
4985
|
+
if (v.name === "") return void this._reportError(x, `'${v.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);
|
|
4986
|
+
let e = x;
|
|
4987
|
+
if (x.type === b.Postfix && x.inputs?.[0] && (e = x.inputs[0]), e.type === b.Cell || e.type === b.Named || e.type === b.Row || e.type === b.TableColumn || e.type === b.Error) {
|
|
4988
|
+
e.value.scope = v.name, e.value.scopeImage = v.image;
|
|
4989
|
+
let t = this._tokenMap.get(e);
|
|
4990
|
+
t && y !== void 0 && (t.tokenIndex = y);
|
|
4991
|
+
}
|
|
4992
|
+
}
|
|
4993
|
+
}), x;
|
|
4994
|
+
}), this._rulePrefixSheetName = this.RULE("rulePrefixSheetName", () => {
|
|
4995
|
+
let { SheetQuoted: e, BracketedString: t, NamedToken: n, RangeOp: r, Sheet: i } = this._vocab;
|
|
4996
|
+
return this.OR([{ ALT: () => {
|
|
4997
|
+
let t = this.CONSUME(e).image;
|
|
4998
|
+
return {
|
|
4999
|
+
name: t.slice(1, -2).replace(/''/g, "'"),
|
|
5000
|
+
image: t
|
|
5001
|
+
};
|
|
5002
|
+
} }, { ALT: () => {
|
|
5003
|
+
let e = "";
|
|
5004
|
+
this.OPTION(() => {
|
|
5005
|
+
e += this.CONSUME(t).image;
|
|
5006
|
+
}), this.OPTION2({
|
|
5007
|
+
GATE: () => this.LA(2).tokenType === r,
|
|
5008
|
+
DEF: () => {
|
|
5009
|
+
e += this.CONSUME(n).image, this.CONSUME(r), e += ":";
|
|
5010
|
+
}
|
|
5011
|
+
});
|
|
5012
|
+
let a = this.CONSUME(i).image;
|
|
5013
|
+
return {
|
|
5014
|
+
name: e + a.slice(0, -1),
|
|
5015
|
+
image: e + a
|
|
5016
|
+
};
|
|
5017
|
+
} }]);
|
|
5018
|
+
}), this._ruleNumber = this.RULE("ruleNumber", () => {
|
|
5019
|
+
let { NumberToken: e, ScientificDigit: t, DigitToken: n } = this._vocab;
|
|
5020
|
+
return this.OR([
|
|
5021
|
+
{ ALT: () => this.CONSUME(e) },
|
|
5022
|
+
{ ALT: () => this.CONSUME(t) },
|
|
5023
|
+
{ ALT: () => this.CONSUME(n) }
|
|
5024
|
+
]);
|
|
5025
|
+
}), this._ruleRoot = this.RULE("ruleRoot", () => {
|
|
5026
|
+
let { ArgSeparator: e } = this._vocab, t = this.SUBRULE(this._ruleIntersectOp), n = [];
|
|
5027
|
+
return this.MANY(() => {
|
|
5028
|
+
this.CONSUME(e), n.push(this.SUBRULE2(this._ruleIntersectOp));
|
|
5029
|
+
}), this.ACTION(() => n.length === 0 ? t : {
|
|
5030
|
+
type: b.List,
|
|
5031
|
+
value: ",",
|
|
5032
|
+
inputs: [t, ...n],
|
|
5033
|
+
isReference: !0
|
|
5034
|
+
});
|
|
5035
|
+
}), this._lexer = _, this._locale = _.getLocale(), this._vocab = v, this._srParser = p?.srParser ?? new $n(this._locale), this.performSelfAnalysis();
|
|
5036
|
+
}
|
|
5037
|
+
getLexer() {
|
|
5038
|
+
return this._lexer;
|
|
5039
|
+
}
|
|
5040
|
+
parse(e, t, n) {
|
|
5041
|
+
let r = this._lexer.tokenize(n), i;
|
|
5042
|
+
if (!r) return {
|
|
5043
|
+
root: {
|
|
5044
|
+
type: b.Unparsed,
|
|
5045
|
+
value: n
|
|
5046
|
+
},
|
|
5047
|
+
errors: []
|
|
5048
|
+
};
|
|
5049
|
+
let a = r.tokens;
|
|
5050
|
+
if (a.length === 0) throw new T.Parse(ir);
|
|
5051
|
+
return this.input = a, this._inputText = n, this._inputTextLength = n.length, this.rowIndex = e, this.colIndex = t, this._astErrors = [], this._tokenMap = /* @__PURE__ */ new Map(), this.reset(), i = this._ruleRoot(), i && this._bindAllWhitespace(i), i = C(i, (t, n) => {
|
|
5052
|
+
let r = t.type, i = n?.isReference ? n.value : void 0, a = typeof i == "string" && er.has(i), o = typeof i == "string" && tr.has(i), s = a ? n.inputs : void 0, c = s ? s[0] === t ? s[1] : s[0] : void 0, l = this._lexer.getMaxRow();
|
|
5053
|
+
if (a && r !== b.Cell && Number.isInteger(t.value)) {
|
|
5054
|
+
let n = w(t.image, e);
|
|
5055
|
+
return ee(n, t), nr(c) === "row" ? rr(t.image, l) || this._reportError(n, `'${t.image}' is not a valid row — rows run from 1 to ${l}`) : this._reportError(n, `'${t.image}' is not a valid reference — a whole row can only pair with another row (as in ${t.image}:${t.image})`), n;
|
|
5056
|
+
}
|
|
5057
|
+
if (o && r === b.Named) return this._reportError(t, `'${t.image ?? t.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`), t;
|
|
5058
|
+
if (r === b.Cell) {
|
|
5059
|
+
let e = t.value, n = e.colIndex === -(2 ** 53 - 1), r = e.rowIndex === -(2 ** 53 - 1);
|
|
5060
|
+
if ((n || r) && nr(c) === (n ? "row" : "col")) return n && !rr(t.image, l) && this._reportError(t, `'${t.image}' is not a valid row — rows run from 1 to ${l}`), t;
|
|
5061
|
+
if (n || r || e.colIndex >= 16384) {
|
|
5062
|
+
let a = h(t.image);
|
|
5063
|
+
ee(a, t);
|
|
5064
|
+
let s = e.scope;
|
|
5065
|
+
return s && (a.value.scope = s, a.value.scopeImage = e.scopeImage), n ? this._reportError(a, `'${t.image}' is not a valid reference — a row needs a column (use ${t.image}:${t.image} for the whole row)`) : r && t.image.includes("$") ? this._reportError(a, `'${t.image}' is not a valid reference — a whole column can only pair with another column (as in ${t.image}:${t.image})`) : o && this._reportError(a, `'${t.image}' is a name — '${i}' needs a cell or range on both sides`), a;
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
return t;
|
|
5069
|
+
}), {
|
|
5070
|
+
root: i,
|
|
5071
|
+
errors: [...this.errors, ...this._astErrors]
|
|
5072
|
+
};
|
|
5073
|
+
}
|
|
5074
|
+
_processParen(e, t, n) {
|
|
5075
|
+
let r;
|
|
5076
|
+
this.CONSUME(t);
|
|
5077
|
+
let i = this.getLexerPosition();
|
|
5078
|
+
r = this.ACTION(() => (r = {
|
|
5079
|
+
type: e,
|
|
5080
|
+
value: null,
|
|
5081
|
+
inputs: null
|
|
5082
|
+
}, this._tag(r, i)));
|
|
5083
|
+
let a = [], o = this.SUBRULE(this._ruleIntersectOp);
|
|
5084
|
+
o && a.push(o);
|
|
5085
|
+
let s = this.SUBRULE(this._ruleGroup), c = this.OPTION(() => this.CONSUME(n));
|
|
5086
|
+
return r = this.ACTION(() => {
|
|
5087
|
+
if (s) for (let e = 0; e < s.length; e++) a.push(s[e]);
|
|
5088
|
+
return r && (c || this._reportError(r, "Missing closing parenthesis", i), r.inputs = a), this._tagClose(r, this.getLexerPosition());
|
|
5089
|
+
}), r;
|
|
5090
|
+
}
|
|
5091
|
+
_reportError(e, t, n = void 0, r = "SyntaxError") {
|
|
5092
|
+
n === void 0 && (n = this.getLexerPosition()), e.error = !0, this._astErrors.push({
|
|
5093
|
+
name: r,
|
|
5094
|
+
message: t,
|
|
5095
|
+
previousToken: this.input[n],
|
|
5096
|
+
ast: e
|
|
5097
|
+
});
|
|
5098
|
+
}
|
|
5099
|
+
_tag(e, t) {
|
|
5100
|
+
return e ? (e.image ??= this.input[t].image, this._tokenMap.set(e, {
|
|
5101
|
+
tokenIndex: t,
|
|
5102
|
+
tokenIndexClose: t
|
|
5103
|
+
}), e) : (console.warn("node is null"), e);
|
|
5104
|
+
}
|
|
5105
|
+
_tagClose(e, t) {
|
|
5106
|
+
let n = this._tokenMap.get(e);
|
|
5107
|
+
return n ? n.tokenIndexClose = t : this._tokenMap.set(e, { tokenIndexClose: t }), e;
|
|
5108
|
+
}
|
|
5109
|
+
_bindNodeWhitespace(e) {
|
|
5110
|
+
let t = this._tokenMap.get(e);
|
|
5111
|
+
if (!t) return;
|
|
5112
|
+
let n = this.input, r = this._inputText, i = t.tokenIndex;
|
|
5113
|
+
if (i !== void 0) {
|
|
5114
|
+
let t = n[i], a = n[i - 1]?.endOffset ?? -1;
|
|
5115
|
+
a + 1 < t.startOffset && (e.wsBefore = r.slice(a + 1, t.startOffset));
|
|
5116
|
+
}
|
|
5117
|
+
let a = t.tokenIndexClose;
|
|
5118
|
+
if (a !== void 0) {
|
|
5119
|
+
let t = n[a], i = n[a + 1]?.startOffset ?? this._inputTextLength;
|
|
5120
|
+
t.endOffset + 1 < i && (e.wsAfter = r.slice(t.endOffset + 1, i));
|
|
5121
|
+
}
|
|
5122
|
+
}
|
|
5123
|
+
_bindAllWhitespace(e) {
|
|
5124
|
+
if (e) {
|
|
5125
|
+
if (this._bindNodeWhitespace(e), e.inputs) for (let t of e.inputs) t && this._bindAllWhitespace(t);
|
|
5126
|
+
if (e.type === b.Array && Array.isArray(e.value)) {
|
|
5127
|
+
for (let t of e.value) if (t && Array.isArray(t.value)) for (let e of t.value) e && this._bindAllWhitespace(e);
|
|
5128
|
+
}
|
|
5129
|
+
}
|
|
5130
|
+
}
|
|
5131
|
+
};
|
|
5132
|
+
export { Hn as i, ar as n, cr as r, ir as t };
|