xmlui 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Pdf-DeGhSMXe.mjs +19537 -0
- package/dist/Pdf.css +1 -0
- package/dist/apiInterceptorWorker-CwuUhYyc.mjs +9229 -0
- package/dist/array-USo-Szhp.mjs +12 -0
- package/dist/index-C24dkfpd.mjs +1434 -0
- package/dist/index-ao27SnVp.mjs +145185 -0
- package/dist/index.css +1 -0
- package/dist/nivo-bar.es-CWh0ZlxB.mjs +1666 -0
- package/dist/nivo-geo.es-BTqNt5Db.mjs +1579 -0
- package/dist/nivo-legends.es-BuIxHGSU.mjs +6916 -0
- package/dist/nivo-pie.es-BvCBFA0L.mjs +700 -0
- package/dist/react-apexcharts.min-DqWuDOyO.mjs +8881 -0
- package/dist/scripts/bin/bootstrap.js +11 -0
- package/dist/scripts/bin/build.js +256 -0
- package/dist/scripts/bin/index.js +88 -0
- package/dist/scripts/bin/preview.js +27 -0
- package/dist/scripts/bin/start.js +41 -0
- package/dist/scripts/bin/vite-ueml-plugin.js +113 -0
- package/dist/scripts/bin/viteConfig.js +112 -0
- package/dist/scripts/src/abstractions/ActionDefs.js +2 -0
- package/dist/scripts/src/abstractions/AppContextDefs.js +2 -0
- package/dist/scripts/src/abstractions/BlockScope.js +4 -0
- package/dist/scripts/src/abstractions/ComponentDefs.js +2 -0
- package/dist/scripts/src/abstractions/ComponentDescriptorDefs.js +2 -0
- package/dist/scripts/src/abstractions/ContainerDefs.js +2 -0
- package/dist/scripts/src/abstractions/FunctionDefs.js +2 -0
- package/dist/scripts/src/abstractions/RendererDefs.js +2 -0
- package/dist/scripts/src/abstractions/scripting/ScriptParserError.js +2 -0
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTree.js +2 -0
- package/dist/scripts/src/abstractions/scripting/Token.js +110 -0
- package/dist/scripts/src/components/App/App.js +253 -0
- package/dist/scripts/src/components/App/AppLayoutContext.js +9 -0
- package/dist/scripts/src/components/App/AppStateContext.js +9 -0
- package/dist/scripts/src/components/App/Sheet.js +89 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +121 -0
- package/dist/scripts/src/components/AppState/AppState.js +29 -0
- package/dist/scripts/src/components/Avatar/Avatar.js +81 -0
- package/dist/scripts/src/components/Badge/Badge.js +56 -0
- package/dist/scripts/src/components/BarChart/BarChart.js +199 -0
- package/dist/scripts/src/components/Bookmark/Bookmark.js +11 -0
- package/dist/scripts/src/components/Button/Button.js +196 -0
- package/dist/scripts/src/components/Card/Card.js +65 -0
- package/dist/scripts/src/components/ChangeListener/ChangeListener.js +43 -0
- package/dist/scripts/src/components/Chart/Chart.js +158 -0
- package/dist/scripts/src/components/Checkbox/Checkbox.js +43 -0
- package/dist/scripts/src/components/Combobox/Combobox.js +145 -0
- package/dist/scripts/src/components/ComponentProvider.js +357 -0
- package/dist/scripts/src/components/ContentSeparator/ContentSeparator.js +40 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +196 -0
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +175 -0
- package/dist/scripts/src/components/EmojiSelector/EmojiSelector.js +56 -0
- package/dist/scripts/src/components/FileInput/FileInput.js +127 -0
- package/dist/scripts/src/components/FileUploadDropZone/FileUploadDropZone.js +106 -0
- package/dist/scripts/src/components/FlowLayout/FlowLayout.js +139 -0
- package/dist/scripts/src/components/Footer/Footer.js +42 -0
- package/dist/scripts/src/components/Form/Form.js +320 -0
- package/dist/scripts/src/components/Form/FormContext.js +9 -0
- package/dist/scripts/src/components/Form/formActions.js +86 -0
- package/dist/scripts/src/components/FormItem/FormItem.js +204 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +27 -0
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +39 -0
- package/dist/scripts/src/components/FormItem/Validations.js +346 -0
- package/dist/scripts/src/components/FormSection/FormSection.js +45 -0
- package/dist/scripts/src/components/Heading/Heading.js +206 -0
- package/dist/scripts/src/components/HoverCard/HoverCard.js +45 -0
- package/dist/scripts/src/components/Icon/ApiIcon.js +10 -0
- package/dist/scripts/src/components/Icon/Attach.js +10 -0
- package/dist/scripts/src/components/Icon/Binding.js +11 -0
- package/dist/scripts/src/components/Icon/BoardIcon.js +7 -0
- package/dist/scripts/src/components/Icon/BoxIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CheckIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronDownIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronLeft.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronRight.js +7 -0
- package/dist/scripts/src/components/Icon/ChevronUpIcon.js +7 -0
- package/dist/scripts/src/components/Icon/CodeFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/CodeSandbox.js +10 -0
- package/dist/scripts/src/components/Icon/CompactListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ContentCopyIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DatabaseIcon.js +11 -0
- package/dist/scripts/src/components/Icon/DocFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DocIcon.js +10 -0
- package/dist/scripts/src/components/Icon/DotMenuHorizontalIcon.js +7 -0
- package/dist/scripts/src/components/Icon/DotMenuIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmailIcon.js +7 -0
- package/dist/scripts/src/components/Icon/EmptyFolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/ErrorIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ExpressionIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FillPlusCricleIcon.js +7 -0
- package/dist/scripts/src/components/Icon/FilterIcon.js +10 -0
- package/dist/scripts/src/components/Icon/FolderIcon.js +10 -0
- package/dist/scripts/src/components/Icon/GlobeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HomeIcon.js +7 -0
- package/dist/scripts/src/components/Icon/HyperLinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/Icon.js +101 -0
- package/dist/scripts/src/components/Icon/ImageFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/LinkIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/LooseListIcon.js +7 -0
- package/dist/scripts/src/components/Icon/MoonIcon.js +10 -0
- package/dist/scripts/src/components/Icon/MoreOptionsIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PDFIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PenIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhoneIcon.js +7 -0
- package/dist/scripts/src/components/Icon/PhotoIcon.js +10 -0
- package/dist/scripts/src/components/Icon/PlusIcon.js +7 -0
- package/dist/scripts/src/components/Icon/SearchIcon.js +7 -0
- package/dist/scripts/src/components/Icon/ShareIcon.js +10 -0
- package/dist/scripts/src/components/Icon/SunIcon.js +10 -0
- package/dist/scripts/src/components/Icon/TrashIcon.js +7 -0
- package/dist/scripts/src/components/Icon/TxtIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnknownFileIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UnlinkIcon.js +10 -0
- package/dist/scripts/src/components/Icon/UserIcon.js +7 -0
- package/dist/scripts/src/components/Icon/WarningIcon.js +7 -0
- package/dist/scripts/src/components/Icon/XlsIcon.js +10 -0
- package/dist/scripts/src/components/IconProvider.js +249 -0
- package/dist/scripts/src/components/IconRegistryContext.js +307 -0
- package/dist/scripts/src/components/Image/Image.js +34 -0
- package/dist/scripts/src/components/Input/InputAdornment.js +14 -0
- package/dist/scripts/src/components/Input/input-abstractions.js +44 -0
- package/dist/scripts/src/components/Items/Items.js +48 -0
- package/dist/scripts/src/components/Link/Link.js +72 -0
- package/dist/scripts/src/components/List/List.js +442 -0
- package/dist/scripts/src/components/Logo/Logo.js +25 -0
- package/dist/scripts/src/components/Map/Map.js +60 -0
- package/dist/scripts/src/components/Map/world_countries.json +45307 -0
- package/dist/scripts/src/components/Markdown/Markdown.js +120 -0
- package/dist/scripts/src/components/ModalDialog/ConfirmationModalContextProvider.js +106 -0
- package/dist/scripts/src/components/ModalDialog/Dialog.js +20 -0
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +145 -0
- package/dist/scripts/src/components/MultiCombobox/MultiCombobox.js +249 -0
- package/dist/scripts/src/components/MultiSelect/MultiSelect.js +192 -0
- package/dist/scripts/src/components/NavGroup/NavGroup.js +113 -0
- package/dist/scripts/src/components/NavLink/NavLink.js +115 -0
- package/dist/scripts/src/components/NavPanel/NavPanel.js +101 -0
- package/dist/scripts/src/components/NoResult/NoResult.js +39 -0
- package/dist/scripts/src/components/NumberBox/NumberBox.js +373 -0
- package/dist/scripts/src/components/Option/Option.js +41 -0
- package/dist/scripts/src/components/PageMetaTitle/PageMetaTitle.js +22 -0
- package/dist/scripts/src/components/Pages/Pages.js +74 -0
- package/dist/scripts/src/components/Pdf/LazyPdf.js +44 -0
- package/dist/scripts/src/components/Pdf/Pdf.js +19 -0
- package/dist/scripts/src/components/PieChart/PieChart.js +184 -0
- package/dist/scripts/src/components/PositionedContainer/PositionedContainer.js +29 -0
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +38 -0
- package/dist/scripts/src/components/Queue/Queue.js +286 -0
- package/dist/scripts/src/components/Queue/queueActions.js +87 -0
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +144 -0
- package/dist/scripts/src/components/RealTimeAdapter/RealTimeAdapter.js +147 -0
- package/dist/scripts/src/components/Redirect/Redirect.js +10 -0
- package/dist/scripts/src/components/Select/Select.js +139 -0
- package/dist/scripts/src/components/Select/SelectContext.js +45 -0
- package/dist/scripts/src/components/SelectionStore/SelectionStore.js +88 -0
- package/dist/scripts/src/components/SpaceFiller/SpaceFiller.js +22 -0
- package/dist/scripts/src/components/Spinner/Spinner.js +59 -0
- package/dist/scripts/src/components/Splitter/Splitter.js +205 -0
- package/dist/scripts/src/components/Splitter/utils.js +17 -0
- package/dist/scripts/src/components/Stack/Stack.js +117 -0
- package/dist/scripts/src/components/StickyBox/StickyBox.js +33 -0
- package/dist/scripts/src/components/Switch/Switch.js +50 -0
- package/dist/scripts/src/components/Table/Table.js +499 -0
- package/dist/scripts/src/components/Table/useRowSelection.js +169 -0
- package/dist/scripts/src/components/TableColumnDef/TableColumnDef.js +44 -0
- package/dist/scripts/src/components/TableColumnDef/TableContext.js +12 -0
- package/dist/scripts/src/components/Tabs/Tabs.js +85 -0
- package/dist/scripts/src/components/Text/Text.js +175 -0
- package/dist/scripts/src/components/TextArea/TextArea.js +194 -0
- package/dist/scripts/src/components/TextArea/TextAreaResizable.js +63 -0
- package/dist/scripts/src/components/TextArea/useComposedRef.js +50 -0
- package/dist/scripts/src/components/TextBox/TextBox.js +145 -0
- package/dist/scripts/src/components/Theme/NotificationToast.js +39 -0
- package/dist/scripts/src/components/Theme/Theme.js +153 -0
- package/dist/scripts/src/components/ThemeChanger/ThemeChanger.js +125 -0
- package/dist/scripts/src/components/Toggle/Toggle.js +88 -0
- package/dist/scripts/src/components/Tree/TreeComponent.js +79 -0
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +59 -0
- package/dist/scripts/src/components/ViewComponentRegistryContext.js +34 -0
- package/dist/scripts/src/components/abstractions.js +2 -0
- package/dist/scripts/src/components/chart-color-schemes.js +43 -0
- package/dist/scripts/src/components/component-utils.js +32 -0
- package/dist/scripts/src/components/container-helpers.js +18 -0
- package/dist/scripts/src/components-core/ApiBoundComponent.js +189 -0
- package/dist/scripts/src/components-core/AppContext.js +17 -0
- package/dist/scripts/src/components-core/ChildrenSlot.js +10 -0
- package/dist/scripts/src/components-core/Component.js +280 -0
- package/dist/scripts/src/components-core/ComponentDecorator.js +63 -0
- package/dist/scripts/src/components-core/CompoundComponent.js +132 -0
- package/dist/scripts/src/components-core/EngineError.js +91 -0
- package/dist/scripts/src/components-core/ErrorBoundary.js +58 -0
- package/dist/scripts/src/components-core/Fragment.js +14 -0
- package/dist/scripts/src/components-core/InvalidComponent.js +15 -0
- package/dist/scripts/src/components-core/LoaderComponent.js +78 -0
- package/dist/scripts/src/components-core/RestApiProxy.js +341 -0
- package/dist/scripts/src/components-core/RootComponent.js +272 -0
- package/dist/scripts/src/components-core/RouteContext.js +45 -0
- package/dist/scripts/src/components-core/ScrollContext.js +9 -0
- package/dist/scripts/src/components-core/UnknownComponent.js +15 -0
- package/dist/scripts/src/components-core/abstractions/ComponentRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/LoaderRenderer.js +2 -0
- package/dist/scripts/src/components-core/abstractions/containers.js +18 -0
- package/dist/scripts/src/components-core/abstractions/treeAbstractions.js +2 -0
- package/dist/scripts/src/components-core/action/ApiAction.js +276 -0
- package/dist/scripts/src/components-core/action/DownloadFileAction.js +80 -0
- package/dist/scripts/src/components-core/action/NavigateAction.js +20 -0
- package/dist/scripts/src/components-core/action/TimedAction.js +21 -0
- package/dist/scripts/src/components-core/action/UploadAction.js +88 -0
- package/dist/scripts/src/components-core/action/actions.js +15 -0
- package/dist/scripts/src/components-core/appContext/date-functions.js +19 -0
- package/dist/scripts/src/components-core/appContext/misc-utils.js +12 -0
- package/dist/scripts/src/components-core/component-hooks.js +25 -0
- package/dist/scripts/src/components-core/constants.js +18 -0
- package/dist/scripts/src/components-core/container/Container.js +1110 -0
- package/dist/scripts/src/components-core/container/ContainerComponentDef.js +16 -0
- package/dist/scripts/src/components-core/container/buildProxy.js +54 -0
- package/dist/scripts/src/components-core/container/collectFnVarDeps.js +26 -0
- package/dist/scripts/src/components-core/container/valueExtractor.js +195 -0
- package/dist/scripts/src/components-core/descriptorHelper.js +75 -0
- package/dist/scripts/src/components-core/interception/abstractions.js +2 -0
- package/dist/scripts/src/components-core/interception/useApiInterceptorContext.js +9 -0
- package/dist/scripts/src/components-core/loader/ApiLoader.js +46 -0
- package/dist/scripts/src/components-core/loader/DataLoader.js +160 -0
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +52 -0
- package/dist/scripts/src/components-core/loader/Loader.js +115 -0
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +32 -0
- package/dist/scripts/src/components-core/loader/PageableLoader.js +240 -0
- package/dist/scripts/src/components-core/renderers.js +45 -0
- package/dist/scripts/src/components-core/reportEngineError.js +59 -0
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +35 -0
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +34 -0
- package/dist/scripts/src/components-core/script-runner/LogicalThread.js +2 -0
- package/dist/scripts/src/components-core/script-runner/LoopScope.js +2 -0
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +117 -0
- package/dist/scripts/src/components-core/script-runner/TryScope.js +2 -0
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +96 -0
- package/dist/scripts/src/components-core/script-runner/bannedFunctions.js +34 -0
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +40 -0
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +40 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +551 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +498 -0
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +434 -0
- package/dist/scripts/src/components-core/script-runner/modules.js +250 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +818 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +193 -0
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +740 -0
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +62 -0
- package/dist/scripts/src/components-core/script-runner/visitors.js +352 -0
- package/dist/scripts/src/components-core/theming/ThemeContext.js +43 -0
- package/dist/scripts/src/components-core/theming/ThemeProvider.js +334 -0
- package/dist/scripts/src/components-core/theming/abstractions.js +11 -0
- package/dist/scripts/src/components-core/theming/extendThemeUtils.js +114 -0
- package/dist/scripts/src/components-core/theming/hvar.js +105 -0
- package/dist/scripts/src/components-core/theming/themeVars.js +62 -0
- package/dist/scripts/src/components-core/theming/themes/base-utils.js +31 -0
- package/dist/scripts/src/components-core/theming/themes/palette.js +53 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +257 -0
- package/dist/scripts/src/components-core/theming/themes/solid.js +16 -0
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +407 -0
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +32 -0
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +286 -0
- package/dist/scripts/src/components-core/utils/DataLoaderQueryKeyGenerator.js +34 -0
- package/dist/scripts/src/components-core/utils/LruCache.js +184 -0
- package/dist/scripts/src/components-core/utils/actionUtils.js +32 -0
- package/dist/scripts/src/components-core/utils/classnames.js +58 -0
- package/dist/scripts/src/components-core/utils/css-utils.js +127 -0
- package/dist/scripts/src/components-core/utils/date-utils.js +78 -0
- package/dist/scripts/src/components-core/utils/extractParam.js +148 -0
- package/dist/scripts/src/components-core/utils/hooks.js +221 -0
- package/dist/scripts/src/components-core/utils/mergeProps.js +45 -0
- package/dist/scripts/src/components-core/utils/misc.js +460 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +205 -0
- package/dist/scripts/src/components-core/utils/treeUtils.js +48 -0
- package/dist/scripts/src/components-core/xmlui-parser.js +52 -0
- package/dist/scripts/src/parsers/scripting/InputStream.js +59 -0
- package/dist/scripts/src/parsers/scripting/Lexer.js +1028 -0
- package/dist/scripts/src/parsers/scripting/Parser.js +2647 -0
- package/dist/scripts/src/parsers/scripting/ParserError.js +46 -0
- package/dist/scripts/src/parsers/scripting/TokenTrait.js +109 -0
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +118 -0
- package/dist/scripts/src/parsers/scripting/tree-visitor.js +602 -0
- package/dist/scripts/src/parsers/style-parser/StyleInputStream.js +39 -0
- package/dist/scripts/src/parsers/style-parser/StyleLexer.js +621 -0
- package/dist/scripts/src/parsers/style-parser/StyleParser.js +1000 -0
- package/dist/scripts/src/parsers/style-parser/errors.js +37 -0
- package/dist/scripts/src/parsers/style-parser/source-tree.js +2 -0
- package/dist/scripts/src/parsers/style-parser/style-compiler.js +513 -0
- package/dist/scripts/src/parsers/style-parser/tokens.js +42 -0
- package/dist/scripts/src/parsers/ueml/ParserError.js +54 -0
- package/dist/scripts/src/parsers/ueml/UemlHelper.js +579 -0
- package/dist/scripts/src/parsers/ueml/UemlInputStream.js +59 -0
- package/dist/scripts/src/parsers/ueml/UemlLexer.js +868 -0
- package/dist/scripts/src/parsers/ueml/UemlParser.js +1439 -0
- package/dist/scripts/src/parsers/ueml/UemlToken.js +24 -0
- package/dist/scripts/src/parsers/ueml/fileExtensions.js +6 -0
- package/dist/scripts/src/parsers/ueml/source-tree.js +2 -0
- package/dist/scripts/src/parsers/ueml/ueml-tree.js +2 -0
- package/dist/scripts/src/parsers/xmlui-parser/CharacterCodes.js +136 -0
- package/dist/scripts/src/parsers/xmlui-parser/diagnostics.js +100 -0
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +476 -0
- package/dist/scripts/src/parsers/xmlui-parser/scanner.js +415 -0
- package/dist/scripts/src/parsers/xmlui-parser/syntax-kind.js +106 -0
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +2 -0
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +922 -0
- package/dist/scripts/src/parsers/xmlui-parser/utils.js +83 -0
- package/dist/xmlui.es.d.ts +1667 -0
- package/dist/xmlui.es.js +17 -0
- package/dist/xmlui.umd.js +1589 -0
- package/package.json +175 -0
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.visitNode = visitNode;
|
|
4
|
+
const unreachable = (_x) => { };
|
|
5
|
+
/*Walk through the ast, executing visitors on the nodes
|
|
6
|
+
*
|
|
7
|
+
* @param subject the root of the tree to start the walk from
|
|
8
|
+
* @param state the initial state that will be passed through to the visitors
|
|
9
|
+
* @param stmtVisior will be called on every statement. If undefined, statements will be ignored
|
|
10
|
+
* @param exprVisitor will be called on every expression. If undefined, exoressiones will be ignored
|
|
11
|
+
*/
|
|
12
|
+
function visitNode(subject, state, stmtVisitor, exprVisitor, parent, tag) {
|
|
13
|
+
// --- Stop visiting if cancelled
|
|
14
|
+
if (state.cancel) {
|
|
15
|
+
return state;
|
|
16
|
+
}
|
|
17
|
+
// --- By default visit all children down the hierarchy
|
|
18
|
+
state.skipChildren = false;
|
|
19
|
+
if (Array.isArray(subject)) {
|
|
20
|
+
for (const statement of subject) {
|
|
21
|
+
state = visitNode(statement, state, stmtVisitor, exprVisitor, parent, tag);
|
|
22
|
+
}
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
switch (subject.type) {
|
|
26
|
+
case "BlockS": {
|
|
27
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
28
|
+
if (state.cancel)
|
|
29
|
+
return state;
|
|
30
|
+
if (!state.skipChildren) {
|
|
31
|
+
for (const statement of subject.statements) {
|
|
32
|
+
state = visitNode(statement, state, stmtVisitor, exprVisitor, subject, "statements");
|
|
33
|
+
if (state.cancel)
|
|
34
|
+
return state;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
38
|
+
return state;
|
|
39
|
+
}
|
|
40
|
+
case "EmptyS": {
|
|
41
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
44
|
+
case "ExprS": {
|
|
45
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
46
|
+
if (state.cancel)
|
|
47
|
+
return state;
|
|
48
|
+
if (!state.skipChildren) {
|
|
49
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
50
|
+
if (state.cancel)
|
|
51
|
+
return state;
|
|
52
|
+
}
|
|
53
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
case "ArrowS": {
|
|
57
|
+
//cannot reach that
|
|
58
|
+
return state;
|
|
59
|
+
}
|
|
60
|
+
case "LetS": {
|
|
61
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
62
|
+
if (state.cancel)
|
|
63
|
+
return state;
|
|
64
|
+
if (!state.skipChildren) {
|
|
65
|
+
for (const declaration of subject.declarations) {
|
|
66
|
+
state = visitNode(declaration, state, stmtVisitor, exprVisitor, subject, "declarations");
|
|
67
|
+
if (state.cancel)
|
|
68
|
+
return state;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
case "ConstS": {
|
|
75
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
76
|
+
if (state.cancel)
|
|
77
|
+
return state;
|
|
78
|
+
if (!state.skipChildren) {
|
|
79
|
+
for (const declaration of subject.declarations) {
|
|
80
|
+
state = visitNode(declaration, state, stmtVisitor, exprVisitor, subject, "declarations");
|
|
81
|
+
if (state.cancel)
|
|
82
|
+
return state;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
88
|
+
case "VarS": {
|
|
89
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
90
|
+
if (state.cancel)
|
|
91
|
+
return state;
|
|
92
|
+
if (!state.skipChildren) {
|
|
93
|
+
for (const declaration of subject.declarations) {
|
|
94
|
+
state = visitNode(declaration, state, stmtVisitor, exprVisitor, subject, "declarations");
|
|
95
|
+
if (state.cancel)
|
|
96
|
+
return state;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
100
|
+
return state;
|
|
101
|
+
}
|
|
102
|
+
case "IfS": {
|
|
103
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
104
|
+
if (state.cancel)
|
|
105
|
+
return state;
|
|
106
|
+
if (!state.skipChildren) {
|
|
107
|
+
state = visitNode(subject.condition, state, stmtVisitor, exprVisitor, subject, "condition");
|
|
108
|
+
if (state.cancel)
|
|
109
|
+
return state;
|
|
110
|
+
if (subject.thenBranch) {
|
|
111
|
+
state = visitNode(subject.thenBranch, state, stmtVisitor, exprVisitor, subject, "thenBranch");
|
|
112
|
+
}
|
|
113
|
+
if (state.cancel)
|
|
114
|
+
return state;
|
|
115
|
+
if (subject.elseBranch) {
|
|
116
|
+
state = visitNode(subject.elseBranch, state, stmtVisitor, exprVisitor, subject, "elseBranch");
|
|
117
|
+
}
|
|
118
|
+
if (state.cancel)
|
|
119
|
+
return state;
|
|
120
|
+
}
|
|
121
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
122
|
+
return state;
|
|
123
|
+
}
|
|
124
|
+
case "RetS": {
|
|
125
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
126
|
+
if (state.cancel)
|
|
127
|
+
return state;
|
|
128
|
+
if (!state.skipChildren) {
|
|
129
|
+
if (subject.expression) {
|
|
130
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
131
|
+
}
|
|
132
|
+
if (state.cancel)
|
|
133
|
+
return state;
|
|
134
|
+
}
|
|
135
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
136
|
+
return state;
|
|
137
|
+
}
|
|
138
|
+
case "BrkS": {
|
|
139
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
140
|
+
return state;
|
|
141
|
+
}
|
|
142
|
+
case "ContS": {
|
|
143
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
144
|
+
return state;
|
|
145
|
+
}
|
|
146
|
+
case "WhileS": {
|
|
147
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
148
|
+
if (state.cancel)
|
|
149
|
+
return state;
|
|
150
|
+
if (!state.skipChildren) {
|
|
151
|
+
state = visitNode(subject.condition, state, stmtVisitor, exprVisitor, subject, "condition");
|
|
152
|
+
if (state.cancel)
|
|
153
|
+
return state;
|
|
154
|
+
state = visitNode(subject.body, state, stmtVisitor, exprVisitor, subject, "body");
|
|
155
|
+
if (state.cancel)
|
|
156
|
+
return state;
|
|
157
|
+
}
|
|
158
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
159
|
+
return state;
|
|
160
|
+
}
|
|
161
|
+
case "DoWS": {
|
|
162
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
163
|
+
if (state.cancel)
|
|
164
|
+
return state;
|
|
165
|
+
if (!state.skipChildren) {
|
|
166
|
+
state = visitNode(subject.body, state, stmtVisitor, exprVisitor, subject, "body");
|
|
167
|
+
if (state.cancel)
|
|
168
|
+
return state;
|
|
169
|
+
state = visitNode(subject.condition, state, stmtVisitor, exprVisitor, subject, "condition");
|
|
170
|
+
if (state.cancel)
|
|
171
|
+
return state;
|
|
172
|
+
}
|
|
173
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
174
|
+
return state;
|
|
175
|
+
}
|
|
176
|
+
case "ForS": {
|
|
177
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
178
|
+
if (state.cancel)
|
|
179
|
+
return state;
|
|
180
|
+
if (!state.skipChildren) {
|
|
181
|
+
if (subject.init) {
|
|
182
|
+
state = visitNode(subject.init, state, stmtVisitor, exprVisitor, subject, "init");
|
|
183
|
+
}
|
|
184
|
+
if (state.cancel)
|
|
185
|
+
return state;
|
|
186
|
+
if (subject.condition) {
|
|
187
|
+
state = visitNode(subject.condition, state, stmtVisitor, exprVisitor, subject, "condition");
|
|
188
|
+
}
|
|
189
|
+
if (state.cancel)
|
|
190
|
+
return state;
|
|
191
|
+
if (subject.update) {
|
|
192
|
+
state = visitNode(subject.update, state, stmtVisitor, exprVisitor, subject, "update");
|
|
193
|
+
}
|
|
194
|
+
if (state.cancel)
|
|
195
|
+
return state;
|
|
196
|
+
state = visitNode(subject.body, state, stmtVisitor, exprVisitor, subject, "body");
|
|
197
|
+
if (state.cancel)
|
|
198
|
+
return state;
|
|
199
|
+
}
|
|
200
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
201
|
+
return state;
|
|
202
|
+
}
|
|
203
|
+
case "ForInS": {
|
|
204
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
205
|
+
if (state.cancel)
|
|
206
|
+
return state;
|
|
207
|
+
if (!state.skipChildren) {
|
|
208
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
209
|
+
if (state.cancel)
|
|
210
|
+
return state;
|
|
211
|
+
state = visitNode(subject.body, state, stmtVisitor, exprVisitor, subject, "body");
|
|
212
|
+
if (state.cancel)
|
|
213
|
+
return state;
|
|
214
|
+
}
|
|
215
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
216
|
+
return state;
|
|
217
|
+
}
|
|
218
|
+
case "ForOfS": {
|
|
219
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
220
|
+
if (state.cancel)
|
|
221
|
+
return state;
|
|
222
|
+
if (!state.skipChildren) {
|
|
223
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
224
|
+
if (state.cancel)
|
|
225
|
+
return state;
|
|
226
|
+
state = visitNode(subject.body, state, stmtVisitor, exprVisitor, subject, "body");
|
|
227
|
+
if (state.cancel)
|
|
228
|
+
return state;
|
|
229
|
+
}
|
|
230
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
231
|
+
return state;
|
|
232
|
+
}
|
|
233
|
+
case "ThrowS": {
|
|
234
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
235
|
+
if (state.cancel)
|
|
236
|
+
return state;
|
|
237
|
+
if (!state.skipChildren) {
|
|
238
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
239
|
+
if (state.cancel)
|
|
240
|
+
return state;
|
|
241
|
+
}
|
|
242
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
243
|
+
return state;
|
|
244
|
+
}
|
|
245
|
+
case "TryS": {
|
|
246
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
247
|
+
if (state.cancel)
|
|
248
|
+
return state;
|
|
249
|
+
if (!state.skipChildren) {
|
|
250
|
+
if (subject.tryBlock) {
|
|
251
|
+
state = visitNode(subject.tryBlock, state, stmtVisitor, exprVisitor, subject, "tryBlock");
|
|
252
|
+
}
|
|
253
|
+
if (state.cancel)
|
|
254
|
+
return state;
|
|
255
|
+
if (subject.catchBlock) {
|
|
256
|
+
state = visitNode(subject.catchBlock, state, stmtVisitor, exprVisitor, subject, "catchBlock");
|
|
257
|
+
}
|
|
258
|
+
if (state.cancel)
|
|
259
|
+
return state;
|
|
260
|
+
if (subject.finallyBlock) {
|
|
261
|
+
state = visitNode(subject.finallyBlock, state, stmtVisitor, exprVisitor, subject, "finallyBlock");
|
|
262
|
+
}
|
|
263
|
+
if (state.cancel)
|
|
264
|
+
return state;
|
|
265
|
+
}
|
|
266
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
267
|
+
return state;
|
|
268
|
+
}
|
|
269
|
+
case "SwitchS": {
|
|
270
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
271
|
+
if (state.cancel)
|
|
272
|
+
return state;
|
|
273
|
+
if (!state.skipChildren) {
|
|
274
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
275
|
+
if (state.cancel)
|
|
276
|
+
return state;
|
|
277
|
+
for (const switchCase of subject.cases) {
|
|
278
|
+
if (switchCase.caseExpression)
|
|
279
|
+
state = visitNode(switchCase.caseExpression, state, stmtVisitor, exprVisitor, subject, "caseExpression");
|
|
280
|
+
if (state.cancel)
|
|
281
|
+
return state;
|
|
282
|
+
if (switchCase.statements === undefined)
|
|
283
|
+
continue;
|
|
284
|
+
for (const statement of switchCase.statements) {
|
|
285
|
+
state = visitNode(statement, state, stmtVisitor, exprVisitor, subject, "switchStatement");
|
|
286
|
+
if (state.cancel)
|
|
287
|
+
return state;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
292
|
+
return state;
|
|
293
|
+
}
|
|
294
|
+
case "FuncD": {
|
|
295
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
296
|
+
if (state.cancel)
|
|
297
|
+
return state;
|
|
298
|
+
if (!state.skipChildren) {
|
|
299
|
+
for (const expr of subject.args) {
|
|
300
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject, "arg");
|
|
301
|
+
if (state.cancel)
|
|
302
|
+
return state;
|
|
303
|
+
}
|
|
304
|
+
state = visitNode(subject.statement, state, stmtVisitor, exprVisitor, subject, "statement");
|
|
305
|
+
if (state.cancel)
|
|
306
|
+
return state;
|
|
307
|
+
}
|
|
308
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
309
|
+
return state;
|
|
310
|
+
}
|
|
311
|
+
case "ImportD": {
|
|
312
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(true, subject, state, parent, tag)) || state;
|
|
313
|
+
if (state.cancel)
|
|
314
|
+
return state;
|
|
315
|
+
state = (stmtVisitor === null || stmtVisitor === void 0 ? void 0 : stmtVisitor(false, subject, state, parent, tag)) || state;
|
|
316
|
+
return state;
|
|
317
|
+
}
|
|
318
|
+
// ================= Expressions =================
|
|
319
|
+
case "UnaryE": {
|
|
320
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
321
|
+
if (state.cancel)
|
|
322
|
+
return state;
|
|
323
|
+
if (!state.skipChildren) {
|
|
324
|
+
state = visitNode(subject.operand, state, stmtVisitor, exprVisitor, subject, "operand");
|
|
325
|
+
if (state.cancel)
|
|
326
|
+
return state;
|
|
327
|
+
}
|
|
328
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
329
|
+
return state;
|
|
330
|
+
}
|
|
331
|
+
case "BinaryE": {
|
|
332
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
333
|
+
if (state.cancel)
|
|
334
|
+
return state;
|
|
335
|
+
if (!state.skipChildren) {
|
|
336
|
+
state = visitNode(subject.left, state, stmtVisitor, exprVisitor, subject, "left");
|
|
337
|
+
if (state.cancel)
|
|
338
|
+
return state;
|
|
339
|
+
state = visitNode(subject.right, state, stmtVisitor, exprVisitor, subject, "right");
|
|
340
|
+
if (state.cancel)
|
|
341
|
+
return state;
|
|
342
|
+
}
|
|
343
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
344
|
+
return state;
|
|
345
|
+
}
|
|
346
|
+
case "SeqE": {
|
|
347
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
348
|
+
if (state.cancel)
|
|
349
|
+
return state;
|
|
350
|
+
if (!state.skipChildren) {
|
|
351
|
+
for (const expr of subject.expressions) {
|
|
352
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
353
|
+
if (state.cancel)
|
|
354
|
+
return state;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
358
|
+
return state;
|
|
359
|
+
}
|
|
360
|
+
case "CondE": {
|
|
361
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
362
|
+
if (state.cancel)
|
|
363
|
+
return state;
|
|
364
|
+
if (!state.skipChildren) {
|
|
365
|
+
state = visitNode(subject.condition, state, stmtVisitor, exprVisitor, subject, "condition");
|
|
366
|
+
if (state.cancel)
|
|
367
|
+
return state;
|
|
368
|
+
state = visitNode(subject.consequent, state, stmtVisitor, exprVisitor, subject, "consequent");
|
|
369
|
+
if (state.cancel)
|
|
370
|
+
return state;
|
|
371
|
+
state = visitNode(subject.alternate, state, stmtVisitor, exprVisitor, subject, "alternate");
|
|
372
|
+
if (state.cancel)
|
|
373
|
+
return state;
|
|
374
|
+
}
|
|
375
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
376
|
+
return state;
|
|
377
|
+
}
|
|
378
|
+
case "InvokeE": {
|
|
379
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
380
|
+
if (state.cancel)
|
|
381
|
+
return state;
|
|
382
|
+
if (!state.skipChildren) {
|
|
383
|
+
for (const arg of subject.arguments) {
|
|
384
|
+
state = visitNode(arg, state, stmtVisitor, exprVisitor, subject, "argument");
|
|
385
|
+
if (state.cancel)
|
|
386
|
+
return state;
|
|
387
|
+
}
|
|
388
|
+
state = visitNode(subject.object, state, stmtVisitor, exprVisitor, subject, "object");
|
|
389
|
+
if (state.cancel)
|
|
390
|
+
return state;
|
|
391
|
+
}
|
|
392
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
393
|
+
return state;
|
|
394
|
+
}
|
|
395
|
+
case "MembE": {
|
|
396
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
397
|
+
if (state.cancel)
|
|
398
|
+
return state;
|
|
399
|
+
if (!state.skipChildren) {
|
|
400
|
+
state = visitNode(subject.object, state, stmtVisitor, exprVisitor, subject, "object");
|
|
401
|
+
if (state.cancel)
|
|
402
|
+
return state;
|
|
403
|
+
}
|
|
404
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
405
|
+
return state;
|
|
406
|
+
}
|
|
407
|
+
case "CMembE": {
|
|
408
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
409
|
+
if (state.cancel)
|
|
410
|
+
return state;
|
|
411
|
+
if (!state.skipChildren) {
|
|
412
|
+
state = visitNode(subject.object, state, stmtVisitor, exprVisitor, subject, "object");
|
|
413
|
+
if (state.cancel)
|
|
414
|
+
return state;
|
|
415
|
+
state = visitNode(subject.member, state, stmtVisitor, exprVisitor, subject, "member");
|
|
416
|
+
if (state.cancel)
|
|
417
|
+
return state;
|
|
418
|
+
}
|
|
419
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
420
|
+
return state;
|
|
421
|
+
}
|
|
422
|
+
case "IdE": {
|
|
423
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
424
|
+
return state;
|
|
425
|
+
}
|
|
426
|
+
case "LitE": {
|
|
427
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
428
|
+
return state;
|
|
429
|
+
}
|
|
430
|
+
case "ALitE": {
|
|
431
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
432
|
+
if (state.cancel)
|
|
433
|
+
return state;
|
|
434
|
+
if (!state.skipChildren) {
|
|
435
|
+
for (const item of subject.items) {
|
|
436
|
+
state = visitNode(item, state, stmtVisitor, exprVisitor, subject, "item");
|
|
437
|
+
if (state.cancel)
|
|
438
|
+
return state;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
442
|
+
return state;
|
|
443
|
+
}
|
|
444
|
+
case "OLitE": {
|
|
445
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
446
|
+
if (state.cancel)
|
|
447
|
+
return state;
|
|
448
|
+
if (!state.skipChildren) {
|
|
449
|
+
for (const prop of subject.props) {
|
|
450
|
+
if (Array.isArray(prop)) {
|
|
451
|
+
const [key, value] = prop;
|
|
452
|
+
state = visitNode(key, state, stmtVisitor, exprVisitor, subject, "propKey");
|
|
453
|
+
if (state.cancel)
|
|
454
|
+
return state;
|
|
455
|
+
state = visitNode(value, state, stmtVisitor, exprVisitor, subject, "propValue");
|
|
456
|
+
if (state.cancel)
|
|
457
|
+
return state;
|
|
458
|
+
}
|
|
459
|
+
else {
|
|
460
|
+
//SpreadExpression branch
|
|
461
|
+
state = visitNode(prop, state, stmtVisitor, exprVisitor, subject, "prop");
|
|
462
|
+
if (state.cancel)
|
|
463
|
+
return state;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
468
|
+
return state;
|
|
469
|
+
}
|
|
470
|
+
case "SpreadE": {
|
|
471
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
472
|
+
if (state.cancel)
|
|
473
|
+
return state;
|
|
474
|
+
if (!state.skipChildren) {
|
|
475
|
+
state = visitNode(subject.operand, state, stmtVisitor, exprVisitor, subject, "operand");
|
|
476
|
+
if (state.cancel)
|
|
477
|
+
return state;
|
|
478
|
+
}
|
|
479
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
480
|
+
return state;
|
|
481
|
+
}
|
|
482
|
+
case "AsgnE": {
|
|
483
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
484
|
+
if (state.cancel)
|
|
485
|
+
return state;
|
|
486
|
+
if (!state.skipChildren) {
|
|
487
|
+
state = visitNode(subject.operand, state, stmtVisitor, exprVisitor, subject, "operand");
|
|
488
|
+
if (state.cancel)
|
|
489
|
+
return state;
|
|
490
|
+
state = visitNode(subject.leftValue, state, stmtVisitor, exprVisitor, subject, "leftValue");
|
|
491
|
+
if (state.cancel)
|
|
492
|
+
return state;
|
|
493
|
+
}
|
|
494
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
495
|
+
return state;
|
|
496
|
+
}
|
|
497
|
+
case "NoArgE": {
|
|
498
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
499
|
+
return state;
|
|
500
|
+
}
|
|
501
|
+
case "ArrowE": {
|
|
502
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
503
|
+
if (state.cancel)
|
|
504
|
+
return state;
|
|
505
|
+
if (!state.skipChildren) {
|
|
506
|
+
for (const expr of subject.args) {
|
|
507
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject, "arg");
|
|
508
|
+
if (state.cancel)
|
|
509
|
+
return state;
|
|
510
|
+
}
|
|
511
|
+
state = visitNode(subject.statement, state, stmtVisitor, exprVisitor, subject, "statement");
|
|
512
|
+
if (state.cancel)
|
|
513
|
+
return state;
|
|
514
|
+
}
|
|
515
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
516
|
+
return state;
|
|
517
|
+
}
|
|
518
|
+
case "PrefE":
|
|
519
|
+
case "PostfE": {
|
|
520
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
521
|
+
if (state.cancel)
|
|
522
|
+
return state;
|
|
523
|
+
if (!state.skipChildren) {
|
|
524
|
+
state = visitNode(subject.operand, state, stmtVisitor, exprVisitor, subject, "operand");
|
|
525
|
+
if (state.cancel)
|
|
526
|
+
return state;
|
|
527
|
+
}
|
|
528
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
529
|
+
return state;
|
|
530
|
+
}
|
|
531
|
+
case "VarD": {
|
|
532
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
533
|
+
if (state.cancel)
|
|
534
|
+
return state;
|
|
535
|
+
if (!state.skipChildren) {
|
|
536
|
+
if (subject.arrayDestruct !== undefined) {
|
|
537
|
+
for (const expr of subject.arrayDestruct) {
|
|
538
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject);
|
|
539
|
+
if (state.cancel)
|
|
540
|
+
return state;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
if (subject.objectDestruct !== undefined) {
|
|
544
|
+
for (const expr of subject.objectDestruct) {
|
|
545
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject);
|
|
546
|
+
if (state.cancel)
|
|
547
|
+
return state;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (subject.expression) {
|
|
551
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
552
|
+
}
|
|
553
|
+
if (state.cancel)
|
|
554
|
+
return state;
|
|
555
|
+
}
|
|
556
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
557
|
+
return state;
|
|
558
|
+
}
|
|
559
|
+
case "Destr":
|
|
560
|
+
case "ODestr":
|
|
561
|
+
case "ADestr": {
|
|
562
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
563
|
+
if (state.cancel)
|
|
564
|
+
return state;
|
|
565
|
+
if (!state.skipChildren) {
|
|
566
|
+
if (subject.arrayDestruct !== undefined) {
|
|
567
|
+
for (const expr of subject.arrayDestruct) {
|
|
568
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject);
|
|
569
|
+
if (state.cancel)
|
|
570
|
+
return state;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
if (subject.objectDestruct !== undefined) {
|
|
574
|
+
for (const expr of subject.objectDestruct) {
|
|
575
|
+
state = visitNode(expr, state, stmtVisitor, exprVisitor, subject);
|
|
576
|
+
if (state.cancel)
|
|
577
|
+
return state;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
582
|
+
return state;
|
|
583
|
+
}
|
|
584
|
+
case "RVarD": {
|
|
585
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(true, subject, state, parent, tag)) || state;
|
|
586
|
+
if (state.cancel)
|
|
587
|
+
return state;
|
|
588
|
+
if (!state.skipChildren) {
|
|
589
|
+
if (subject.expression) {
|
|
590
|
+
state = visitNode(subject.expression, state, stmtVisitor, exprVisitor, subject, "expression");
|
|
591
|
+
}
|
|
592
|
+
if (state.cancel)
|
|
593
|
+
return state;
|
|
594
|
+
}
|
|
595
|
+
state = (exprVisitor === null || exprVisitor === void 0 ? void 0 : exprVisitor(false, subject, state, parent, tag)) || state;
|
|
596
|
+
return state;
|
|
597
|
+
}
|
|
598
|
+
default:
|
|
599
|
+
unreachable(subject);
|
|
600
|
+
return state;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyleInputStream = void 0;
|
|
4
|
+
// This class represents the input stream of the layout parser
|
|
5
|
+
class StyleInputStream {
|
|
6
|
+
// Creates a stream that uses the specified source code
|
|
7
|
+
constructor(source) {
|
|
8
|
+
this.source = source;
|
|
9
|
+
// --- Current stream position
|
|
10
|
+
this._pos = 0;
|
|
11
|
+
}
|
|
12
|
+
// Gets the current position in the stream. Starts from 0.
|
|
13
|
+
get position() {
|
|
14
|
+
return this._pos;
|
|
15
|
+
}
|
|
16
|
+
// Peeks the next character in the stream. Returns null, if EOF; otherwise the current source code character
|
|
17
|
+
peek() {
|
|
18
|
+
return this.ahead(0);
|
|
19
|
+
}
|
|
20
|
+
// Looks ahead with `n` characters in the stream. Returns null, if EOF; otherwise the look-ahead character
|
|
21
|
+
ahead(n = 1) {
|
|
22
|
+
return this._pos + n > this.source.length - 1 ? null : this.source[this._pos + n];
|
|
23
|
+
}
|
|
24
|
+
// Gets the next character from the stream
|
|
25
|
+
get() {
|
|
26
|
+
// --- Check for EOF
|
|
27
|
+
if (this._pos >= this.source.length) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
// --- Get the char, and keep track of position
|
|
31
|
+
return this.source[this._pos++];
|
|
32
|
+
}
|
|
33
|
+
// Gets the tail of the input stream
|
|
34
|
+
getTail(start) {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.substring(start)) !== null && _b !== void 0 ? _b : "";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.StyleInputStream = StyleInputStream;
|