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,476 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createXmlUiParser = createXmlUiParser;
|
|
4
|
+
exports.parseXmlUiMarkup = parseXmlUiMarkup;
|
|
5
|
+
const CharacterCodes_1 = require("./CharacterCodes");
|
|
6
|
+
const scanner_1 = require("./scanner");
|
|
7
|
+
const syntax_kind_1 = require("./syntax-kind");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const diagnostics_1 = require("./diagnostics");
|
|
10
|
+
const MakeErr = {
|
|
11
|
+
uppercaseAttr: function (attrName) {
|
|
12
|
+
return {
|
|
13
|
+
category: diagnostics_1.DiagnosticCategory.Error,
|
|
14
|
+
code: diagnostics_1.ErrCodes.uppercaseAttr,
|
|
15
|
+
message: `Attribute name '${attrName}' cannot start with an uppercase letter.`,
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
duplAttr: function (attrName) {
|
|
19
|
+
return {
|
|
20
|
+
category: diagnostics_1.DiagnosticCategory.Error,
|
|
21
|
+
code: diagnostics_1.ErrCodes.duplAttr,
|
|
22
|
+
message: `Duplicated attribute: '${attrName}'.`,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
tagNameMismatch: function (openTagName, closeTagName) {
|
|
26
|
+
return {
|
|
27
|
+
category: diagnostics_1.DiagnosticCategory.Error,
|
|
28
|
+
code: diagnostics_1.ErrCodes.tagNameMismatch,
|
|
29
|
+
message: `Opening and closing tag names should match. Opening tag has a name '${openTagName}', but the closing tag name is '${closeTagName}'.`,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
invalidChar: function (char) {
|
|
33
|
+
return {
|
|
34
|
+
category: diagnostics_1.DiagnosticCategory.Error,
|
|
35
|
+
code: diagnostics_1.ErrCodes.invalidChar,
|
|
36
|
+
message: `Invalid character '${char}'.`,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
const firstSetTagLike = [syntax_kind_1.SyntaxKind.CData, syntax_kind_1.SyntaxKind.Script, syntax_kind_1.SyntaxKind.OpenNodeStart];
|
|
41
|
+
// todo
|
|
42
|
+
// const firstSetContent = firstSetTagLike.concat ([
|
|
43
|
+
// SyntaxKind.Identifier,
|
|
44
|
+
// SyntaxKind.StringLiteral,
|
|
45
|
+
// ])
|
|
46
|
+
function createXmlUiParser(source) {
|
|
47
|
+
return {
|
|
48
|
+
parse: () => parseXmlUiMarkup(source),
|
|
49
|
+
getText: (n, ignoreTrivia = true) => source.substring(ignoreTrivia ? n.pos : n.start, n.end),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function parseXmlUiMarkup(text) {
|
|
53
|
+
const errors = [];
|
|
54
|
+
const parents = [];
|
|
55
|
+
let peekedToken;
|
|
56
|
+
let node = { children: [] };
|
|
57
|
+
let errFromScanner = undefined;
|
|
58
|
+
const onScannerErr = function (message, length) {
|
|
59
|
+
errFromScanner = {
|
|
60
|
+
message,
|
|
61
|
+
prefixLength: length,
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const scanner = (0, scanner_1.createScanner)(false, text, onScannerErr);
|
|
65
|
+
function getText(n, ignoreTrivia = true) {
|
|
66
|
+
return text.substring(ignoreTrivia ? n.pos : n.start, n.end);
|
|
67
|
+
}
|
|
68
|
+
function parseContent() {
|
|
69
|
+
startNode();
|
|
70
|
+
parseSource();
|
|
71
|
+
if (node.children && node.children.length > 0) {
|
|
72
|
+
completeNode(syntax_kind_1.SyntaxKind.ContentListNode);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
abandonNode();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function parseSource() {
|
|
79
|
+
while (true) {
|
|
80
|
+
const token = peekInContent();
|
|
81
|
+
switch (token.kind) {
|
|
82
|
+
case syntax_kind_1.SyntaxKind.TextNode:
|
|
83
|
+
case syntax_kind_1.SyntaxKind.StringLiteral:
|
|
84
|
+
bump(token.kind);
|
|
85
|
+
break;
|
|
86
|
+
case syntax_kind_1.SyntaxKind.CloseNodeStart:
|
|
87
|
+
return;
|
|
88
|
+
case syntax_kind_1.SyntaxKind.EndOfFileToken:
|
|
89
|
+
bump(syntax_kind_1.SyntaxKind.EndOfFileToken);
|
|
90
|
+
return;
|
|
91
|
+
default:
|
|
92
|
+
parseTagLike();
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function parseTagLike() {
|
|
98
|
+
if (!eat(syntax_kind_1.SyntaxKind.CData) && !eat(syntax_kind_1.SyntaxKind.Script)) {
|
|
99
|
+
if (at(syntax_kind_1.SyntaxKind.OpenNodeStart)) {
|
|
100
|
+
parseTag();
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
errorAndBump(diagnostics_1.Diag_OpenNodeStart_Token_Expected);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function parseTag() {
|
|
108
|
+
startNode();
|
|
109
|
+
bump(syntax_kind_1.SyntaxKind.OpenNodeStart);
|
|
110
|
+
let openTagName = undefined;
|
|
111
|
+
if (at(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
112
|
+
openTagName = parseTagName();
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
error(diagnostics_1.Diag_Tag_Identifier_Expected);
|
|
116
|
+
}
|
|
117
|
+
parseAttrList();
|
|
118
|
+
if (eat(syntax_kind_1.SyntaxKind.NodeClose)) {
|
|
119
|
+
completeNode(syntax_kind_1.SyntaxKind.ElementNode);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
else if (eat(syntax_kind_1.SyntaxKind.NodeEnd)) {
|
|
123
|
+
parseContent();
|
|
124
|
+
if (eat(syntax_kind_1.SyntaxKind.CloseNodeStart)) {
|
|
125
|
+
if (at(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
126
|
+
const closeTagName = parseTagName();
|
|
127
|
+
const namesMismatch = openTagName !== undefined && !(0, utils_1.tagNameNodesMatch)(openTagName, closeTagName, getText);
|
|
128
|
+
if (namesMismatch) {
|
|
129
|
+
error(MakeErr.tagNameMismatch(getText(openTagName), getText(closeTagName)));
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
errRecover(diagnostics_1.Diag_Tag_Identifier_Expected, [syntax_kind_1.SyntaxKind.NodeEnd]);
|
|
134
|
+
}
|
|
135
|
+
if (!eat(syntax_kind_1.SyntaxKind.NodeEnd)) {
|
|
136
|
+
error(diagnostics_1.Diag_End_Token_Expected);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
error(diagnostics_1.Diag_CloseNodeStart_Token_Expected);
|
|
141
|
+
}
|
|
142
|
+
completeNode(syntax_kind_1.SyntaxKind.ElementNode);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
error(diagnostics_1.Diag_End_Or_Close_Token_Expected);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function parseTagName() {
|
|
150
|
+
startNode();
|
|
151
|
+
bump(syntax_kind_1.SyntaxKind.Identifier);
|
|
152
|
+
if (eat(syntax_kind_1.SyntaxKind.Colon)) {
|
|
153
|
+
if (!eat(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
154
|
+
//TODO: error, possibly check for Eq and report that a name is missing before the attributes. Should parse as attribute then.
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return completeNode(syntax_kind_1.SyntaxKind.TagNameNode);
|
|
158
|
+
}
|
|
159
|
+
function parseAttrList() {
|
|
160
|
+
startNode();
|
|
161
|
+
const attrNames = [];
|
|
162
|
+
while (!atAnyOf([syntax_kind_1.SyntaxKind.EndOfFileToken, syntax_kind_1.SyntaxKind.NodeEnd, syntax_kind_1.SyntaxKind.NodeClose])) {
|
|
163
|
+
if (at(syntax_kind_1.SyntaxKind.Identifier)) {
|
|
164
|
+
parseAttr(attrNames);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
const atTagLike = errRecover(diagnostics_1.Diag_Attr_Identifier_Expected, firstSetTagLike);
|
|
168
|
+
if (atTagLike) {
|
|
169
|
+
parseTagLike();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (node.children.length === 0) {
|
|
174
|
+
abandonNode();
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
completeNode(syntax_kind_1.SyntaxKind.AttributeListNode);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function parseAttr(attrNames) {
|
|
181
|
+
//todo: make this recovery set actualy true (like implement handling cdata ,...)
|
|
182
|
+
const attrListFollow = [
|
|
183
|
+
// FOLLOW(AttrList) when a Tag is correct
|
|
184
|
+
syntax_kind_1.SyntaxKind.NodeClose,
|
|
185
|
+
syntax_kind_1.SyntaxKind.NodeEnd,
|
|
186
|
+
// FOLLOW(AttrList) when a Tag contains incorrect, but still parsed tokens for resilience
|
|
187
|
+
syntax_kind_1.SyntaxKind.CData,
|
|
188
|
+
// todo
|
|
189
|
+
// SyntaxKind.ScriptLiteral,
|
|
190
|
+
syntax_kind_1.SyntaxKind.OpenNodeStart,
|
|
191
|
+
];
|
|
192
|
+
const attrFollow = attrListFollow.concat(syntax_kind_1.SyntaxKind.Identifier);
|
|
193
|
+
const attrIdent = peek();
|
|
194
|
+
startNode();
|
|
195
|
+
bump(syntax_kind_1.SyntaxKind.Identifier);
|
|
196
|
+
if (eat(syntax_kind_1.SyntaxKind.Equal)) {
|
|
197
|
+
if (eat(syntax_kind_1.SyntaxKind.StringLiteral)) {
|
|
198
|
+
const attrName = getText(attrIdent);
|
|
199
|
+
if (attrNames.includes(attrName)) {
|
|
200
|
+
errorAt(MakeErr.duplAttr(attrName), attrIdent.pos, attrIdent.end);
|
|
201
|
+
}
|
|
202
|
+
else if (attrName[0] >= "A" && attrName[0] <= "Z") {
|
|
203
|
+
errorAt(MakeErr.uppercaseAttr(attrName), attrIdent.pos, attrIdent.end);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
attrNames.push(attrName);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
errRecover(diagnostics_1.Diag_Attr_Value_Expected, attrFollow);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
errRecover(diagnostics_1.Diag_Eq_Token_Expected, attrFollow);
|
|
215
|
+
}
|
|
216
|
+
completeNode(syntax_kind_1.SyntaxKind.AttributeNode);
|
|
217
|
+
}
|
|
218
|
+
function at(kindToCheck) {
|
|
219
|
+
return peek().kind === kindToCheck;
|
|
220
|
+
}
|
|
221
|
+
function eat(kind) {
|
|
222
|
+
const kindMatched = at(kind);
|
|
223
|
+
if (kindMatched) {
|
|
224
|
+
bumpAny();
|
|
225
|
+
}
|
|
226
|
+
return kindMatched;
|
|
227
|
+
}
|
|
228
|
+
function atAnyOf(kinds) {
|
|
229
|
+
return kinds.includes(peek().kind);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @param recoveryTokens the [FollowSet](https://www.geeksforgeeks.org/follow-set-in-syntax-analysis/) of the parsed InnerNode
|
|
233
|
+
* @returns true if the current token is in the recovery set, otherwise false
|
|
234
|
+
* */
|
|
235
|
+
function errRecover(errCodeAndMsg, recoveryTokens) {
|
|
236
|
+
if (atAnyOf(recoveryTokens) || at(syntax_kind_1.SyntaxKind.EndOfFileToken)) {
|
|
237
|
+
error(errCodeAndMsg);
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
startNode();
|
|
241
|
+
error(errCodeAndMsg);
|
|
242
|
+
bumpAny();
|
|
243
|
+
completeNode(syntax_kind_1.SyntaxKind.ErrorNode);
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
function error({ code, message, category }) {
|
|
247
|
+
const { pos, end } = peek();
|
|
248
|
+
errors.push({
|
|
249
|
+
category,
|
|
250
|
+
code,
|
|
251
|
+
message,
|
|
252
|
+
pos,
|
|
253
|
+
end,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
function errorAt({ code, message, category }, pos, end) {
|
|
257
|
+
errors.push({
|
|
258
|
+
category,
|
|
259
|
+
code,
|
|
260
|
+
message,
|
|
261
|
+
pos,
|
|
262
|
+
end,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
function peek(inContent = false) {
|
|
266
|
+
if (peekedToken !== undefined) {
|
|
267
|
+
return peekedToken;
|
|
268
|
+
}
|
|
269
|
+
peekedToken = collectToken(inContent);
|
|
270
|
+
return peekedToken;
|
|
271
|
+
}
|
|
272
|
+
function peekInContent() {
|
|
273
|
+
var _a;
|
|
274
|
+
const token = peek(true);
|
|
275
|
+
if (token.kind === syntax_kind_1.SyntaxKind.EndOfFileToken ||
|
|
276
|
+
token.kind === syntax_kind_1.SyntaxKind.OpenNodeStart ||
|
|
277
|
+
token.kind === syntax_kind_1.SyntaxKind.Script ||
|
|
278
|
+
token.kind === syntax_kind_1.SyntaxKind.CData ||
|
|
279
|
+
token.kind === syntax_kind_1.SyntaxKind.CloseNodeStart) {
|
|
280
|
+
return token;
|
|
281
|
+
}
|
|
282
|
+
const trivia = token.triviaBefore;
|
|
283
|
+
const triviaLength = (_a = trivia === null || trivia === void 0 ? void 0 : trivia.length) !== null && _a !== void 0 ? _a : 0;
|
|
284
|
+
let i = 0;
|
|
285
|
+
let leadingComments = [];
|
|
286
|
+
let firstNonCommentTriviaIdx = -1;
|
|
287
|
+
for (; i < triviaLength; ++i) {
|
|
288
|
+
if (trivia[i].kind === syntax_kind_1.SyntaxKind.CommentTrivia) {
|
|
289
|
+
leadingComments.push(trivia[i]);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
firstNonCommentTriviaIdx = i;
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
let secondCommentGroupStartIdx = -1;
|
|
297
|
+
for (; i < triviaLength; ++i) {
|
|
298
|
+
if (trivia[i].kind === syntax_kind_1.SyntaxKind.CommentTrivia) {
|
|
299
|
+
secondCommentGroupStartIdx = i;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
let parseAsStringLiteral = false;
|
|
304
|
+
if (token.kind === syntax_kind_1.SyntaxKind.StringLiteral) {
|
|
305
|
+
const beforeLookahead = token.end;
|
|
306
|
+
const nextToken = collectToken(true);
|
|
307
|
+
parseAsStringLiteral =
|
|
308
|
+
nextToken.kind === syntax_kind_1.SyntaxKind.CData ||
|
|
309
|
+
nextToken.kind === syntax_kind_1.SyntaxKind.CloseNodeStart ||
|
|
310
|
+
nextToken.kind === syntax_kind_1.SyntaxKind.Script ||
|
|
311
|
+
nextToken.kind === syntax_kind_1.SyntaxKind.OpenNodeStart;
|
|
312
|
+
scanner.resetTokenState(beforeLookahead);
|
|
313
|
+
}
|
|
314
|
+
let pos;
|
|
315
|
+
if (parseAsStringLiteral) {
|
|
316
|
+
pos = token.pos;
|
|
317
|
+
}
|
|
318
|
+
else if (leadingComments.length > 0) {
|
|
319
|
+
pos = leadingComments[leadingComments.length - 1].end;
|
|
320
|
+
}
|
|
321
|
+
else if (firstNonCommentTriviaIdx !== -1) {
|
|
322
|
+
pos = trivia[firstNonCommentTriviaIdx].pos;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
pos = token.start;
|
|
326
|
+
}
|
|
327
|
+
let start = pos;
|
|
328
|
+
let triviaBefore = undefined;
|
|
329
|
+
if (leadingComments.length > 0) {
|
|
330
|
+
triviaBefore = leadingComments;
|
|
331
|
+
start = leadingComments[0].pos;
|
|
332
|
+
}
|
|
333
|
+
let kind = syntax_kind_1.SyntaxKind.TextNode;
|
|
334
|
+
let end = -1;
|
|
335
|
+
if (secondCommentGroupStartIdx !== -1) {
|
|
336
|
+
end = trivia[secondCommentGroupStartIdx].pos;
|
|
337
|
+
scanner.resetTokenState(end);
|
|
338
|
+
}
|
|
339
|
+
else if (parseAsStringLiteral) {
|
|
340
|
+
kind = syntax_kind_1.SyntaxKind.StringLiteral;
|
|
341
|
+
end = token.end;
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
while (true) {
|
|
345
|
+
const nextChar = scanner.peekChar();
|
|
346
|
+
if (nextChar === null || nextChar === CharacterCodes_1.CharacterCodes.lessThan) {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
scanner.scanChar();
|
|
350
|
+
}
|
|
351
|
+
end = scanner.getTokenEnd();
|
|
352
|
+
}
|
|
353
|
+
peekedToken = { kind, start, pos, end, triviaBefore };
|
|
354
|
+
return peekedToken;
|
|
355
|
+
}
|
|
356
|
+
/** Same as bumpAny, but with an assertion of the token that was bumped over.
|
|
357
|
+
* Makes the code more redundant, but also more defensive*/
|
|
358
|
+
function bump(kind) {
|
|
359
|
+
const token = bumpAny();
|
|
360
|
+
if (token.kind !== kind) {
|
|
361
|
+
throw new Error(`expected ${(0, syntax_kind_1.getSyntaxKindStrRepr)(kind)}, bumped a ${(0, syntax_kind_1.getSyntaxKindStrRepr)(token.kind)}`);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function bumpAny() {
|
|
365
|
+
if (peekedToken) {
|
|
366
|
+
node.children.push(peekedToken);
|
|
367
|
+
const bumpedToken = peekedToken;
|
|
368
|
+
peekedToken = undefined;
|
|
369
|
+
return bumpedToken;
|
|
370
|
+
}
|
|
371
|
+
const token = collectToken(false);
|
|
372
|
+
node.children.push(token);
|
|
373
|
+
return token;
|
|
374
|
+
}
|
|
375
|
+
/** start a new node. Any new tokens or nodes will be put into it's children list from that point. Each call to this should be paired with a [completeNode] */
|
|
376
|
+
function startNode() {
|
|
377
|
+
parents.push(node);
|
|
378
|
+
node = {
|
|
379
|
+
children: [],
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
function completeNode(type) {
|
|
383
|
+
const completedNode = createNode(type, node.children);
|
|
384
|
+
const parentNode = parents[parents.length - 1];
|
|
385
|
+
parentNode.children.push(completedNode);
|
|
386
|
+
node = parentNode;
|
|
387
|
+
parents.pop();
|
|
388
|
+
return completedNode;
|
|
389
|
+
}
|
|
390
|
+
function collectToken(inContent) {
|
|
391
|
+
let kind;
|
|
392
|
+
let triviaCollected = [];
|
|
393
|
+
let start = null;
|
|
394
|
+
while (true) {
|
|
395
|
+
kind = scanner.scan();
|
|
396
|
+
if (start === null) {
|
|
397
|
+
start = scanner.getTokenStart();
|
|
398
|
+
}
|
|
399
|
+
//handle error from scanner
|
|
400
|
+
if (errFromScanner !== undefined) {
|
|
401
|
+
let err;
|
|
402
|
+
if (errFromScanner.message.code === diagnostics_1.ErrCodes.invalidChar) {
|
|
403
|
+
err = MakeErr.invalidChar(scanner.getText());
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
err = errFromScanner.message;
|
|
407
|
+
}
|
|
408
|
+
const pos = scanner.getTokenStart();
|
|
409
|
+
const token = {
|
|
410
|
+
kind,
|
|
411
|
+
start,
|
|
412
|
+
pos,
|
|
413
|
+
end: scanner.getTokenEnd(),
|
|
414
|
+
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
415
|
+
};
|
|
416
|
+
triviaCollected = [];
|
|
417
|
+
if (inContent && err.code === diagnostics_1.ErrCodes.invalidChar) {
|
|
418
|
+
errFromScanner = undefined;
|
|
419
|
+
return token;
|
|
420
|
+
}
|
|
421
|
+
const badPrefixEnd = pos + errFromScanner.prefixLength;
|
|
422
|
+
token.end = badPrefixEnd;
|
|
423
|
+
scanner.resetTokenState(badPrefixEnd);
|
|
424
|
+
startNode();
|
|
425
|
+
node.children.push(token);
|
|
426
|
+
errorAt(err, pos, badPrefixEnd);
|
|
427
|
+
completeNode(syntax_kind_1.SyntaxKind.ErrorNode);
|
|
428
|
+
errFromScanner = undefined;
|
|
429
|
+
return collectToken(inContent);
|
|
430
|
+
}
|
|
431
|
+
switch (kind) {
|
|
432
|
+
case syntax_kind_1.SyntaxKind.CommentTrivia:
|
|
433
|
+
case syntax_kind_1.SyntaxKind.NewLineTrivia:
|
|
434
|
+
case syntax_kind_1.SyntaxKind.WhitespaceTrivia:
|
|
435
|
+
triviaCollected.push({
|
|
436
|
+
kind,
|
|
437
|
+
start,
|
|
438
|
+
pos: scanner.getTokenStart(),
|
|
439
|
+
end: scanner.getTokenEnd(),
|
|
440
|
+
});
|
|
441
|
+
break;
|
|
442
|
+
default:
|
|
443
|
+
return {
|
|
444
|
+
kind,
|
|
445
|
+
start,
|
|
446
|
+
pos: scanner.getTokenStart(),
|
|
447
|
+
end: scanner.getTokenEnd(),
|
|
448
|
+
triviaBefore: triviaCollected.length > 0 ? triviaCollected : undefined,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
function errorAndBump(errCodeAndMsg) {
|
|
454
|
+
errRecover(errCodeAndMsg, []);
|
|
455
|
+
}
|
|
456
|
+
function abandonNode() {
|
|
457
|
+
const parentNode = parents[parents.length - 1];
|
|
458
|
+
parentNode.children.push(...node.children);
|
|
459
|
+
node = parentNode;
|
|
460
|
+
parents.pop();
|
|
461
|
+
}
|
|
462
|
+
parseSource();
|
|
463
|
+
const completedNode = createNode(syntax_kind_1.SyntaxKind.ContentListNode, node.children);
|
|
464
|
+
return { node: completedNode, errors };
|
|
465
|
+
}
|
|
466
|
+
function createNode(kind, children) {
|
|
467
|
+
const firstChild = children[0];
|
|
468
|
+
const lastChild = children[children.length - 1];
|
|
469
|
+
return {
|
|
470
|
+
kind,
|
|
471
|
+
start: firstChild.start,
|
|
472
|
+
pos: firstChild.pos,
|
|
473
|
+
end: lastChild.end,
|
|
474
|
+
children,
|
|
475
|
+
};
|
|
476
|
+
}
|