xmlui 0.4.1 → 0.4.2-beta.1
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-49TqXRNN.mjs → Pdf-DY3dYAig.mjs} +1 -1
- package/dist/{Pdf-BH2vx5Qr.mjs → Pdf-DYj6pOR4.mjs} +1 -1
- package/dist/{apiInterceptorWorker-Bt5xchwi.mjs → apiInterceptorWorker-B_8SyVm7.mjs} +1 -1
- package/dist/{apiInterceptorWorker-BBlmEoWI.mjs → apiInterceptorWorker-CSMfMHnG.mjs} +1 -1
- package/dist/core-CiRlrzNN.mjs +5389 -0
- package/dist/core-TkN1rPOq.mjs +5390 -0
- package/dist/grammar.tmLanguage-Bgs-wS_O.mjs +636 -0
- package/dist/{index-D4lrwrU-.mjs → index-DFmApFOY.mjs} +12192 -12668
- package/dist/{index-standalone-OPhLIAuf.mjs → index-standalone-UVkKZMvh.mjs} +28299 -28777
- package/dist/index-standalone.css +1 -1
- package/dist/index.css +1 -1
- package/dist/{nivo-bar.es-DGyxXAiC.mjs → nivo-bar.es-tnCyX0Yr.mjs} +2 -2
- package/dist/{nivo-geo.es-xKJj5CIr.mjs → nivo-geo.es-BQ3VnkfD.mjs} +2 -2
- package/dist/{nivo-legends.es-Dp7DGs5k.mjs → nivo-legends.es-D-P_F-6G.mjs} +1 -1
- package/dist/{nivo-pie.es-BXZkJTQT.mjs → nivo-pie.es-Z4Ty7kQd.mjs} +2 -2
- package/dist/{react-apexcharts.min-ZKwRrO8G.mjs → react-apexcharts.min-DgtmaDk9.mjs} +1 -1
- package/dist/scripts/docs/syntax/grammar.tmLanguage.json +385 -0
- package/dist/scripts/docs/syntax/textMate/xmlui.json +629 -0
- package/dist/scripts/{bin → xmlui/bin}/vite-ueml-plugin.js +11 -16
- package/dist/scripts/{src → xmlui/src}/components/AppHeader/AppHeader.js +2 -2
- package/dist/scripts/{src → xmlui/src}/components/Avatar/Avatar.js +3 -3
- package/dist/scripts/{src → xmlui/src}/components/Button/Button.js +5 -3
- package/dist/scripts/xmlui/src/components/Card/Card.js +76 -0
- package/dist/scripts/{src → xmlui/src}/components/Chart/Chart.js +7 -6
- package/dist/scripts/{src → xmlui/src}/components/Combobox/Combobox.js +60 -22
- package/dist/scripts/{src → xmlui/src}/components/ComponentProvider.js +26 -6
- package/dist/scripts/{src → xmlui/src}/components/DropdownMenu/DropdownMenu.js +21 -14
- package/dist/scripts/{src → xmlui/src}/components/FlowLayout/FlowLayout.js +10 -9
- package/dist/scripts/xmlui/src/components/FormSection/FormSection.js +47 -0
- package/dist/scripts/{src → xmlui/src}/components/Heading/Heading.js +1 -1
- package/dist/scripts/{src → xmlui/src}/components/Icon/Icon.js +4 -3
- package/dist/scripts/xmlui/src/components/Icon/TrendingDownIcon.js +10 -0
- package/dist/scripts/xmlui/src/components/Icon/TrendingUpIcon.js +10 -0
- package/dist/scripts/xmlui/src/components/IconInfoCard/IconInfoCard.js +52 -0
- package/dist/scripts/{src → xmlui/src}/components/IconProvider.js +4 -1
- package/dist/scripts/{src → xmlui/src}/components/Image/Image.js +4 -4
- package/dist/scripts/{src → xmlui/src}/components/Link/Link.js +4 -4
- package/dist/scripts/{src → xmlui/src}/components/Map/Map.js +7 -1
- package/dist/scripts/{src → xmlui/src}/components/ModalDialog/ModalDialog.js +5 -1
- package/dist/scripts/{src → xmlui/src}/components/MultiCombobox/MultiCombobox.js +1 -1
- package/dist/scripts/{src → xmlui/src}/components/NavLink/NavLink.js +4 -3
- package/dist/scripts/{src → xmlui/src}/components/NavPanel/NavPanel.js +6 -4
- package/dist/scripts/xmlui/src/components/PageHeader/PageHeader.js +48 -0
- package/dist/scripts/{src → xmlui/src}/components/ProgressBar/ProgressBar.js +5 -4
- package/dist/scripts/{src → xmlui/src}/components/Table/Table.js +61 -51
- package/dist/scripts/xmlui/src/components/TableHeader/TableHeader.js +31 -0
- package/dist/scripts/{src → xmlui/src}/components/Text/Text.js +34 -13
- package/dist/scripts/{src → xmlui/src}/components/ThemeChanger/ThemeChanger.js +3 -24
- package/dist/scripts/{src → xmlui/src}/components/Toggle/Toggle.js +9 -8
- package/dist/scripts/xmlui/src/components/Toolbar/Toolbar.js +26 -0
- package/dist/scripts/xmlui/src/components/ToolbarButton/ToolbarButton.js +33 -0
- package/dist/scripts/xmlui/src/components/TrendLabel/TrendLabel.js +79 -0
- package/dist/scripts/{src → xmlui/src}/components-core/Component.js +8 -5
- package/dist/scripts/{src → xmlui/src}/components-core/ComponentDecorator.js +17 -3
- package/dist/scripts/xmlui/src/components-core/InspectorContext.js +176 -0
- package/dist/scripts/{src → xmlui/src}/components-core/RootComponent.js +8 -6
- package/dist/scripts/xmlui/src/components-core/XmluiCodeHighlighter.js +95 -0
- package/dist/scripts/{src → xmlui/src}/components-core/loader/DataLoader.js +14 -6
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-common.js +2 -7
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-async.js +0 -59
- package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-common.js +2 -2
- package/dist/scripts/{src → xmlui/src}/components-core/theming/ThemeProvider.js +4 -0
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/root.js +20 -15
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/theme-colors.js +164 -2
- package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/xmlui.js +17 -1
- package/dist/scripts/xmlui/src/components-core/xmlui-parser.js +51 -0
- package/dist/scripts/{src → xmlui/src}/parsers/scripting/Parser.js +1 -1
- package/dist/scripts/{src → xmlui/src}/parsers/scripting/code-behind-collect.js +8 -4
- package/dist/scripts/{src/components-core/script-runner → xmlui/src/parsers/scripting}/modules.js +74 -6
- package/dist/scripts/{src/parsers/ueml → xmlui/src/parsers/xmlui-parser}/ParserError.js +1 -1
- package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/parser.js +27 -20
- package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/transform.js +113 -56
- package/dist/wasm-SPaT1zC5.mjs +5 -0
- package/dist/xmlui-C8fXVsN3.mjs +636 -0
- package/dist/xmlui-standalone.es.js +1 -1
- package/dist/xmlui-standalone.umd.js +289 -281
- package/dist/xmlui.es.d.ts +40 -21
- package/dist/xmlui.es.js +1 -1
- package/dist/xmlui.umd.js +124 -116
- package/package.json +12 -3
- package/dist/scripts/src/abstractions/BlockScope.js +0 -4
- package/dist/scripts/src/components/Card/Card.js +0 -65
- package/dist/scripts/src/components/FormSection/FormSection.js +0 -45
- package/dist/scripts/src/components-core/xmlui-parser.js +0 -52
- package/dist/scripts/src/parsers/ueml/UemlHelper.js +0 -579
- package/dist/scripts/src/parsers/ueml/UemlInputStream.js +0 -59
- package/dist/scripts/src/parsers/ueml/UemlLexer.js +0 -868
- package/dist/scripts/src/parsers/ueml/UemlParser.js +0 -1439
- package/dist/scripts/src/parsers/ueml/UemlToken.js +0 -24
- /package/dist/scripts/{bin → xmlui/bin}/bootstrap.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/build.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/index.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/preview.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/start.js +0 -0
- /package/dist/scripts/{bin → xmlui/bin}/viteConfig.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ActionDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/AppContextDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ComponentDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ComponentDescriptorDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/ContainerDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/FunctionDefs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/RendererDefs.js +0 -0
- /package/dist/scripts/{src/abstractions/scripting/ScriptParserError.js → xmlui/src/abstractions/scripting/BlockScope.js} +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/LogicalThread.js +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/LoopScope.js +0 -0
- /package/dist/scripts/{src/abstractions/scripting/ScriptingSourceTree.js → xmlui/src/abstractions/scripting/ScriptParserError.js} +0 -0
- /package/dist/scripts/{src/components-core/abstractions/ComponentRenderer.js → xmlui/src/abstractions/scripting/ScriptingSourceTree.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/abstractions/scripting/Token.js +0 -0
- /package/dist/scripts/{src/components-core/script-runner → xmlui/src/abstractions/scripting}/TryScope.js +0 -0
- /package/dist/scripts/{src/components-core/abstractions/LoaderRenderer.js → xmlui/src/abstractions/scripting/modules.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/App.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/AppLayoutContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/AppStateContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/App/Sheet.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/AppState/AppState.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Badge/Badge.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/BarChart/BarChart.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Bookmark/Bookmark.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ChangeListener/ChangeListener.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Checkbox/Checkbox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ContentSeparator/ContentSeparator.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/DatePicker/DatePicker.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/EmojiSelector/EmojiSelector.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FileInput/FileInput.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FileUploadDropZone/FileUploadDropZone.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Footer/Footer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/Form.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/FormContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Form/formActions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/FormItem.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/HelperText.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/ItemWithLabel.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/FormItem/Validations.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/HoverCard/HoverCard.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ApiIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/Attach.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/Binding.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/BoardIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/BoxIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CheckIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronDownIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronLeft.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronRight.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ChevronUpIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CodeFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CodeSandbox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/CompactListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ContentCopyIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DatabaseIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DocFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DocIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DotMenuHorizontalIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/DotMenuIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/EmailIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/EmptyFolderIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ErrorIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ExpressionIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FillPlusCricleIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FilterIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/FolderIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/GlobeIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/HomeIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/HyperLinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ImageFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/LinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/LooseListIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/MoonIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/MoreOptionsIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PDFIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PenIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PhoneIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PhotoIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/PlusIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/SearchIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/ShareIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/SunIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/TrashIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/TxtIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UnknownFileIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UnlinkIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/UserIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/WarningIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Icon/XlsIcon.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/IconRegistryContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Input/InputAdornment.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Input/input-abstractions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Items/Items.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/List/List.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Logo/Logo.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Map/world_countries.json +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Markdown/Markdown.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ModalDialog/ConfirmationModalContextProvider.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ModalDialog/Dialog.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/MultiSelect/MultiSelect.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NavGroup/NavGroup.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NoResult/NoResult.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/NumberBox/NumberBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Option/Option.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PageMetaTitle/PageMetaTitle.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pages/Pages.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pdf/LazyPdf.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Pdf/Pdf.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PieChart/PieChart.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/PositionedContainer/PositionedContainer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Queue/Queue.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Queue/queueActions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/RadioGroup/RadioGroup.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/RealTimeAdapter/RealTimeAdapter.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Redirect/Redirect.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Select/Select.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Select/SelectContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/SelectionStore/SelectionStore.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/SpaceFiller/SpaceFiller.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Spinner/Spinner.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Splitter/Splitter.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Splitter/utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Stack/Stack.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/StickyBox/StickyBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Switch/Switch.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Table/useRowSelection.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TableColumnDef/TableColumnDef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TableColumnDef/TableContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Tabs/Tabs.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/TextArea.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/TextAreaResizable.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextArea/useComposedRef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/TextBox/TextBox.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Theme/NotificationToast.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Theme/Theme.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/Tree/TreeComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ValidationSummary/ValidationSummary.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/ViewComponentRegistryContext.js +0 -0
- /package/dist/scripts/{src/parsers/ueml/source-tree.js → xmlui/src/components/abstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/chart-color-schemes.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/component-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components/container-helpers.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ApiBoundComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/AppContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ChildrenSlot.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/CompoundComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/EngineError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ErrorBoundary.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/Fragment.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/InvalidComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/LoaderComponent.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/RestApiProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/RouteContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/ScrollContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/UnknownComponent.js +0 -0
- /package/dist/scripts/{src/components-core/abstractions/treeAbstractions.js → xmlui/src/components-core/abstractions/ComponentRenderer.js} +0 -0
- /package/dist/scripts/{src/components-core/interception/abstractions.js → xmlui/src/components-core/abstractions/LoaderRenderer.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/abstractions/containers.js +0 -0
- /package/dist/scripts/{src/components/abstractions.js → xmlui/src/components-core/abstractions/treeAbstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/ApiAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/DownloadFileAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/NavigateAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/TimedAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/UploadAction.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/action/actions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/appContext/date-functions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/appContext/misc-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/component-hooks.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/constants.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/Container.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/ContainerComponentDef.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/buildProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/collectFnVarDeps.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/container/valueExtractor.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/descriptorHelper.js +0 -0
- /package/dist/scripts/{src/parsers/style-parser/source-tree.js → xmlui/src/components-core/interception/abstractions.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/interception/useApiInterceptorContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/ApiLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/ExternalDataLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/Loader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/MockLoaderRenderer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/loader/PageableLoader.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/renderers.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/reportEngineError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/BindingTreeEvaluationContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/ICustomOperations.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/ParameterParser.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/asyncProxy.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/bannedFunctions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/custom-operations-registry.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/custom-ui-data.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-async.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/eval-tree-sync.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/process-statement-sync.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/statement-queue.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/script-runner/visitors.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/ThemeContext.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/abstractions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/extendThemeUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/hvar.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themeVars.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/base-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/palette.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/themes/solid.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/theming/transformThemeVars.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/DataLoaderQueryKeyGenerator.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/LruCache.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/actionUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/classnames.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/css-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/date-utils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/extractParam.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/hooks.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/mergeProps.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/misc.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/statementUtils.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/components-core/utils/treeUtils.js +0 -0
- /package/dist/scripts/{src/parsers/scripting → xmlui/src/parsers/common}/InputStream.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/Lexer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/ParserError.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/TokenTrait.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/scripting/tree-visitor.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleInputStream.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleLexer.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/StyleParser.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/errors.js +0 -0
- /package/dist/scripts/{src/parsers/ueml/ueml-tree.js → xmlui/src/parsers/style-parser/source-tree.js} +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/style-compiler.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/style-parser/tokens.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/CharacterCodes.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/diagnostics.js +0 -0
- /package/dist/scripts/{src/parsers/ueml → xmlui/src/parsers/xmlui-parser}/fileExtensions.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/scanner.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/syntax-kind.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/syntax-node.js +0 -0
- /package/dist/scripts/{src → xmlui/src}/parsers/xmlui-parser/utils.js +0 -0
|
@@ -1,868 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UemlLexer = exports.SCRIPT_LITERAL_END = exports.SCRIPT_LITERAL_START = exports.HARD_LITERAL_END = exports.HARD_LITERAL_START = void 0;
|
|
4
|
-
const UemlToken_1 = require("./UemlToken");
|
|
5
|
-
// States of the lexer's state machine
|
|
6
|
-
var LexerPhase;
|
|
7
|
-
(function (LexerPhase) {
|
|
8
|
-
LexerPhase[LexerPhase["Start"] = 0] = "Start";
|
|
9
|
-
LexerPhase[LexerPhase["InWhiteSpace"] = 1] = "InWhiteSpace";
|
|
10
|
-
LexerPhase[LexerPhase["LeftAngle"] = 2] = "LeftAngle";
|
|
11
|
-
LexerPhase[LexerPhase["LeftAngleExcl"] = 3] = "LeftAngleExcl";
|
|
12
|
-
LexerPhase[LexerPhase["LeftAngleExclDash"] = 4] = "LeftAngleExclDash";
|
|
13
|
-
LexerPhase[LexerPhase["Comment"] = 5] = "Comment";
|
|
14
|
-
LexerPhase[LexerPhase["CommentDash"] = 6] = "CommentDash";
|
|
15
|
-
LexerPhase[LexerPhase["CommentTwoDash"] = 7] = "CommentTwoDash";
|
|
16
|
-
LexerPhase[LexerPhase["SingleWord"] = 8] = "SingleWord";
|
|
17
|
-
LexerPhase[LexerPhase["CloseStart"] = 9] = "CloseStart";
|
|
18
|
-
LexerPhase[LexerPhase["HardLiteral"] = 10] = "HardLiteral";
|
|
19
|
-
LexerPhase[LexerPhase["ScriptLiteral"] = 11] = "ScriptLiteral";
|
|
20
|
-
LexerPhase[LexerPhase["InNestedWhitespace"] = 12] = "InNestedWhitespace";
|
|
21
|
-
LexerPhase[LexerPhase["NestedText"] = 13] = "NestedText";
|
|
22
|
-
// --- String processing phases
|
|
23
|
-
LexerPhase[LexerPhase["String"] = 14] = "String";
|
|
24
|
-
LexerPhase[LexerPhase["StringBackSlash"] = 15] = "StringBackSlash";
|
|
25
|
-
LexerPhase[LexerPhase["StringHexa1"] = 16] = "StringHexa1";
|
|
26
|
-
LexerPhase[LexerPhase["StringHexa2"] = 17] = "StringHexa2";
|
|
27
|
-
LexerPhase[LexerPhase["StringUHexa1"] = 18] = "StringUHexa1";
|
|
28
|
-
LexerPhase[LexerPhase["StringUHexa2"] = 19] = "StringUHexa2";
|
|
29
|
-
LexerPhase[LexerPhase["StringUHexa3"] = 20] = "StringUHexa3";
|
|
30
|
-
LexerPhase[LexerPhase["StringUHexa4"] = 21] = "StringUHexa4";
|
|
31
|
-
LexerPhase[LexerPhase["StringUcp1"] = 22] = "StringUcp1";
|
|
32
|
-
LexerPhase[LexerPhase["StringUcp2"] = 23] = "StringUcp2";
|
|
33
|
-
LexerPhase[LexerPhase["StringUcp3"] = 24] = "StringUcp3";
|
|
34
|
-
LexerPhase[LexerPhase["StringUcp4"] = 25] = "StringUcp4";
|
|
35
|
-
LexerPhase[LexerPhase["StringUcp5"] = 26] = "StringUcp5";
|
|
36
|
-
LexerPhase[LexerPhase["StringUcp6"] = 27] = "StringUcp6";
|
|
37
|
-
LexerPhase[LexerPhase["StringUcpTail"] = 28] = "StringUcpTail";
|
|
38
|
-
LexerPhase[LexerPhase["BackSlash"] = 29] = "BackSlash";
|
|
39
|
-
LexerPhase[LexerPhase["Ampersand"] = 30] = "Ampersand";
|
|
40
|
-
})(LexerPhase || (LexerPhase = {}));
|
|
41
|
-
// --- Regex used to recognize UEML identifiers
|
|
42
|
-
const uemlIdRegex = /^[A-Z_][$0-9A-Z_.\-]*$/i;
|
|
43
|
-
exports.HARD_LITERAL_START = "<![CDATA[";
|
|
44
|
-
exports.HARD_LITERAL_END = "]]>";
|
|
45
|
-
exports.SCRIPT_LITERAL_START = "<script>";
|
|
46
|
-
exports.SCRIPT_LITERAL_END = "</script>";
|
|
47
|
-
/**
|
|
48
|
-
* This class implements the lexer of binding expressions
|
|
49
|
-
*/
|
|
50
|
-
class UemlLexer {
|
|
51
|
-
/**
|
|
52
|
-
* Initializes the tokenizer with the input stream
|
|
53
|
-
* @param input Input source code stream
|
|
54
|
-
*/
|
|
55
|
-
constructor(input) {
|
|
56
|
-
this.input = input;
|
|
57
|
-
// --- Already fetched tokens
|
|
58
|
-
this._ahead = [];
|
|
59
|
-
// --- Prefetched character (from the next token)
|
|
60
|
-
this._prefetched = null;
|
|
61
|
-
// --- Prefetched character position (from the next token)
|
|
62
|
-
this._prefetchedPos = null;
|
|
63
|
-
// --- Prefetched character column (from the next token)
|
|
64
|
-
this._prefetchedColumn = null;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Fetches the next token without advancing to its position
|
|
68
|
-
* @param ws If true, retrieve whitespaces too
|
|
69
|
-
*/
|
|
70
|
-
peek(ws = false) {
|
|
71
|
-
return this.ahead(0, ws);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Reads tokens ahead
|
|
75
|
-
* @param n Number of token positions to read ahead
|
|
76
|
-
* @param ws If true, retrieve whitespaces too
|
|
77
|
-
*/
|
|
78
|
-
ahead(n = 1, ws = false) {
|
|
79
|
-
if (n > 16) {
|
|
80
|
-
throw new Error("Cannot look ahead more than 16 tokens");
|
|
81
|
-
}
|
|
82
|
-
// --- Prefetch missing tokens
|
|
83
|
-
while (this._ahead.length <= n) {
|
|
84
|
-
const token = this.fetch();
|
|
85
|
-
if (isEof(token)) {
|
|
86
|
-
return token;
|
|
87
|
-
}
|
|
88
|
-
if (ws || (!ws && !isWs(token))) {
|
|
89
|
-
this._ahead.push(token);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return this._ahead[n];
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Fetches the next token and advances the stream position
|
|
96
|
-
* @param ws If true, retrieve whitespaces too
|
|
97
|
-
@param searchForNested Search for a nested element token */
|
|
98
|
-
get(ws = false, searchForNested = false) {
|
|
99
|
-
if (this._ahead.length > 0) {
|
|
100
|
-
const token = this._ahead.shift();
|
|
101
|
-
if (!token) {
|
|
102
|
-
throw new Error("Token expected");
|
|
103
|
-
}
|
|
104
|
-
return token;
|
|
105
|
-
}
|
|
106
|
-
while (true) {
|
|
107
|
-
const token = this.fetch(searchForNested);
|
|
108
|
-
if (isEof(token) || ws || (!ws && !isWs(token))) {
|
|
109
|
-
return token;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Fetches the next child element token without advancing to its position
|
|
115
|
-
*/
|
|
116
|
-
peekNested() {
|
|
117
|
-
if (!this._ahead.length) {
|
|
118
|
-
const token = this.fetch(true);
|
|
119
|
-
if (isEof(token)) {
|
|
120
|
-
return token;
|
|
121
|
-
}
|
|
122
|
-
this._ahead.push(token);
|
|
123
|
-
}
|
|
124
|
-
return this._ahead[0];
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Fetches the next token from the input stream
|
|
128
|
-
* @param searchForNested Search for a nested element token
|
|
129
|
-
*/
|
|
130
|
-
fetch(searchForNested = false) {
|
|
131
|
-
var _a;
|
|
132
|
-
// --- Captured constants used in nested functions
|
|
133
|
-
const lexer = this;
|
|
134
|
-
const input = this.input;
|
|
135
|
-
const startPos = this._prefetchedPos || input.position;
|
|
136
|
-
const line = input.line;
|
|
137
|
-
const startColumn = this._prefetchedColumn || input.column;
|
|
138
|
-
// --- State variables
|
|
139
|
-
let stringState = null;
|
|
140
|
-
let text = "";
|
|
141
|
-
let tokenType = UemlToken_1.UemlTokenType.Eof;
|
|
142
|
-
let lastEndPos = input.position;
|
|
143
|
-
let lastEndColumn = input.column;
|
|
144
|
-
let ch = null;
|
|
145
|
-
let skipTextAppend = false;
|
|
146
|
-
// --- Start from the beginning
|
|
147
|
-
let phase = LexerPhase.Start;
|
|
148
|
-
// --- Process all token characters
|
|
149
|
-
while (true) {
|
|
150
|
-
// --- Get the next character
|
|
151
|
-
ch = fetchNextChar();
|
|
152
|
-
skipTextAppend = false;
|
|
153
|
-
// --- In case of EOF, return the current token data
|
|
154
|
-
if (ch === null) {
|
|
155
|
-
return makeToken();
|
|
156
|
-
}
|
|
157
|
-
// --- Set the initial token type to unknown for the other characters
|
|
158
|
-
if (tokenType === UemlToken_1.UemlTokenType.Eof) {
|
|
159
|
-
tokenType = UemlToken_1.UemlTokenType.Unknown;
|
|
160
|
-
}
|
|
161
|
-
// --- Follow the lexer state machine
|
|
162
|
-
switch (phase) {
|
|
163
|
-
// ====================================================================
|
|
164
|
-
// Process the first character
|
|
165
|
-
case LexerPhase.Start:
|
|
166
|
-
switch (ch) {
|
|
167
|
-
// --- Go on with whitespaces
|
|
168
|
-
case " ":
|
|
169
|
-
case "\t":
|
|
170
|
-
case "\n":
|
|
171
|
-
case "\r":
|
|
172
|
-
if (searchForNested) {
|
|
173
|
-
phase = searchForNested ? LexerPhase.InNestedWhitespace : LexerPhase.InWhiteSpace;
|
|
174
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
phase = LexerPhase.InWhiteSpace;
|
|
178
|
-
tokenType = UemlToken_1.UemlTokenType.Ws;
|
|
179
|
-
}
|
|
180
|
-
break;
|
|
181
|
-
case "<":
|
|
182
|
-
phase = handleHardLiteralCase();
|
|
183
|
-
if (phase === LexerPhase.LeftAngle) {
|
|
184
|
-
phase = handleScriptLiteralCase();
|
|
185
|
-
}
|
|
186
|
-
break;
|
|
187
|
-
case ">":
|
|
188
|
-
return completeToken(UemlToken_1.UemlTokenType.NodeEnd);
|
|
189
|
-
case "/":
|
|
190
|
-
if (searchForNested) {
|
|
191
|
-
phase = LexerPhase.NestedText;
|
|
192
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
193
|
-
break;
|
|
194
|
-
}
|
|
195
|
-
phase = LexerPhase.CloseStart;
|
|
196
|
-
break;
|
|
197
|
-
case "=":
|
|
198
|
-
if (searchForNested) {
|
|
199
|
-
phase = LexerPhase.NestedText;
|
|
200
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
201
|
-
break;
|
|
202
|
-
}
|
|
203
|
-
return completeToken(UemlToken_1.UemlTokenType.Equal);
|
|
204
|
-
case ":":
|
|
205
|
-
if (searchForNested) {
|
|
206
|
-
phase = LexerPhase.NestedText;
|
|
207
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
return completeToken(UemlToken_1.UemlTokenType.Colon);
|
|
211
|
-
case "'":
|
|
212
|
-
case '"':
|
|
213
|
-
case "`":
|
|
214
|
-
phase = LexerPhase.String;
|
|
215
|
-
stringState = ch;
|
|
216
|
-
break;
|
|
217
|
-
case "&":
|
|
218
|
-
if (searchForNested) {
|
|
219
|
-
phase = LexerPhase.Ampersand;
|
|
220
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
221
|
-
break;
|
|
222
|
-
}
|
|
223
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
224
|
-
case "\\":
|
|
225
|
-
if (searchForNested) {
|
|
226
|
-
phase = LexerPhase.BackSlash;
|
|
227
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
228
|
-
break;
|
|
229
|
-
}
|
|
230
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
231
|
-
default:
|
|
232
|
-
if (isSingleWordChar(ch)) {
|
|
233
|
-
if (searchForNested) {
|
|
234
|
-
phase = LexerPhase.NestedText;
|
|
235
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
phase = LexerPhase.SingleWord;
|
|
239
|
-
tokenType = UemlToken_1.UemlTokenType.SingleWord;
|
|
240
|
-
}
|
|
241
|
-
break;
|
|
242
|
-
}
|
|
243
|
-
if (searchForNested) {
|
|
244
|
-
phase = LexerPhase.NestedText;
|
|
245
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
249
|
-
}
|
|
250
|
-
break;
|
|
251
|
-
// ====================================================================
|
|
252
|
-
// Whitespace processing
|
|
253
|
-
case LexerPhase.InWhiteSpace:
|
|
254
|
-
if (ch !== " " && ch !== "\t" && ch !== "\r" && ch !== "\n") {
|
|
255
|
-
return makeToken();
|
|
256
|
-
}
|
|
257
|
-
break;
|
|
258
|
-
case LexerPhase.InNestedWhitespace:
|
|
259
|
-
if (ch === " " || ch === "\t" || ch === "\r" || ch === "\n") {
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
if (ch === "<") {
|
|
263
|
-
phase = handleHardLiteralCase();
|
|
264
|
-
if (phase === LexerPhase.LeftAngle) {
|
|
265
|
-
phase = handleScriptLiteralCase();
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
}
|
|
269
|
-
if (ch === "'" || ch === '"' || ch === "`") {
|
|
270
|
-
phase = LexerPhase.String;
|
|
271
|
-
stringState = ch;
|
|
272
|
-
break;
|
|
273
|
-
}
|
|
274
|
-
// --- This is the start of a nested text
|
|
275
|
-
phase = LexerPhase.NestedText;
|
|
276
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
277
|
-
break;
|
|
278
|
-
// ====================================================================
|
|
279
|
-
// Hard literal processing
|
|
280
|
-
case LexerPhase.HardLiteral:
|
|
281
|
-
if (ch === exports.HARD_LITERAL_END[0]) {
|
|
282
|
-
// --- Recognize if hard literal end found
|
|
283
|
-
let isHardLiteral = true;
|
|
284
|
-
for (let i = 1; i < exports.HARD_LITERAL_END.length; i++) {
|
|
285
|
-
isHardLiteral = isHardLiteral && input.ahead(i - 1) === exports.HARD_LITERAL_END[i];
|
|
286
|
-
if (!isHardLiteral)
|
|
287
|
-
break;
|
|
288
|
-
}
|
|
289
|
-
if (isHardLiteral) {
|
|
290
|
-
text += exports.HARD_LITERAL_END;
|
|
291
|
-
skipTextAppend = true;
|
|
292
|
-
for (let i = 1; i < exports.HARD_LITERAL_END.length; i++) {
|
|
293
|
-
input.get();
|
|
294
|
-
}
|
|
295
|
-
return completeToken(UemlToken_1.UemlTokenType.HardLiteral);
|
|
296
|
-
}
|
|
297
|
-
break;
|
|
298
|
-
}
|
|
299
|
-
// --- We're still within a hard literal
|
|
300
|
-
break;
|
|
301
|
-
// ====================================================================
|
|
302
|
-
// Hard literal processing
|
|
303
|
-
case LexerPhase.ScriptLiteral:
|
|
304
|
-
if (ch === exports.SCRIPT_LITERAL_END[0]) {
|
|
305
|
-
// --- Recognize if hard literal end found
|
|
306
|
-
let isScriptLiteral = true;
|
|
307
|
-
for (let i = 1; i < exports.SCRIPT_LITERAL_END.length; i++) {
|
|
308
|
-
isScriptLiteral = isScriptLiteral && input.ahead(i - 1) === exports.SCRIPT_LITERAL_END[i];
|
|
309
|
-
if (!isScriptLiteral)
|
|
310
|
-
break;
|
|
311
|
-
}
|
|
312
|
-
if (isScriptLiteral) {
|
|
313
|
-
text += exports.SCRIPT_LITERAL_END;
|
|
314
|
-
skipTextAppend = true;
|
|
315
|
-
for (let i = 1; i < exports.SCRIPT_LITERAL_END.length; i++) {
|
|
316
|
-
input.get();
|
|
317
|
-
}
|
|
318
|
-
return completeToken(UemlToken_1.UemlTokenType.ScriptLiteral);
|
|
319
|
-
}
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
// --- We're still within a script literal
|
|
323
|
-
break;
|
|
324
|
-
// ====================================================================
|
|
325
|
-
// Nested text processing
|
|
326
|
-
case LexerPhase.BackSlash:
|
|
327
|
-
if (ch === "&") {
|
|
328
|
-
// --- Remove the last "\"
|
|
329
|
-
text = text.substring(0, text.length - 1);
|
|
330
|
-
}
|
|
331
|
-
phase = LexerPhase.NestedText;
|
|
332
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
333
|
-
break;
|
|
334
|
-
case LexerPhase.Ampersand:
|
|
335
|
-
const tail = input.getTail(input.position - 1);
|
|
336
|
-
if (tail.startsWith("amp;")) {
|
|
337
|
-
text = text.substring(0, text.length - 1);
|
|
338
|
-
ch = "&";
|
|
339
|
-
input.get(); // m
|
|
340
|
-
input.get(); // p
|
|
341
|
-
input.get(); // ;
|
|
342
|
-
}
|
|
343
|
-
else if (tail.startsWith("gt;")) {
|
|
344
|
-
text = text.substring(0, text.length - 1);
|
|
345
|
-
ch = ">";
|
|
346
|
-
input.get(); // t
|
|
347
|
-
input.get(); // ;
|
|
348
|
-
}
|
|
349
|
-
else if (tail.startsWith("lt;")) {
|
|
350
|
-
text = text.substring(0, text.length - 1);
|
|
351
|
-
ch = "<";
|
|
352
|
-
input.get(); // t
|
|
353
|
-
input.get(); // ;
|
|
354
|
-
}
|
|
355
|
-
else if (tail.startsWith("apos;")) {
|
|
356
|
-
text = text.substring(0, text.length - 1);
|
|
357
|
-
ch = "'";
|
|
358
|
-
input.get(); // p
|
|
359
|
-
input.get(); // o
|
|
360
|
-
input.get(); // s
|
|
361
|
-
input.get(); // ;
|
|
362
|
-
}
|
|
363
|
-
else if (tail.startsWith("quot;")) {
|
|
364
|
-
text = text.substring(0, text.length - 1);
|
|
365
|
-
ch = '"';
|
|
366
|
-
input.get(); // u
|
|
367
|
-
input.get(); // o
|
|
368
|
-
input.get(); // t
|
|
369
|
-
input.get(); // ;
|
|
370
|
-
}
|
|
371
|
-
phase = LexerPhase.NestedText;
|
|
372
|
-
break;
|
|
373
|
-
case LexerPhase.NestedText:
|
|
374
|
-
if (ch === "\\") {
|
|
375
|
-
phase = LexerPhase.BackSlash;
|
|
376
|
-
}
|
|
377
|
-
else if (ch === "&") {
|
|
378
|
-
phase = LexerPhase.Ampersand;
|
|
379
|
-
}
|
|
380
|
-
else if (ch === "<") {
|
|
381
|
-
return makeToken();
|
|
382
|
-
}
|
|
383
|
-
// --- We're still within a nested text
|
|
384
|
-
break;
|
|
385
|
-
// ====================================================================
|
|
386
|
-
// Opening and closing tags
|
|
387
|
-
case LexerPhase.LeftAngle:
|
|
388
|
-
if (ch === "!") {
|
|
389
|
-
phase = LexerPhase.LeftAngleExcl;
|
|
390
|
-
tokenType = UemlToken_1.UemlTokenType.Unknown;
|
|
391
|
-
}
|
|
392
|
-
else if (ch === "/") {
|
|
393
|
-
return completeToken(UemlToken_1.UemlTokenType.CloseNodeStart);
|
|
394
|
-
}
|
|
395
|
-
else {
|
|
396
|
-
return makeToken();
|
|
397
|
-
}
|
|
398
|
-
break;
|
|
399
|
-
// --- Testing for closing tags
|
|
400
|
-
case LexerPhase.CloseStart:
|
|
401
|
-
return ch === ">" ? completeToken(UemlToken_1.UemlTokenType.NodeClose) : makeToken();
|
|
402
|
-
// ====================================================================
|
|
403
|
-
// Collecting "single word" characters
|
|
404
|
-
case LexerPhase.SingleWord:
|
|
405
|
-
if (!isSingleWordChar(ch)) {
|
|
406
|
-
return makeToken();
|
|
407
|
-
}
|
|
408
|
-
break;
|
|
409
|
-
// ====================================================================
|
|
410
|
-
// Comment processing
|
|
411
|
-
case LexerPhase.LeftAngleExcl:
|
|
412
|
-
if (ch === "-") {
|
|
413
|
-
phase = LexerPhase.LeftAngleExclDash;
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
return makeToken();
|
|
417
|
-
}
|
|
418
|
-
break;
|
|
419
|
-
case LexerPhase.LeftAngleExclDash:
|
|
420
|
-
if (ch === "-") {
|
|
421
|
-
phase = LexerPhase.Comment;
|
|
422
|
-
}
|
|
423
|
-
else {
|
|
424
|
-
return makeToken();
|
|
425
|
-
}
|
|
426
|
-
break;
|
|
427
|
-
case LexerPhase.Comment:
|
|
428
|
-
if (ch === "-") {
|
|
429
|
-
phase = LexerPhase.CommentDash;
|
|
430
|
-
}
|
|
431
|
-
break;
|
|
432
|
-
case LexerPhase.CommentDash:
|
|
433
|
-
phase = ch === "-" ? LexerPhase.CommentTwoDash : LexerPhase.Comment;
|
|
434
|
-
break;
|
|
435
|
-
case LexerPhase.CommentTwoDash:
|
|
436
|
-
if (ch === ">") {
|
|
437
|
-
return completeToken(UemlToken_1.UemlTokenType.Comment);
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
phase = LexerPhase.Comment;
|
|
441
|
-
}
|
|
442
|
-
break;
|
|
443
|
-
// ====================================================================
|
|
444
|
-
// String processing
|
|
445
|
-
case LexerPhase.String:
|
|
446
|
-
if (ch === stringState) {
|
|
447
|
-
if (searchForNested) {
|
|
448
|
-
const tail = (_a = input.getTail(input.position)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
449
|
-
if ((tail === null || tail === void 0 ? void 0 : tail[0]) === "<") {
|
|
450
|
-
return completeToken(UemlToken_1.UemlTokenType.StringLiteral);
|
|
451
|
-
}
|
|
452
|
-
phase = LexerPhase.NestedText;
|
|
453
|
-
tokenType = UemlToken_1.UemlTokenType.NestedText;
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
return completeToken(UemlToken_1.UemlTokenType.StringLiteral);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
else if (ch === "\\") {
|
|
461
|
-
const tail = input.getTail(input.position);
|
|
462
|
-
if (tail.startsWith("&")) {
|
|
463
|
-
text += "&";
|
|
464
|
-
ch = ";";
|
|
465
|
-
input.get(); // &
|
|
466
|
-
input.get(); // a
|
|
467
|
-
input.get(); // m
|
|
468
|
-
input.get(); // p
|
|
469
|
-
input.get(); // ;
|
|
470
|
-
}
|
|
471
|
-
else if (tail.startsWith(">")) {
|
|
472
|
-
text += ">";
|
|
473
|
-
ch = ";";
|
|
474
|
-
input.get(); // &
|
|
475
|
-
input.get(); // g
|
|
476
|
-
input.get(); // t
|
|
477
|
-
input.get(); // ;
|
|
478
|
-
}
|
|
479
|
-
else if (tail.startsWith("<")) {
|
|
480
|
-
text += "<";
|
|
481
|
-
ch = ";";
|
|
482
|
-
input.get(); // &
|
|
483
|
-
input.get(); // l
|
|
484
|
-
input.get(); // t
|
|
485
|
-
input.get(); // ;
|
|
486
|
-
}
|
|
487
|
-
else if (tail.startsWith("'")) {
|
|
488
|
-
text += "&apos";
|
|
489
|
-
ch = ";";
|
|
490
|
-
input.get(); // &
|
|
491
|
-
input.get(); // a
|
|
492
|
-
input.get(); // p
|
|
493
|
-
input.get(); // o
|
|
494
|
-
input.get(); // s
|
|
495
|
-
input.get(); // ;
|
|
496
|
-
}
|
|
497
|
-
else if (tail.startsWith(""")) {
|
|
498
|
-
text += """;
|
|
499
|
-
ch = ";";
|
|
500
|
-
input.get(); // &
|
|
501
|
-
input.get(); // q
|
|
502
|
-
input.get(); // u
|
|
503
|
-
input.get(); // o
|
|
504
|
-
input.get(); // t
|
|
505
|
-
input.get(); // ;
|
|
506
|
-
}
|
|
507
|
-
else {
|
|
508
|
-
phase = LexerPhase.StringBackSlash;
|
|
509
|
-
tokenType = UemlToken_1.UemlTokenType.Unknown;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
else {
|
|
513
|
-
const tail = input.getTail(input.position - 1);
|
|
514
|
-
if (tail.startsWith("&")) {
|
|
515
|
-
ch = "&";
|
|
516
|
-
input.get(); // a
|
|
517
|
-
input.get(); // m
|
|
518
|
-
input.get(); // p
|
|
519
|
-
input.get(); // ;
|
|
520
|
-
}
|
|
521
|
-
else if (tail.startsWith(">")) {
|
|
522
|
-
ch = ">";
|
|
523
|
-
input.get(); // g
|
|
524
|
-
input.get(); // t
|
|
525
|
-
input.get(); // ;
|
|
526
|
-
}
|
|
527
|
-
else if (tail.startsWith("<")) {
|
|
528
|
-
ch = "<";
|
|
529
|
-
input.get(); // l
|
|
530
|
-
input.get(); // t
|
|
531
|
-
input.get(); // ;
|
|
532
|
-
}
|
|
533
|
-
else if (tail.startsWith("'")) {
|
|
534
|
-
ch = "'";
|
|
535
|
-
input.get(); // a
|
|
536
|
-
input.get(); // p
|
|
537
|
-
input.get(); // o
|
|
538
|
-
input.get(); // s
|
|
539
|
-
input.get(); // ;
|
|
540
|
-
}
|
|
541
|
-
else if (tail.startsWith(""")) {
|
|
542
|
-
ch = '"';
|
|
543
|
-
input.get(); // q
|
|
544
|
-
input.get(); // u
|
|
545
|
-
input.get(); // o
|
|
546
|
-
input.get(); // t
|
|
547
|
-
input.get(); // ;
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
break;
|
|
551
|
-
// Start of string character escape
|
|
552
|
-
case LexerPhase.StringBackSlash:
|
|
553
|
-
switch (ch) {
|
|
554
|
-
case "b":
|
|
555
|
-
case "f":
|
|
556
|
-
case "n":
|
|
557
|
-
case "r":
|
|
558
|
-
case "t":
|
|
559
|
-
case "v":
|
|
560
|
-
case "S":
|
|
561
|
-
case "0":
|
|
562
|
-
case "'":
|
|
563
|
-
case '"':
|
|
564
|
-
case "`":
|
|
565
|
-
case "\\":
|
|
566
|
-
phase = LexerPhase.String;
|
|
567
|
-
break;
|
|
568
|
-
case "x":
|
|
569
|
-
phase = LexerPhase.StringHexa1;
|
|
570
|
-
break;
|
|
571
|
-
case "u":
|
|
572
|
-
phase = LexerPhase.StringUHexa1;
|
|
573
|
-
break;
|
|
574
|
-
default:
|
|
575
|
-
phase = LexerPhase.String;
|
|
576
|
-
break;
|
|
577
|
-
}
|
|
578
|
-
break;
|
|
579
|
-
// --- First hexadecimal digit of string character escape
|
|
580
|
-
case LexerPhase.StringHexa1:
|
|
581
|
-
if (isHexadecimalDigit(ch)) {
|
|
582
|
-
phase = LexerPhase.StringHexa2;
|
|
583
|
-
}
|
|
584
|
-
else {
|
|
585
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
586
|
-
}
|
|
587
|
-
break;
|
|
588
|
-
// --- Second hexadecimal digit of character escape
|
|
589
|
-
case LexerPhase.StringHexa2:
|
|
590
|
-
if (isHexadecimalDigit(ch)) {
|
|
591
|
-
phase = LexerPhase.String;
|
|
592
|
-
}
|
|
593
|
-
else {
|
|
594
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
595
|
-
}
|
|
596
|
-
break;
|
|
597
|
-
// --- First hexadecimal digit of Unicode string character escape
|
|
598
|
-
case LexerPhase.StringUHexa1:
|
|
599
|
-
if (ch === "{") {
|
|
600
|
-
phase = LexerPhase.StringUcp1;
|
|
601
|
-
break;
|
|
602
|
-
}
|
|
603
|
-
if (isHexadecimalDigit(ch)) {
|
|
604
|
-
phase = LexerPhase.StringUHexa2;
|
|
605
|
-
}
|
|
606
|
-
else {
|
|
607
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
608
|
-
}
|
|
609
|
-
break;
|
|
610
|
-
// --- Second hexadecimal digit of Unicode string character escape
|
|
611
|
-
case LexerPhase.StringUHexa2:
|
|
612
|
-
if (isHexadecimalDigit(ch)) {
|
|
613
|
-
phase = LexerPhase.StringUHexa3;
|
|
614
|
-
}
|
|
615
|
-
else {
|
|
616
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
617
|
-
}
|
|
618
|
-
break;
|
|
619
|
-
// --- Third hexadecimal digit of Unicode string character escape
|
|
620
|
-
case LexerPhase.StringUHexa3:
|
|
621
|
-
if (isHexadecimalDigit(ch)) {
|
|
622
|
-
phase = LexerPhase.StringUHexa4;
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
626
|
-
}
|
|
627
|
-
break;
|
|
628
|
-
// --- Fourth hexadecimal digit of Unicode string character escape
|
|
629
|
-
case LexerPhase.StringUHexa4:
|
|
630
|
-
if (isHexadecimalDigit(ch)) {
|
|
631
|
-
phase = LexerPhase.String;
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
635
|
-
}
|
|
636
|
-
break;
|
|
637
|
-
// --- First hexadecimal digit of Unicode codepoint string character escape
|
|
638
|
-
case LexerPhase.StringUcp1:
|
|
639
|
-
if (isHexadecimalDigit(ch)) {
|
|
640
|
-
phase = LexerPhase.StringUcp2;
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
644
|
-
}
|
|
645
|
-
break;
|
|
646
|
-
// --- Second hexadecimal digit of Unicode codepoint string character escape
|
|
647
|
-
case LexerPhase.StringUcp2:
|
|
648
|
-
if (ch === "}") {
|
|
649
|
-
phase = LexerPhase.String;
|
|
650
|
-
}
|
|
651
|
-
else if (isHexadecimalDigit(ch)) {
|
|
652
|
-
phase = LexerPhase.StringUcp3;
|
|
653
|
-
}
|
|
654
|
-
else {
|
|
655
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
656
|
-
}
|
|
657
|
-
break;
|
|
658
|
-
// --- Third hexadecimal digit of Unicode codepoint string character escape
|
|
659
|
-
case LexerPhase.StringUcp3:
|
|
660
|
-
if (ch === "}") {
|
|
661
|
-
phase = LexerPhase.String;
|
|
662
|
-
}
|
|
663
|
-
else if (isHexadecimalDigit(ch)) {
|
|
664
|
-
phase = LexerPhase.StringUcp4;
|
|
665
|
-
}
|
|
666
|
-
else {
|
|
667
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
668
|
-
}
|
|
669
|
-
break;
|
|
670
|
-
// --- Fourth hexadecimal digit of Unicode codepoint string character escape
|
|
671
|
-
case LexerPhase.StringUcp4:
|
|
672
|
-
if (ch === "}") {
|
|
673
|
-
phase = LexerPhase.String;
|
|
674
|
-
}
|
|
675
|
-
else if (isHexadecimalDigit(ch)) {
|
|
676
|
-
phase = LexerPhase.StringUcp5;
|
|
677
|
-
}
|
|
678
|
-
else {
|
|
679
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
680
|
-
}
|
|
681
|
-
break;
|
|
682
|
-
// --- Fifth hexadecimal digit of Unicode codepoint string character escape
|
|
683
|
-
case LexerPhase.StringUcp5:
|
|
684
|
-
if (ch === "}") {
|
|
685
|
-
phase = LexerPhase.String;
|
|
686
|
-
}
|
|
687
|
-
else if (isHexadecimalDigit(ch)) {
|
|
688
|
-
phase = LexerPhase.StringUcp6;
|
|
689
|
-
}
|
|
690
|
-
else {
|
|
691
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
692
|
-
}
|
|
693
|
-
break;
|
|
694
|
-
// --- Sixth hexadecimal digit of Unicode codepoint string character escape
|
|
695
|
-
case LexerPhase.StringUcp6:
|
|
696
|
-
if (ch === "}") {
|
|
697
|
-
phase = LexerPhase.String;
|
|
698
|
-
}
|
|
699
|
-
else if (isHexadecimalDigit(ch)) {
|
|
700
|
-
phase = LexerPhase.StringUcpTail;
|
|
701
|
-
}
|
|
702
|
-
else {
|
|
703
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
704
|
-
}
|
|
705
|
-
break;
|
|
706
|
-
// --- Closing bracket of Unicode codepoint string character escape
|
|
707
|
-
case LexerPhase.StringUcpTail:
|
|
708
|
-
if (ch === "}") {
|
|
709
|
-
phase = LexerPhase.String;
|
|
710
|
-
}
|
|
711
|
-
else {
|
|
712
|
-
return completeToken(UemlToken_1.UemlTokenType.Unknown);
|
|
713
|
-
}
|
|
714
|
-
break;
|
|
715
|
-
}
|
|
716
|
-
// --- Append the char to the current text
|
|
717
|
-
appendTokenChar();
|
|
718
|
-
// --- Go on with parsing the next character
|
|
719
|
-
}
|
|
720
|
-
// --- Handle hard literal checking
|
|
721
|
-
function handleHardLiteralCase() {
|
|
722
|
-
let isHardLiteral = true;
|
|
723
|
-
for (let i = 1; i < exports.HARD_LITERAL_START.length; i++) {
|
|
724
|
-
const ahead = input.ahead(i - 1);
|
|
725
|
-
isHardLiteral = isHardLiteral && ahead === exports.HARD_LITERAL_START[i];
|
|
726
|
-
if (!isHardLiteral)
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
if (isHardLiteral) {
|
|
730
|
-
text += exports.HARD_LITERAL_START;
|
|
731
|
-
skipTextAppend = true;
|
|
732
|
-
for (let i = 1; i < exports.HARD_LITERAL_START.length; i++) {
|
|
733
|
-
input.get();
|
|
734
|
-
}
|
|
735
|
-
return LexerPhase.HardLiteral;
|
|
736
|
-
}
|
|
737
|
-
tokenType = UemlToken_1.UemlTokenType.OpenNodeStart;
|
|
738
|
-
return LexerPhase.LeftAngle;
|
|
739
|
-
}
|
|
740
|
-
// --- Handle hard literal checking
|
|
741
|
-
function handleScriptLiteralCase() {
|
|
742
|
-
let isScriptLiteral = true;
|
|
743
|
-
for (let i = 1; i < exports.SCRIPT_LITERAL_START.length; i++) {
|
|
744
|
-
const ahead = input.ahead(i - 1);
|
|
745
|
-
isScriptLiteral = isScriptLiteral && ahead === exports.SCRIPT_LITERAL_START[i];
|
|
746
|
-
if (!isScriptLiteral)
|
|
747
|
-
break;
|
|
748
|
-
}
|
|
749
|
-
if (isScriptLiteral) {
|
|
750
|
-
text += exports.SCRIPT_LITERAL_START;
|
|
751
|
-
skipTextAppend = true;
|
|
752
|
-
for (let i = 1; i < exports.SCRIPT_LITERAL_START.length; i++) {
|
|
753
|
-
input.get();
|
|
754
|
-
}
|
|
755
|
-
return LexerPhase.ScriptLiteral;
|
|
756
|
-
}
|
|
757
|
-
tokenType = UemlToken_1.UemlTokenType.OpenNodeStart;
|
|
758
|
-
return LexerPhase.LeftAngle;
|
|
759
|
-
}
|
|
760
|
-
/**
|
|
761
|
-
* Appends the last character to the token, and manages positions
|
|
762
|
-
*/
|
|
763
|
-
function appendTokenChar() {
|
|
764
|
-
if (!skipTextAppend) {
|
|
765
|
-
text += ch;
|
|
766
|
-
}
|
|
767
|
-
lexer._prefetched = null;
|
|
768
|
-
lexer._prefetchedPos = null;
|
|
769
|
-
lexer._prefetchedColumn = null;
|
|
770
|
-
lastEndPos = input.position;
|
|
771
|
-
lastEndColumn = input.position;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Fetches the next character from the input stream
|
|
775
|
-
*/
|
|
776
|
-
function fetchNextChar() {
|
|
777
|
-
if (!lexer._prefetched) {
|
|
778
|
-
lexer._prefetchedPos = input.position;
|
|
779
|
-
lexer._prefetched = input.get();
|
|
780
|
-
}
|
|
781
|
-
return lexer._prefetched;
|
|
782
|
-
}
|
|
783
|
-
/**
|
|
784
|
-
* Packs the specified type of token to send back
|
|
785
|
-
*/
|
|
786
|
-
function makeToken() {
|
|
787
|
-
if (tokenType === UemlToken_1.UemlTokenType.SingleWord) {
|
|
788
|
-
// --- A single word may be an identifier
|
|
789
|
-
if (uemlIdRegex.test(text)) {
|
|
790
|
-
tokenType = UemlToken_1.UemlTokenType.Identifier;
|
|
791
|
-
}
|
|
792
|
-
else {
|
|
793
|
-
tokenType = UemlToken_1.UemlTokenType.Unknown;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return {
|
|
797
|
-
text,
|
|
798
|
-
type: tokenType,
|
|
799
|
-
location: {
|
|
800
|
-
startPosition: startPos,
|
|
801
|
-
endPosition: lastEndPos,
|
|
802
|
-
startLine: line,
|
|
803
|
-
endLine: line,
|
|
804
|
-
startColumn,
|
|
805
|
-
endColumn: lastEndColumn,
|
|
806
|
-
},
|
|
807
|
-
};
|
|
808
|
-
}
|
|
809
|
-
/**
|
|
810
|
-
* Add the last character to the token and return it
|
|
811
|
-
*/
|
|
812
|
-
function completeToken(suggestedType) {
|
|
813
|
-
appendTokenChar();
|
|
814
|
-
// --- Send back the token
|
|
815
|
-
if (suggestedType !== undefined) {
|
|
816
|
-
tokenType = suggestedType;
|
|
817
|
-
}
|
|
818
|
-
return makeToken();
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
exports.UemlLexer = UemlLexer;
|
|
823
|
-
/**
|
|
824
|
-
* Tests if a token id EOF
|
|
825
|
-
* @param t Token instance
|
|
826
|
-
*/
|
|
827
|
-
function isEof(t) {
|
|
828
|
-
return t.type === UemlToken_1.UemlTokenType.Eof;
|
|
829
|
-
}
|
|
830
|
-
/**
|
|
831
|
-
* Tests if a token is whitespace
|
|
832
|
-
* @param t Token instance
|
|
833
|
-
*/
|
|
834
|
-
function isWs(t) {
|
|
835
|
-
return t.type <= UemlToken_1.UemlTokenType.Ws;
|
|
836
|
-
}
|
|
837
|
-
/**
|
|
838
|
-
* Tests if a character is an identifier start character
|
|
839
|
-
* @param ch Character to test
|
|
840
|
-
*/
|
|
841
|
-
function isSingleWordChar(ch) {
|
|
842
|
-
return ((ch >= "a" && ch <= "z") ||
|
|
843
|
-
(ch >= "A" && ch <= "Z") ||
|
|
844
|
-
(ch >= "0" && ch <= "9") ||
|
|
845
|
-
ch === "$" ||
|
|
846
|
-
ch === "#" ||
|
|
847
|
-
ch === "@" ||
|
|
848
|
-
ch === "_" ||
|
|
849
|
-
ch === "." ||
|
|
850
|
-
ch === "," ||
|
|
851
|
-
ch === "%" ||
|
|
852
|
-
ch === "(" ||
|
|
853
|
-
ch === ")" ||
|
|
854
|
-
ch === "{" ||
|
|
855
|
-
ch === "}" ||
|
|
856
|
-
ch === "[" ||
|
|
857
|
-
ch === "]" ||
|
|
858
|
-
ch === "+" ||
|
|
859
|
-
ch === "*" ||
|
|
860
|
-
ch === "-");
|
|
861
|
-
}
|
|
862
|
-
/**
|
|
863
|
-
* Tests if a character is a hexadecimal digit
|
|
864
|
-
* @param ch Character to test
|
|
865
|
-
*/
|
|
866
|
-
function isHexadecimalDigit(ch) {
|
|
867
|
-
return (ch >= "0" && ch <= "9") || (ch >= "A" && ch <= "F") || (ch >= "a" && ch <= "f");
|
|
868
|
-
}
|