This is page 145 of 188. Use http://codebase.md/xmlui-org/xmlui/assets/img/%7BfaviconUrl%7D?lines=true&page={x} to view the full context.
# Directory Structure
```
├── .changeset
│ └── config.json
├── .eslintrc.cjs
├── .github
│ ├── build-checklist.png
│ ├── ISSUE_TEMPLATE
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows
│ ├── deploy-blog-optimized.yml
│ ├── deploy-blog-swa.yml
│ ├── deploy-blog.yml
│ ├── deploy-docs-optimized.yml
│ ├── deploy-docs-swa.yml
│ ├── deploy-docs.yml
│ ├── prepare-versions.yml
│ ├── release-packages.yml
│ ├── run-all-tests.yml
│ └── run-smoke-tests.yml
├── .gitignore
├── .prettierrc.js
├── .vscode
│ ├── launch.json
│ └── settings.json
├── blog
│ ├── .gitignore
│ ├── .gitkeep
│ ├── CHANGELOG.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── blog
│ │ │ ├── images
│ │ │ │ ├── an-advanced-codefence.gif
│ │ │ │ ├── an-advanced-codefence.mp4
│ │ │ │ ├── blog-page-component.png
│ │ │ │ ├── blog-scrabble.png
│ │ │ │ ├── codefence-runner.png
│ │ │ │ ├── integrated-blog-search.png
│ │ │ │ ├── lorem-ipsum.png
│ │ │ │ ├── playground-checkbox-source.png
│ │ │ │ ├── playground.png
│ │ │ │ ├── use-xmlui-mcp-to-find-a-howto.png
│ │ │ │ └── xmlui-demo-gallery.png
│ │ │ ├── introducing-xmlui.md
│ │ │ ├── lorem-ipsum.md
│ │ │ ├── newest-post.md
│ │ │ ├── older-post.md
│ │ │ ├── xmlui-playground.md
│ │ │ └── xmlui-powered-blog.md
│ │ ├── mockServiceWorker.js
│ │ ├── resources
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ └── for-download
│ │ │ │ └── xmlui
│ │ │ │ └── xmlui-standalone.umd.js
│ │ │ ├── github.svg
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ ├── rss.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ ├── staticwebapp.config.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ └── PageNotFound.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── blog-theme.ts
│ └── tsconfig.json
├── CONTRIBUTING.md
├── docs
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── ComponentRefLinks.txt
│ ├── content
│ │ ├── _meta.json
│ │ ├── components
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── APICall.md
│ │ │ ├── App.md
│ │ │ ├── AppHeader.md
│ │ │ ├── AppState.md
│ │ │ ├── AutoComplete.md
│ │ │ ├── Avatar.md
│ │ │ ├── Backdrop.md
│ │ │ ├── Badge.md
│ │ │ ├── BarChart.md
│ │ │ ├── Bookmark.md
│ │ │ ├── Breakout.md
│ │ │ ├── Button.md
│ │ │ ├── Card.md
│ │ │ ├── Carousel.md
│ │ │ ├── ChangeListener.md
│ │ │ ├── Checkbox.md
│ │ │ ├── CHStack.md
│ │ │ ├── ColorPicker.md
│ │ │ ├── Column.md
│ │ │ ├── ContentSeparator.md
│ │ │ ├── CVStack.md
│ │ │ ├── DataSource.md
│ │ │ ├── DateInput.md
│ │ │ ├── DatePicker.md
│ │ │ ├── DonutChart.md
│ │ │ ├── DropdownMenu.md
│ │ │ ├── EmojiSelector.md
│ │ │ ├── ExpandableItem.md
│ │ │ ├── FileInput.md
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FlowLayout.md
│ │ │ ├── Footer.md
│ │ │ ├── Form.md
│ │ │ ├── FormItem.md
│ │ │ ├── FormSection.md
│ │ │ ├── Fragment.md
│ │ │ ├── H1.md
│ │ │ ├── H2.md
│ │ │ ├── H3.md
│ │ │ ├── H4.md
│ │ │ ├── H5.md
│ │ │ ├── H6.md
│ │ │ ├── Heading.md
│ │ │ ├── HSplitter.md
│ │ │ ├── HStack.md
│ │ │ ├── Icon.md
│ │ │ ├── IFrame.md
│ │ │ ├── Image.md
│ │ │ ├── Items.md
│ │ │ ├── LabelList.md
│ │ │ ├── Legend.md
│ │ │ ├── LineChart.md
│ │ │ ├── Link.md
│ │ │ ├── List.md
│ │ │ ├── Logo.md
│ │ │ ├── Markdown.md
│ │ │ ├── MenuItem.md
│ │ │ ├── MenuSeparator.md
│ │ │ ├── ModalDialog.md
│ │ │ ├── NavGroup.md
│ │ │ ├── NavLink.md
│ │ │ ├── NavPanel.md
│ │ │ ├── NoResult.md
│ │ │ ├── NumberBox.md
│ │ │ ├── Option.md
│ │ │ ├── Page.md
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── Pages.md
│ │ │ ├── Pagination.md
│ │ │ ├── PasswordInput.md
│ │ │ ├── PieChart.md
│ │ │ ├── ProgressBar.md
│ │ │ ├── Queue.md
│ │ │ ├── RadioGroup.md
│ │ │ ├── RealTimeAdapter.md
│ │ │ ├── Redirect.md
│ │ │ ├── Select.md
│ │ │ ├── Slider.md
│ │ │ ├── Slot.md
│ │ │ ├── SpaceFiller.md
│ │ │ ├── Spinner.md
│ │ │ ├── Splitter.md
│ │ │ ├── Stack.md
│ │ │ ├── StickyBox.md
│ │ │ ├── SubMenuItem.md
│ │ │ ├── Switch.md
│ │ │ ├── TabItem.md
│ │ │ ├── Table.md
│ │ │ ├── TableOfContents.md
│ │ │ ├── Tabs.md
│ │ │ ├── Text.md
│ │ │ ├── TextArea.md
│ │ │ ├── TextBox.md
│ │ │ ├── Theme.md
│ │ │ ├── TimeInput.md
│ │ │ ├── Timer.md
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneSwitch.md
│ │ │ ├── Tooltip.md
│ │ │ ├── Tree.md
│ │ │ ├── VSplitter.md
│ │ │ ├── VStack.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ ├── xmlui-spreadsheet
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Spreadsheet.md
│ │ │ └── xmlui-website-blocks
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Carousel.md
│ │ │ ├── HelloMd.md
│ │ │ ├── HeroSection.md
│ │ │ └── ScrollToTop.md
│ │ └── extensions
│ │ ├── _meta.json
│ │ ├── xmlui-animations
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ ├── Animation.md
│ │ │ ├── FadeAnimation.md
│ │ │ ├── FadeInAnimation.md
│ │ │ ├── FadeOutAnimation.md
│ │ │ ├── ScaleAnimation.md
│ │ │ └── SlideInAnimation.md
│ │ └── xmlui-website-blocks
│ │ ├── _meta.json
│ │ ├── _overview.md
│ │ ├── Carousel.md
│ │ ├── HelloMd.md
│ │ ├── HeroSection.md
│ │ └── ScrollToTop.md
│ ├── extensions.ts
│ ├── index.html
│ ├── index.ts
│ ├── package.json
│ ├── public
│ │ ├── feed.rss
│ │ ├── mockServiceWorker.js
│ │ ├── pages
│ │ │ ├── _meta.json
│ │ │ ├── app-structure.md
│ │ │ ├── build-editor-component.md
│ │ │ ├── build-hello-world-component.md
│ │ │ ├── components-intro.md
│ │ │ ├── context-variables.md
│ │ │ ├── forms.md
│ │ │ ├── globals.md
│ │ │ ├── glossary.md
│ │ │ ├── helper-tags.md
│ │ │ ├── hosted-deployment.md
│ │ │ ├── howto
│ │ │ │ ├── assign-a-complex-json-literal-to-a-component-variable.md
│ │ │ │ ├── chain-a-refetch.md
│ │ │ │ ├── control-cache-invalidation.md
│ │ │ │ ├── debounce-user-input-for-api-calls.md
│ │ │ │ ├── debounce-with-changelistener.md
│ │ │ │ ├── debug-a-component.md
│ │ │ │ ├── delay-a-datasource-until-another-datasource-is-ready.md
│ │ │ │ ├── delegate-a-method.md
│ │ │ │ ├── do-custom-form-validation.md
│ │ │ │ ├── expose-a-method-from-a-component.md
│ │ │ │ ├── filter-and-transform-data-from-an-api.md
│ │ │ │ ├── group-items-in-list-by-a-property.md
│ │ │ │ ├── handle-background-operations.md
│ │ │ │ ├── hide-an-element-until-its-datasource-is-ready.md
│ │ │ │ ├── make-a-set-of-equal-width-cards.md
│ │ │ │ ├── make-a-table-responsive.md
│ │ │ │ ├── make-navpanel-width-responsive.md
│ │ │ │ ├── modify-a-value-reported-in-a-column.md
│ │ │ │ ├── paginate-a-list.md
│ │ │ │ ├── pass-data-to-a-modal-dialog.md
│ │ │ │ ├── react-to-button-click-not-keystrokes.md
│ │ │ │ ├── set-the-initial-value-of-a-select-from-fetched-data.md
│ │ │ │ ├── share-a-modaldialog-across-components.md
│ │ │ │ ├── sync-selections-between-table-and-list-views.md
│ │ │ │ ├── update-ui-optimistically.md
│ │ │ │ ├── use-built-in-form-validation.md
│ │ │ │ └── use-the-same-modaldialog-to-add-or-edit.md
│ │ │ ├── howto.md
│ │ │ ├── intro.md
│ │ │ ├── layout.md
│ │ │ ├── markup.md
│ │ │ ├── mcp.md
│ │ │ ├── modal-dialogs.md
│ │ │ ├── news-and-reviews.md
│ │ │ ├── reactive-intro.md
│ │ │ ├── refactoring.md
│ │ │ ├── routing-and-links.md
│ │ │ ├── samples
│ │ │ │ ├── color-palette.xmlui
│ │ │ │ ├── color-values.xmlui
│ │ │ │ ├── shadow-sizes.xmlui
│ │ │ │ ├── spacing-sizes.xmlui
│ │ │ │ ├── swatch.xmlui
│ │ │ │ ├── theme-gallery-brief.xmlui
│ │ │ │ └── theme-gallery.xmlui
│ │ │ ├── scoping.md
│ │ │ ├── scripting.md
│ │ │ ├── styles-and-themes
│ │ │ │ ├── common-units.md
│ │ │ │ ├── layout-props.md
│ │ │ │ ├── theme-variable-defaults.md
│ │ │ │ ├── theme-variables.md
│ │ │ │ └── themes.md
│ │ │ ├── template-properties.md
│ │ │ ├── test.md
│ │ │ ├── tutorial-01.md
│ │ │ ├── tutorial-02.md
│ │ │ ├── tutorial-03.md
│ │ │ ├── tutorial-04.md
│ │ │ ├── tutorial-05.md
│ │ │ ├── tutorial-06.md
│ │ │ ├── tutorial-07.md
│ │ │ ├── tutorial-08.md
│ │ │ ├── tutorial-09.md
│ │ │ ├── tutorial-10.md
│ │ │ ├── tutorial-11.md
│ │ │ ├── tutorial-12.md
│ │ │ ├── universal-properties.md
│ │ │ ├── user-defined-components.md
│ │ │ ├── vscode.md
│ │ │ ├── working-with-markdown.md
│ │ │ ├── working-with-text.md
│ │ │ ├── xmlui-animations
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── Animation.md
│ │ │ │ ├── FadeAnimation.md
│ │ │ │ ├── FadeInAnimation.md
│ │ │ │ ├── FadeOutAnimation.md
│ │ │ │ ├── ScaleAnimation.md
│ │ │ │ └── SlideInAnimation.md
│ │ │ ├── xmlui-charts
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── DonutChart.md
│ │ │ │ ├── LabelList.md
│ │ │ │ ├── Legend.md
│ │ │ │ ├── LineChart.md
│ │ │ │ └── PieChart.md
│ │ │ ├── xmlui-pdf
│ │ │ │ ├── _meta.json
│ │ │ │ ├── _overview.md
│ │ │ │ └── Pdf.md
│ │ │ └── xmlui-spreadsheet
│ │ │ ├── _meta.json
│ │ │ ├── _overview.md
│ │ │ └── Spreadsheet.md
│ │ ├── resources
│ │ │ ├── devdocs
│ │ │ │ ├── debug-proxy-object-2.png
│ │ │ │ ├── debug-proxy-object.png
│ │ │ │ ├── table_editor_01.png
│ │ │ │ ├── table_editor_02.png
│ │ │ │ ├── table_editor_03.png
│ │ │ │ ├── table_editor_04.png
│ │ │ │ ├── table_editor_05.png
│ │ │ │ ├── table_editor_06.png
│ │ │ │ ├── table_editor_07.png
│ │ │ │ ├── table_editor_08.png
│ │ │ │ ├── table_editor_09.png
│ │ │ │ ├── table_editor_10.png
│ │ │ │ ├── table_editor_11.png
│ │ │ │ ├── table-editor-01.png
│ │ │ │ ├── table-editor-02.png
│ │ │ │ ├── table-editor-03.png
│ │ │ │ ├── table-editor-04.png
│ │ │ │ ├── table-editor-06.png
│ │ │ │ ├── table-editor-07.png
│ │ │ │ ├── table-editor-08.png
│ │ │ │ ├── table-editor-09.png
│ │ │ │ └── xmlui-rendering-of-tiptap-markdown.png
│ │ │ ├── favicon.ico
│ │ │ ├── files
│ │ │ │ ├── clients.json
│ │ │ │ ├── daily-revenue.json
│ │ │ │ ├── dashboard-stats.json
│ │ │ │ ├── demo.xmlui
│ │ │ │ ├── demo.xmlui.xs
│ │ │ │ ├── downloads
│ │ │ │ │ └── downloads.json
│ │ │ │ ├── for-download
│ │ │ │ │ ├── index-with-api.html
│ │ │ │ │ ├── index.html
│ │ │ │ │ ├── mockApi.js
│ │ │ │ │ ├── start-darwin.sh
│ │ │ │ │ ├── start-linux.sh
│ │ │ │ │ ├── start.bat
│ │ │ │ │ └── xmlui
│ │ │ │ │ └── xmlui-standalone.umd.js
│ │ │ │ ├── getting-started
│ │ │ │ │ ├── cl-tutorial-final.zip
│ │ │ │ │ ├── cl-tutorial.zip
│ │ │ │ │ ├── cl-tutorial2.zip
│ │ │ │ │ ├── cl-tutorial3.zip
│ │ │ │ │ ├── cl-tutorial4.zip
│ │ │ │ │ ├── cl-tutorial5.zip
│ │ │ │ │ ├── cl-tutorial6.zip
│ │ │ │ │ ├── getting-started.zip
│ │ │ │ │ ├── hello-xmlui.zip
│ │ │ │ │ ├── xmlui-empty.zip
│ │ │ │ │ └── xmlui-starter.zip
│ │ │ │ ├── howto
│ │ │ │ │ └── component-icons
│ │ │ │ │ └── up-arrow.svg
│ │ │ │ ├── invoices.json
│ │ │ │ ├── monthly-status.json
│ │ │ │ ├── news-and-reviews.json
│ │ │ │ ├── products.json
│ │ │ │ ├── releases.json
│ │ │ │ ├── tutorials
│ │ │ │ │ ├── datasource
│ │ │ │ │ │ └── api.ts
│ │ │ │ │ └── p2do
│ │ │ │ │ ├── api.ts
│ │ │ │ │ └── todo-logo.svg
│ │ │ │ └── xmlui.json
│ │ │ ├── github.svg
│ │ │ ├── images
│ │ │ │ ├── apiaction-tutorial
│ │ │ │ │ ├── add-success.png
│ │ │ │ │ ├── apiaction-param.png
│ │ │ │ │ ├── change-completed.png
│ │ │ │ │ ├── change-in-progress.png
│ │ │ │ │ ├── confirm-delete.png
│ │ │ │ │ ├── data-error.png
│ │ │ │ │ ├── data-progress.png
│ │ │ │ │ ├── data-success.png
│ │ │ │ │ ├── display-1.png
│ │ │ │ │ ├── item-deleted.png
│ │ │ │ │ ├── item-updated.png
│ │ │ │ │ ├── missing-api-key.png
│ │ │ │ │ ├── new-item-added.png
│ │ │ │ │ └── test-message.png
│ │ │ │ ├── chat-api
│ │ │ │ │ └── domain-model.svg
│ │ │ │ ├── components
│ │ │ │ │ ├── image
│ │ │ │ │ │ └── breakfast.jpg
│ │ │ │ │ ├── markdown
│ │ │ │ │ │ └── colors.png
│ │ │ │ │ └── modal
│ │ │ │ │ ├── deep_link_dialog_1.jpg
│ │ │ │ │ └── deep_link_dialog_2.jpg
│ │ │ │ ├── create-apps
│ │ │ │ │ ├── collapsed-vertical.png
│ │ │ │ │ ├── using-forms-warning-dialog.png
│ │ │ │ │ └── using-forms.png
│ │ │ │ ├── datasource-tutorial
│ │ │ │ │ ├── data-with-header.png
│ │ │ │ │ ├── filtered-data.png
│ │ │ │ │ ├── filtered-items.png
│ │ │ │ │ ├── initial-page-items.png
│ │ │ │ │ ├── list-items.png
│ │ │ │ │ ├── next-page-items.png
│ │ │ │ │ ├── no-data.png
│ │ │ │ │ ├── pagination-1.jpg
│ │ │ │ │ ├── pagination-1.png
│ │ │ │ │ ├── polling-1.png
│ │ │ │ │ ├── refetch-data.png
│ │ │ │ │ ├── slow-loading.png
│ │ │ │ │ ├── test-message.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── unconventional-data.png
│ │ │ │ │ └── unfiltered-items.png
│ │ │ │ ├── flower.jpg
│ │ │ │ ├── get-started
│ │ │ │ │ ├── add-new-contact.png
│ │ │ │ │ ├── app-modified.png
│ │ │ │ │ ├── app-start.png
│ │ │ │ │ ├── app-with-boxes.png
│ │ │ │ │ ├── app-with-toast.png
│ │ │ │ │ ├── boilerplate-structure.png
│ │ │ │ │ ├── cl-initial.png
│ │ │ │ │ ├── cl-start.png
│ │ │ │ │ ├── contact-counts.png
│ │ │ │ │ ├── contact-dialog-title.png
│ │ │ │ │ ├── contact-dialog.png
│ │ │ │ │ ├── contact-menus.png
│ │ │ │ │ ├── contact-predicates.png
│ │ │ │ │ ├── context-menu.png
│ │ │ │ │ ├── dashboard-numbers.png
│ │ │ │ │ ├── default-contact-list.png
│ │ │ │ │ ├── delete-contact.png
│ │ │ │ │ ├── delete-task.png
│ │ │ │ │ ├── detailed-template.png
│ │ │ │ │ ├── edit-contact-details.png
│ │ │ │ │ ├── edited-contact-saved.png
│ │ │ │ │ ├── empty-sections.png
│ │ │ │ │ ├── filter-completed.png
│ │ │ │ │ ├── fullwidth-desktop.png
│ │ │ │ │ ├── fullwidth-mobile.png
│ │ │ │ │ ├── initial-table.png
│ │ │ │ │ ├── items-and-badges.png
│ │ │ │ │ ├── loading-message.png
│ │ │ │ │ ├── new-contact-button.png
│ │ │ │ │ ├── new-contact-saved.png
│ │ │ │ │ ├── no-empty-sections.png
│ │ │ │ │ ├── personal-todo-initial.png
│ │ │ │ │ ├── piechart.png
│ │ │ │ │ ├── review-today.png
│ │ │ │ │ ├── rudimentary-dashboard.png
│ │ │ │ │ ├── section-collapsed.png
│ │ │ │ │ ├── sectioned-items.png
│ │ │ │ │ ├── sections-ordered.png
│ │ │ │ │ ├── spacex-list-with-links.png
│ │ │ │ │ ├── spacex-list.png
│ │ │ │ │ ├── start-personal-todo-1.png
│ │ │ │ │ ├── submit-new-contact.png
│ │ │ │ │ ├── submit-new-task.png
│ │ │ │ │ ├── syntax-highlighting.png
│ │ │ │ │ ├── table-with-badge.png
│ │ │ │ │ ├── template-with-card.png
│ │ │ │ │ ├── test-emulated-api.png
│ │ │ │ │ ├── Thumbs.db
│ │ │ │ │ ├── todo-logo.png
│ │ │ │ │ └── xmlui-tools.png
│ │ │ │ ├── HelloApp.png
│ │ │ │ ├── HelloApp2.png
│ │ │ │ ├── logos
│ │ │ │ │ ├── xmlui1.svg
│ │ │ │ │ ├── xmlui2.svg
│ │ │ │ │ ├── xmlui3.svg
│ │ │ │ │ ├── xmlui4.svg
│ │ │ │ │ ├── xmlui5.svg
│ │ │ │ │ ├── xmlui6.svg
│ │ │ │ │ └── xmlui7.svg
│ │ │ │ ├── pdf
│ │ │ │ │ └── dummy-pdf.jpg
│ │ │ │ ├── rendering-engine
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ ├── Component.svg
│ │ │ │ │ ├── CompoundComponent.svg
│ │ │ │ │ ├── RootComponent.svg
│ │ │ │ │ └── tree-with-containers.svg
│ │ │ │ ├── reviewers-guide
│ │ │ │ │ ├── AppEngine-flow.svg
│ │ │ │ │ └── incbutton-in-action.png
│ │ │ │ ├── tools
│ │ │ │ │ └── boilerplate-structure.png
│ │ │ │ ├── try.svg
│ │ │ │ ├── tutorial
│ │ │ │ │ ├── app-chat-history.png
│ │ │ │ │ ├── app-content-placeholder.png
│ │ │ │ │ ├── app-header-and-content.png
│ │ │ │ │ ├── app-links-channel-selected.png
│ │ │ │ │ ├── app-links-click.png
│ │ │ │ │ ├── app-navigation.png
│ │ │ │ │ ├── finished-ex01.png
│ │ │ │ │ ├── finished-ex02.png
│ │ │ │ │ ├── hello.png
│ │ │ │ │ ├── splash-screen-advanced.png
│ │ │ │ │ ├── splash-screen-after-click.png
│ │ │ │ │ ├── splash-screen-centered.png
│ │ │ │ │ ├── splash-screen-events.png
│ │ │ │ │ ├── splash-screen-expression.png
│ │ │ │ │ ├── splash-screen-reuse-after.png
│ │ │ │ │ ├── splash-screen-reuse-before.png
│ │ │ │ │ └── splash-screen.png
│ │ │ │ └── tutorial-01.png
│ │ │ ├── llms.txt
│ │ │ ├── logo-dark.svg
│ │ │ ├── logo.svg
│ │ │ ├── pg-popout.svg
│ │ │ └── xmlui-logo.svg
│ │ ├── serve.json
│ │ ├── staticwebapp.config.json
│ │ └── web.config
│ ├── scripts
│ │ ├── download-latest-xmlui.js
│ │ ├── generate-rss.js
│ │ ├── get-releases.js
│ │ └── utils.js
│ ├── src
│ │ ├── components
│ │ │ ├── BlogOverview.xmlui
│ │ │ ├── BlogPage.xmlui
│ │ │ ├── Boxes.xmlui
│ │ │ ├── Breadcrumb.xmlui
│ │ │ ├── ChangeLog.xmlui
│ │ │ ├── ColorPalette.xmlui
│ │ │ ├── DocumentLinks.xmlui
│ │ │ ├── DocumentPage.xmlui
│ │ │ ├── DocumentPageNoTOC.xmlui
│ │ │ ├── Icons.xmlui
│ │ │ ├── IncButton.xmlui
│ │ │ ├── IncButton2.xmlui
│ │ │ ├── NameValue.xmlui
│ │ │ ├── PageNotFound.xmlui
│ │ │ ├── PaletteItem.xmlui
│ │ │ ├── Palettes.xmlui
│ │ │ ├── SectionHeader.xmlui
│ │ │ ├── TBD.xmlui
│ │ │ ├── Test.xmlui
│ │ │ ├── ThemesIntro.xmlui
│ │ │ ├── ThousandThemes.xmlui
│ │ │ ├── TubeStops.xmlui
│ │ │ ├── TubeStops.xmlui.xs
│ │ │ └── TwoColumnCode.xmlui
│ │ ├── config.ts
│ │ ├── Main.xmlui
│ │ └── themes
│ │ ├── docs-theme.ts
│ │ ├── earthtone.ts
│ │ ├── xmlui-gray-on-default.ts
│ │ ├── xmlui-green-on-default.ts
│ │ └── xmlui-orange-on-default.ts
│ └── tsconfig.json
├── LICENSE
├── package-lock.json
├── package.json
├── packages
│ ├── tsconfig.json
│ ├── xmlui-animations
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── Animation.tsx
│ │ ├── AnimationNative.tsx
│ │ ├── FadeAnimation.tsx
│ │ ├── FadeInAnimation.tsx
│ │ ├── FadeOutAnimation.tsx
│ │ ├── index.tsx
│ │ ├── ScaleAnimation.tsx
│ │ └── SlideInAnimation.tsx
│ ├── xmlui-devtools
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── devtools
│ │ │ │ ├── DevTools.tsx
│ │ │ │ ├── DevToolsNative.module.scss
│ │ │ │ ├── DevToolsNative.tsx
│ │ │ │ ├── ModalDialog.module.scss
│ │ │ │ ├── ModalDialog.tsx
│ │ │ │ ├── ModalVisibilityContext.tsx
│ │ │ │ ├── Tooltip.module.scss
│ │ │ │ ├── Tooltip.tsx
│ │ │ │ └── utils.ts
│ │ │ ├── editor
│ │ │ │ └── Editor.tsx
│ │ │ └── index.tsx
│ │ └── vite.config-overrides.ts
│ ├── xmlui-hello-world
│ │ ├── .gitignore
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── HelloWorld.module.scss
│ │ ├── HelloWorld.tsx
│ │ ├── HelloWorldNative.tsx
│ │ └── index.tsx
│ ├── xmlui-os-frames
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── IPhoneFrame.module.scss
│ │ ├── IPhoneFrame.tsx
│ │ ├── MacOSAppFrame.module.scss
│ │ ├── MacOSAppFrame.tsx
│ │ ├── WindowsAppFrame.module.scss
│ │ └── WindowsAppFrame.tsx
│ ├── xmlui-pdf
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ ├── components
│ │ │ │ └── Pdf.xmlui
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── LazyPdfNative.tsx
│ │ ├── Pdf.module.scss
│ │ └── Pdf.tsx
│ ├── xmlui-playground
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── hooks
│ │ │ ├── usePlayground.ts
│ │ │ └── useToast.ts
│ │ ├── index.tsx
│ │ ├── playground
│ │ │ ├── Box.module.scss
│ │ │ ├── Box.tsx
│ │ │ ├── CodeSelector.module.scss
│ │ │ ├── CodeSelector.tsx
│ │ │ ├── ConfirmationDialog.module.scss
│ │ │ ├── ConfirmationDialog.tsx
│ │ │ ├── Editor.tsx
│ │ │ ├── Header.module.scss
│ │ │ ├── Header.tsx
│ │ │ ├── Playground.tsx
│ │ │ ├── PlaygroundContent.module.scss
│ │ │ ├── PlaygroundContent.tsx
│ │ │ ├── PlaygroundNative.module.scss
│ │ │ ├── PlaygroundNative.tsx
│ │ │ ├── Preview.tsx
│ │ │ ├── StandalonePlayground.tsx
│ │ │ ├── StandalonePlaygroundNative.module.scss
│ │ │ ├── StandalonePlaygroundNative.tsx
│ │ │ ├── ThemeSwitcher.module.scss
│ │ │ ├── ThemeSwitcher.tsx
│ │ │ └── utils.ts
│ │ ├── providers
│ │ │ ├── Toast.module.scss
│ │ │ └── ToastProvider.tsx
│ │ ├── state
│ │ │ └── store.ts
│ │ ├── themes
│ │ │ └── theme.ts
│ │ └── utils
│ │ └── helpers.ts
│ ├── xmlui-search
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Search.module.scss
│ │ └── Search.tsx
│ ├── xmlui-spreadsheet
│ │ ├── .gitignore
│ │ ├── demo
│ │ │ └── Main.xmlui
│ │ ├── index.html
│ │ ├── index.ts
│ │ ├── meta
│ │ │ └── componentsMetadata.ts
│ │ ├── package.json
│ │ └── src
│ │ ├── index.tsx
│ │ ├── Spreadsheet.tsx
│ │ └── SpreadsheetNative.tsx
│ └── xmlui-website-blocks
│ ├── .gitignore
│ ├── CHANGELOG.md
│ ├── demo
│ │ ├── components
│ │ │ ├── HeroBackgroundBreakoutPage.xmlui
│ │ │ ├── HeroBackgroundsPage.xmlui
│ │ │ ├── HeroContentsPage.xmlui
│ │ │ ├── HeroTextAlignPage.xmlui
│ │ │ ├── HeroTextPage.xmlui
│ │ │ └── HeroTonesPage.xmlui
│ │ ├── Main.xmlui
│ │ └── themes
│ │ └── default.ts
│ ├── index.html
│ ├── index.ts
│ ├── meta
│ │ └── componentsMetadata.ts
│ ├── package.json
│ ├── public
│ │ └── resources
│ │ ├── building.jpg
│ │ └── xmlui-logo.svg
│ └── src
│ ├── Carousel
│ │ ├── Carousel.module.scss
│ │ ├── Carousel.tsx
│ │ ├── CarouselContext.tsx
│ │ └── CarouselNative.tsx
│ ├── FancyButton
│ │ ├── FancyButton.module.scss
│ │ ├── FancyButton.tsx
│ │ └── FancyButton.xmlui
│ ├── Hello
│ │ ├── Hello.tsx
│ │ ├── Hello.xmlui
│ │ └── Hello.xmlui.xs
│ ├── HeroSection
│ │ ├── HeroSection.module.scss
│ │ ├── HeroSection.spec.ts
│ │ ├── HeroSection.tsx
│ │ └── HeroSectionNative.tsx
│ ├── index.tsx
│ ├── ScrollToTop
│ │ ├── ScrollToTop.module.scss
│ │ ├── ScrollToTop.tsx
│ │ └── ScrollToTopNative.tsx
│ └── vite-env.d.ts
├── playwright.config.ts
├── README.md
├── tools
│ ├── codefence
│ │ └── xmlui-code-fence-docs.md
│ ├── create-app
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── create-app.ts
│ │ ├── helpers
│ │ │ ├── copy.ts
│ │ │ ├── get-pkg-manager.ts
│ │ │ ├── git.ts
│ │ │ ├── install.ts
│ │ │ ├── is-folder-empty.ts
│ │ │ ├── is-writeable.ts
│ │ │ ├── make-dir.ts
│ │ │ └── validate-pkg.ts
│ │ ├── index.ts
│ │ ├── package.json
│ │ ├── templates
│ │ │ ├── default
│ │ │ │ └── ts
│ │ │ │ ├── gitignore
│ │ │ │ ├── index.html
│ │ │ │ ├── index.ts
│ │ │ │ ├── public
│ │ │ │ │ ├── mockServiceWorker.js
│ │ │ │ │ ├── resources
│ │ │ │ │ │ ├── favicon.ico
│ │ │ │ │ │ └── xmlui-logo.svg
│ │ │ │ │ └── serve.json
│ │ │ │ └── src
│ │ │ │ ├── components
│ │ │ │ │ ├── ApiAware.xmlui
│ │ │ │ │ ├── Home.xmlui
│ │ │ │ │ ├── IncButton.xmlui
│ │ │ │ │ └── PagePanel.xmlui
│ │ │ │ ├── config.ts
│ │ │ │ └── Main.xmlui
│ │ │ ├── index.ts
│ │ │ └── types.ts
│ │ └── tsconfig.json
│ ├── create-xmlui-hello-world
│ │ ├── index.js
│ │ └── package.json
│ └── vscode
│ ├── .gitignore
│ ├── .vscode
│ │ ├── launch.json
│ │ └── tasks.json
│ ├── .vscodeignore
│ ├── build.sh
│ ├── CHANGELOG.md
│ ├── esbuild.js
│ ├── eslint.config.mjs
│ ├── formatter-docs.md
│ ├── generate-test-sample.sh
│ ├── LICENSE.md
│ ├── package-lock.json
│ ├── package.json
│ ├── README.md
│ ├── resources
│ │ ├── xmlui-logo.png
│ │ └── xmlui-markup-syntax-highlighting.png
│ ├── src
│ │ ├── extension.ts
│ │ └── server.ts
│ ├── syntaxes
│ │ └── xmlui.tmLanguage.json
│ ├── test-samples
│ │ └── sample.xmlui
│ ├── tsconfig.json
│ └── tsconfig.tsbuildinfo
├── turbo.json
└── xmlui
├── .gitignore
├── bin
│ ├── bootstrap.cjs
│ ├── bootstrap.js
│ ├── build-lib.ts
│ ├── build.ts
│ ├── index.ts
│ ├── preview.ts
│ ├── start.ts
│ ├── vite-xmlui-plugin.ts
│ └── viteConfig.ts
├── CHANGELOG.md
├── conventions
│ ├── component-qa-checklist.md
│ ├── copilot-conventions.md
│ ├── create-xmlui-components.md
│ ├── mermaid.md
│ ├── testing-conventions.md
│ └── xmlui-in-a-nutshell.md
├── dev-docs
│ ├── accessibility.md
│ ├── build-system.md
│ ├── build-xmlui.md
│ ├── component-behaviors.md
│ ├── component-metadata.md
│ ├── components-with-options.md
│ ├── containers.md
│ ├── data-operations.md
│ ├── glossary.md
│ ├── index.md
│ ├── next
│ │ ├── component-dev-guide.md
│ │ ├── configuration-management-enhancement-summary.md
│ │ ├── documentation-scripts-refactoring-complete-summary.md
│ │ ├── documentation-scripts-refactoring-plan.md
│ │ ├── duplicate-pattern-extraction-summary.md
│ │ ├── error-handling-standardization-summary.md
│ │ ├── generating-component-reference.md
│ │ ├── index.md
│ │ ├── logging-consistency-implementation-summary.md
│ │ ├── project-build.md
│ │ ├── project-structure.md
│ │ ├── theme-context.md
│ │ ├── tiptap-design-considerations.md
│ │ ├── working-with-code.md
│ │ ├── xmlui-runtime-architecture
│ │ └── xmlui-wcag-accessibility-report.md
│ ├── react-fundamentals.md
│ ├── release-method.md
│ ├── standalone-app.md
│ ├── theme-variables-refactoring.md
│ ├── ud-components.md
│ └── xmlui-repo.md
├── package.json
├── scripts
│ ├── coverage-only.js
│ ├── e2e-test-summary.js
│ ├── extract-component-metadata.js
│ ├── generate-docs
│ │ ├── build-downloads-map.mjs
│ │ ├── build-pages-map.mjs
│ │ ├── components-config.json
│ │ ├── configuration-management.mjs
│ │ ├── constants.mjs
│ │ ├── create-theme-files.mjs
│ │ ├── DocsGenerator.mjs
│ │ ├── error-handling.mjs
│ │ ├── extensions-config.json
│ │ ├── folders.mjs
│ │ ├── generate-summary-files.mjs
│ │ ├── get-docs.mjs
│ │ ├── input-handler.mjs
│ │ ├── logger.mjs
│ │ ├── logging-standards.mjs
│ │ ├── MetadataProcessor.mjs
│ │ ├── pattern-utilities.mjs
│ │ └── utils.mjs
│ ├── generate-metadata-markdown.js
│ ├── get-langserver-metadata.js
│ ├── inline-links.mjs
│ └── README-e2e-summary.md
├── src
│ ├── abstractions
│ │ ├── _conventions.md
│ │ ├── ActionDefs.ts
│ │ ├── AppContextDefs.ts
│ │ ├── ComponentDefs.ts
│ │ ├── ContainerDefs.ts
│ │ ├── ExtensionDefs.ts
│ │ ├── FunctionDefs.ts
│ │ ├── RendererDefs.ts
│ │ ├── scripting
│ │ │ ├── BlockScope.ts
│ │ │ ├── Compilation.ts
│ │ │ ├── LogicalThread.ts
│ │ │ ├── LoopScope.ts
│ │ │ ├── modules.ts
│ │ │ ├── ScriptParserError.ts
│ │ │ ├── Token.ts
│ │ │ ├── TryScope.ts
│ │ │ └── TryScopeExp.ts
│ │ └── ThemingDefs.ts
│ ├── components
│ │ ├── _conventions.md
│ │ ├── abstractions.ts
│ │ ├── Accordion
│ │ │ ├── Accordion.md
│ │ │ ├── Accordion.module.scss
│ │ │ ├── Accordion.spec.ts
│ │ │ ├── Accordion.tsx
│ │ │ ├── AccordionContext.tsx
│ │ │ ├── AccordionItem.tsx
│ │ │ ├── AccordionItemNative.tsx
│ │ │ └── AccordionNative.tsx
│ │ ├── Animation
│ │ │ └── AnimationNative.tsx
│ │ ├── APICall
│ │ │ ├── APICall.md
│ │ │ ├── APICall.spec.ts
│ │ │ ├── APICall.tsx
│ │ │ └── APICallNative.tsx
│ │ ├── App
│ │ │ ├── App.md
│ │ │ ├── App.module.scss
│ │ │ ├── App.spec.ts
│ │ │ ├── App.tsx
│ │ │ ├── AppLayoutContext.ts
│ │ │ ├── AppNative.tsx
│ │ │ ├── AppStateContext.ts
│ │ │ ├── doc-resources
│ │ │ │ ├── condensed-sticky.xmlui
│ │ │ │ ├── condensed.xmlui
│ │ │ │ ├── horizontal-sticky.xmlui
│ │ │ │ ├── horizontal.xmlui
│ │ │ │ ├── vertical-full-header.xmlui
│ │ │ │ ├── vertical-sticky.xmlui
│ │ │ │ └── vertical.xmlui
│ │ │ ├── IndexerContext.ts
│ │ │ ├── LinkInfoContext.ts
│ │ │ ├── SearchContext.tsx
│ │ │ ├── Sheet.module.scss
│ │ │ └── Sheet.tsx
│ │ ├── AppHeader
│ │ │ ├── AppHeader.md
│ │ │ ├── AppHeader.module.scss
│ │ │ ├── AppHeader.spec.ts
│ │ │ ├── AppHeader.tsx
│ │ │ └── AppHeaderNative.tsx
│ │ ├── AppState
│ │ │ ├── AppState.md
│ │ │ ├── AppState.spec.ts
│ │ │ ├── AppState.tsx
│ │ │ └── AppStateNative.tsx
│ │ ├── AutoComplete
│ │ │ ├── AutoComplete.md
│ │ │ ├── AutoComplete.module.scss
│ │ │ ├── AutoComplete.spec.ts
│ │ │ ├── AutoComplete.tsx
│ │ │ ├── AutoCompleteContext.tsx
│ │ │ └── AutoCompleteNative.tsx
│ │ ├── Avatar
│ │ │ ├── Avatar.md
│ │ │ ├── Avatar.module.scss
│ │ │ ├── Avatar.spec.ts
│ │ │ ├── Avatar.tsx
│ │ │ └── AvatarNative.tsx
│ │ ├── Backdrop
│ │ │ ├── Backdrop.md
│ │ │ ├── Backdrop.module.scss
│ │ │ ├── Backdrop.spec.ts
│ │ │ ├── Backdrop.tsx
│ │ │ └── BackdropNative.tsx
│ │ ├── Badge
│ │ │ ├── Badge.md
│ │ │ ├── Badge.module.scss
│ │ │ ├── Badge.spec.ts
│ │ │ ├── Badge.tsx
│ │ │ └── BadgeNative.tsx
│ │ ├── Bookmark
│ │ │ ├── Bookmark.md
│ │ │ ├── Bookmark.module.scss
│ │ │ ├── Bookmark.spec.ts
│ │ │ ├── Bookmark.tsx
│ │ │ └── BookmarkNative.tsx
│ │ ├── Breakout
│ │ │ ├── Breakout.module.scss
│ │ │ ├── Breakout.spec.ts
│ │ │ ├── Breakout.tsx
│ │ │ └── BreakoutNative.tsx
│ │ ├── Button
│ │ │ ├── Button-style.spec.ts
│ │ │ ├── Button.md
│ │ │ ├── Button.module.scss
│ │ │ ├── Button.spec.ts
│ │ │ ├── Button.tsx
│ │ │ └── ButtonNative.tsx
│ │ ├── Card
│ │ │ ├── Card.md
│ │ │ ├── Card.module.scss
│ │ │ ├── Card.spec.ts
│ │ │ ├── Card.tsx
│ │ │ └── CardNative.tsx
│ │ ├── Carousel
│ │ │ ├── Carousel.md
│ │ │ ├── Carousel.module.scss
│ │ │ ├── Carousel.spec.ts
│ │ │ ├── Carousel.tsx
│ │ │ ├── CarouselContext.tsx
│ │ │ ├── CarouselItem.tsx
│ │ │ ├── CarouselItemNative.tsx
│ │ │ └── CarouselNative.tsx
│ │ ├── ChangeListener
│ │ │ ├── ChangeListener.md
│ │ │ ├── ChangeListener.spec.ts
│ │ │ ├── ChangeListener.tsx
│ │ │ └── ChangeListenerNative.tsx
│ │ ├── chart-color-schemes.ts
│ │ ├── Charts
│ │ │ ├── AreaChart
│ │ │ │ ├── AreaChart.md
│ │ │ │ ├── AreaChart.spec.ts
│ │ │ │ ├── AreaChart.tsx
│ │ │ │ └── AreaChartNative.tsx
│ │ │ ├── BarChart
│ │ │ │ ├── BarChart.md
│ │ │ │ ├── BarChart.module.scss
│ │ │ │ ├── BarChart.spec.ts
│ │ │ │ ├── BarChart.tsx
│ │ │ │ └── BarChartNative.tsx
│ │ │ ├── DonutChart
│ │ │ │ ├── DonutChart.spec.ts
│ │ │ │ └── DonutChart.tsx
│ │ │ ├── LabelList
│ │ │ │ ├── LabelList.module.scss
│ │ │ │ ├── LabelList.spec.ts
│ │ │ │ ├── LabelList.tsx
│ │ │ │ └── LabelListNative.tsx
│ │ │ ├── Legend
│ │ │ │ ├── Legend.spec.ts
│ │ │ │ ├── Legend.tsx
│ │ │ │ └── LegendNative.tsx
│ │ │ ├── LineChart
│ │ │ │ ├── LineChart.md
│ │ │ │ ├── LineChart.module.scss
│ │ │ │ ├── LineChart.spec.ts
│ │ │ │ ├── LineChart.tsx
│ │ │ │ └── LineChartNative.tsx
│ │ │ ├── PieChart
│ │ │ │ ├── PieChart.md
│ │ │ │ ├── PieChart.spec.ts
│ │ │ │ ├── PieChart.tsx
│ │ │ │ ├── PieChartNative.module.scss
│ │ │ │ └── PieChartNative.tsx
│ │ │ ├── RadarChart
│ │ │ │ ├── RadarChart.md
│ │ │ │ ├── RadarChart.spec.ts
│ │ │ │ ├── RadarChart.tsx
│ │ │ │ └── RadarChartNative.tsx
│ │ │ ├── Tooltip
│ │ │ │ ├── TooltipContent.module.scss
│ │ │ │ ├── TooltipContent.spec.ts
│ │ │ │ └── TooltipContent.tsx
│ │ │ └── utils
│ │ │ ├── abstractions.ts
│ │ │ └── ChartProvider.tsx
│ │ ├── Checkbox
│ │ │ ├── Checkbox.md
│ │ │ ├── Checkbox.spec.ts
│ │ │ └── Checkbox.tsx
│ │ ├── CodeBlock
│ │ │ ├── CodeBlock.module.scss
│ │ │ ├── CodeBlock.spec.ts
│ │ │ ├── CodeBlock.tsx
│ │ │ ├── CodeBlockNative.tsx
│ │ │ └── highlight-code.ts
│ │ ├── collectedComponentMetadata.ts
│ │ ├── ColorPicker
│ │ │ ├── ColorPicker.md
│ │ │ ├── ColorPicker.module.scss
│ │ │ ├── ColorPicker.spec.ts
│ │ │ ├── ColorPicker.tsx
│ │ │ └── ColorPickerNative.tsx
│ │ ├── Column
│ │ │ ├── Column.md
│ │ │ ├── Column.tsx
│ │ │ ├── ColumnNative.tsx
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ └── TableContext.tsx
│ │ ├── component-utils.ts
│ │ ├── ComponentProvider.tsx
│ │ ├── ComponentRegistryContext.tsx
│ │ ├── container-helpers.tsx
│ │ ├── ContentSeparator
│ │ │ ├── ContentSeparator.md
│ │ │ ├── ContentSeparator.module.scss
│ │ │ ├── ContentSeparator.spec.ts
│ │ │ ├── ContentSeparator.tsx
│ │ │ ├── ContentSeparatorNative.tsx
│ │ │ └── test-padding.xmlui
│ │ ├── DataSource
│ │ │ ├── DataSource.md
│ │ │ └── DataSource.tsx
│ │ ├── DateInput
│ │ │ ├── DateInput.md
│ │ │ ├── DateInput.module.scss
│ │ │ ├── DateInput.spec.ts
│ │ │ ├── DateInput.tsx
│ │ │ └── DateInputNative.tsx
│ │ ├── DatePicker
│ │ │ ├── DatePicker.md
│ │ │ ├── DatePicker.module.scss
│ │ │ ├── DatePicker.spec.ts
│ │ │ ├── DatePicker.tsx
│ │ │ └── DatePickerNative.tsx
│ │ ├── DropdownMenu
│ │ │ ├── DropdownMenu.md
│ │ │ ├── DropdownMenu.module.scss
│ │ │ ├── DropdownMenu.spec.ts
│ │ │ ├── DropdownMenu.tsx
│ │ │ ├── DropdownMenuNative.tsx
│ │ │ ├── MenuItem.md
│ │ │ └── SubMenuItem.md
│ │ ├── EmojiSelector
│ │ │ ├── EmojiSelector.md
│ │ │ ├── EmojiSelector.spec.ts
│ │ │ ├── EmojiSelector.tsx
│ │ │ └── EmojiSelectorNative.tsx
│ │ ├── ExpandableItem
│ │ │ ├── ExpandableItem.module.scss
│ │ │ ├── ExpandableItem.spec.ts
│ │ │ ├── ExpandableItem.tsx
│ │ │ └── ExpandableItemNative.tsx
│ │ ├── FileInput
│ │ │ ├── FileInput.md
│ │ │ ├── FileInput.module.scss
│ │ │ ├── FileInput.spec.ts
│ │ │ ├── FileInput.tsx
│ │ │ └── FileInputNative.tsx
│ │ ├── FileUploadDropZone
│ │ │ ├── FileUploadDropZone.md
│ │ │ ├── FileUploadDropZone.module.scss
│ │ │ ├── FileUploadDropZone.spec.ts
│ │ │ ├── FileUploadDropZone.tsx
│ │ │ └── FileUploadDropZoneNative.tsx
│ │ ├── FlowLayout
│ │ │ ├── FlowLayout.md
│ │ │ ├── FlowLayout.module.scss
│ │ │ ├── FlowLayout.spec.ts
│ │ │ ├── FlowLayout.spec.ts-snapshots
│ │ │ │ └── Edge-cases-boxShadow-is-not-clipped-1-non-smoke-darwin.png
│ │ │ ├── FlowLayout.tsx
│ │ │ └── FlowLayoutNative.tsx
│ │ ├── Footer
│ │ │ ├── Footer.md
│ │ │ ├── Footer.module.scss
│ │ │ ├── Footer.spec.ts
│ │ │ ├── Footer.tsx
│ │ │ └── FooterNative.tsx
│ │ ├── Form
│ │ │ ├── Form.md
│ │ │ ├── Form.module.scss
│ │ │ ├── Form.spec.ts
│ │ │ ├── Form.tsx
│ │ │ ├── formActions.ts
│ │ │ ├── FormContext.ts
│ │ │ └── FormNative.tsx
│ │ ├── FormItem
│ │ │ ├── FormItem.md
│ │ │ ├── FormItem.module.scss
│ │ │ ├── FormItem.spec.ts
│ │ │ ├── FormItem.tsx
│ │ │ ├── FormItemNative.tsx
│ │ │ ├── HelperText.module.scss
│ │ │ ├── HelperText.tsx
│ │ │ ├── ItemWithLabel.tsx
│ │ │ └── Validations.ts
│ │ ├── FormSection
│ │ │ ├── FormSection.md
│ │ │ ├── FormSection.ts
│ │ │ └── FormSection.xmlui
│ │ ├── Fragment
│ │ │ ├── Fragment.spec.ts
│ │ │ └── Fragment.tsx
│ │ ├── Heading
│ │ │ ├── abstractions.ts
│ │ │ ├── H1.md
│ │ │ ├── H1.spec.ts
│ │ │ ├── H2.md
│ │ │ ├── H2.spec.ts
│ │ │ ├── H3.md
│ │ │ ├── H3.spec.ts
│ │ │ ├── H4.md
│ │ │ ├── H4.spec.ts
│ │ │ ├── H5.md
│ │ │ ├── H5.spec.ts
│ │ │ ├── H6.md
│ │ │ ├── H6.spec.ts
│ │ │ ├── Heading.md
│ │ │ ├── Heading.module.scss
│ │ │ ├── Heading.spec.ts
│ │ │ ├── Heading.tsx
│ │ │ └── HeadingNative.tsx
│ │ ├── HoverCard
│ │ │ ├── HoverCard.tsx
│ │ │ └── HovercardNative.tsx
│ │ ├── HtmlTags
│ │ │ ├── HtmlTags.module.scss
│ │ │ ├── HtmlTags.spec.ts
│ │ │ └── HtmlTags.tsx
│ │ ├── Icon
│ │ │ ├── AdmonitionDanger.tsx
│ │ │ ├── AdmonitionInfo.tsx
│ │ │ ├── AdmonitionNote.tsx
│ │ │ ├── AdmonitionTip.tsx
│ │ │ ├── AdmonitionWarning.tsx
│ │ │ ├── ApiIcon.tsx
│ │ │ ├── ArrowDropDown.module.scss
│ │ │ ├── ArrowDropDown.tsx
│ │ │ ├── ArrowDropUp.module.scss
│ │ │ ├── ArrowDropUp.tsx
│ │ │ ├── ArrowLeft.module.scss
│ │ │ ├── ArrowLeft.tsx
│ │ │ ├── ArrowRight.module.scss
│ │ │ ├── ArrowRight.tsx
│ │ │ ├── Attach.tsx
│ │ │ ├── Binding.module.scss
│ │ │ ├── Binding.tsx
│ │ │ ├── BoardIcon.tsx
│ │ │ ├── BoxIcon.tsx
│ │ │ ├── CheckIcon.tsx
│ │ │ ├── ChevronDownIcon.tsx
│ │ │ ├── ChevronLeft.tsx
│ │ │ ├── ChevronRight.tsx
│ │ │ ├── ChevronUpIcon.tsx
│ │ │ ├── CodeFileIcon.tsx
│ │ │ ├── CodeSandbox.tsx
│ │ │ ├── CompactListIcon.tsx
│ │ │ ├── ContentCopyIcon.tsx
│ │ │ ├── DarkToLightIcon.tsx
│ │ │ ├── DatabaseIcon.module.scss
│ │ │ ├── DatabaseIcon.tsx
│ │ │ ├── DocFileIcon.tsx
│ │ │ ├── DocIcon.tsx
│ │ │ ├── DotMenuHorizontalIcon.tsx
│ │ │ ├── DotMenuIcon.tsx
│ │ │ ├── EmailIcon.tsx
│ │ │ ├── EmptyFolderIcon.tsx
│ │ │ ├── ErrorIcon.tsx
│ │ │ ├── ExpressionIcon.tsx
│ │ │ ├── FillPlusCricleIcon.tsx
│ │ │ ├── FilterIcon.tsx
│ │ │ ├── FolderIcon.tsx
│ │ │ ├── GlobeIcon.tsx
│ │ │ ├── HomeIcon.tsx
│ │ │ ├── HyperLinkIcon.tsx
│ │ │ ├── Icon.md
│ │ │ ├── Icon.module.scss
│ │ │ ├── Icon.spec.ts
│ │ │ ├── Icon.tsx
│ │ │ ├── IconNative.tsx
│ │ │ ├── ImageFileIcon.tsx
│ │ │ ├── Inspect.tsx
│ │ │ ├── LightToDark.tsx
│ │ │ ├── LinkIcon.tsx
│ │ │ ├── ListIcon.tsx
│ │ │ ├── LooseListIcon.tsx
│ │ │ ├── MoonIcon.tsx
│ │ │ ├── MoreOptionsIcon.tsx
│ │ │ ├── NoSortIcon.tsx
│ │ │ ├── PDFIcon.tsx
│ │ │ ├── PenIcon.tsx
│ │ │ ├── PhoneIcon.tsx
│ │ │ ├── PhotoIcon.tsx
│ │ │ ├── PlusIcon.tsx
│ │ │ ├── SearchIcon.tsx
│ │ │ ├── ShareIcon.tsx
│ │ │ ├── SortAscendingIcon.tsx
│ │ │ ├── SortDescendingIcon.tsx
│ │ │ ├── StarsIcon.tsx
│ │ │ ├── SunIcon.tsx
│ │ │ ├── svg
│ │ │ │ ├── admonition_danger.svg
│ │ │ │ ├── admonition_info.svg
│ │ │ │ ├── admonition_note.svg
│ │ │ │ ├── admonition_tip.svg
│ │ │ │ ├── admonition_warning.svg
│ │ │ │ ├── api.svg
│ │ │ │ ├── arrow-dropdown.svg
│ │ │ │ ├── arrow-left.svg
│ │ │ │ ├── arrow-right.svg
│ │ │ │ ├── arrow-up.svg
│ │ │ │ ├── attach.svg
│ │ │ │ ├── binding.svg
│ │ │ │ ├── box.svg
│ │ │ │ ├── bulb.svg
│ │ │ │ ├── code-file.svg
│ │ │ │ ├── code-sandbox.svg
│ │ │ │ ├── dark_to_light.svg
│ │ │ │ ├── database.svg
│ │ │ │ ├── doc.svg
│ │ │ │ ├── empty-folder.svg
│ │ │ │ ├── expression.svg
│ │ │ │ ├── eye-closed.svg
│ │ │ │ ├── eye-dark.svg
│ │ │ │ ├── eye.svg
│ │ │ │ ├── file-text.svg
│ │ │ │ ├── filter.svg
│ │ │ │ ├── folder.svg
│ │ │ │ ├── img.svg
│ │ │ │ ├── inspect.svg
│ │ │ │ ├── light_to_dark.svg
│ │ │ │ ├── moon.svg
│ │ │ │ ├── pdf.svg
│ │ │ │ ├── photo.svg
│ │ │ │ ├── share.svg
│ │ │ │ ├── stars.svg
│ │ │ │ ├── sun.svg
│ │ │ │ ├── trending-down.svg
│ │ │ │ ├── trending-level.svg
│ │ │ │ ├── trending-up.svg
│ │ │ │ ├── txt.svg
│ │ │ │ ├── unknown-file.svg
│ │ │ │ ├── unlink.svg
│ │ │ │ └── xls.svg
│ │ │ ├── TableDeleteColumnIcon.tsx
│ │ │ ├── TableDeleteRowIcon.tsx
│ │ │ ├── TableInsertColumnIcon.tsx
│ │ │ ├── TableInsertRowIcon.tsx
│ │ │ ├── TrashIcon.tsx
│ │ │ ├── TrendingDownIcon.tsx
│ │ │ ├── TrendingLevelIcon.tsx
│ │ │ ├── TrendingUpIcon.tsx
│ │ │ ├── TxtIcon.tsx
│ │ │ ├── UnknownFileIcon.tsx
│ │ │ ├── UnlinkIcon.tsx
│ │ │ ├── UserIcon.tsx
│ │ │ ├── WarningIcon.tsx
│ │ │ └── XlsIcon.tsx
│ │ ├── IconProvider.tsx
│ │ ├── IconRegistryContext.tsx
│ │ ├── IFrame
│ │ │ ├── IFrame.md
│ │ │ ├── IFrame.module.scss
│ │ │ ├── IFrame.spec.ts
│ │ │ ├── IFrame.tsx
│ │ │ └── IFrameNative.tsx
│ │ ├── Image
│ │ │ ├── Image.md
│ │ │ ├── Image.module.scss
│ │ │ ├── Image.spec.ts
│ │ │ ├── Image.tsx
│ │ │ └── ImageNative.tsx
│ │ ├── Input
│ │ │ ├── index.ts
│ │ │ ├── InputAdornment.module.scss
│ │ │ ├── InputAdornment.tsx
│ │ │ ├── InputDivider.module.scss
│ │ │ ├── InputDivider.tsx
│ │ │ ├── InputLabel.module.scss
│ │ │ ├── InputLabel.tsx
│ │ │ ├── PartialInput.module.scss
│ │ │ └── PartialInput.tsx
│ │ ├── InspectButton
│ │ │ ├── InspectButton.module.scss
│ │ │ └── InspectButton.tsx
│ │ ├── Items
│ │ │ ├── Items.md
│ │ │ ├── Items.spec.ts
│ │ │ ├── Items.tsx
│ │ │ └── ItemsNative.tsx
│ │ ├── Link
│ │ │ ├── Link.md
│ │ │ ├── Link.module.scss
│ │ │ ├── Link.spec.ts
│ │ │ ├── Link.tsx
│ │ │ └── LinkNative.tsx
│ │ ├── List
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── List.md
│ │ │ ├── List.module.scss
│ │ │ ├── List.spec.ts
│ │ │ ├── List.tsx
│ │ │ └── ListNative.tsx
│ │ ├── Logo
│ │ │ ├── doc-resources
│ │ │ │ └── xmlui-logo.svg
│ │ │ ├── Logo.md
│ │ │ ├── Logo.tsx
│ │ │ └── LogoNative.tsx
│ │ ├── Markdown
│ │ │ ├── CodeText.module.scss
│ │ │ ├── CodeText.tsx
│ │ │ ├── Markdown.md
│ │ │ ├── Markdown.module.scss
│ │ │ ├── Markdown.spec.ts
│ │ │ ├── Markdown.tsx
│ │ │ ├── MarkdownNative.tsx
│ │ │ ├── parse-binding-expr.ts
│ │ │ └── utils.ts
│ │ ├── metadata-helpers.ts
│ │ ├── ModalDialog
│ │ │ ├── ConfirmationModalContextProvider.tsx
│ │ │ ├── Dialog.module.scss
│ │ │ ├── Dialog.tsx
│ │ │ ├── ModalDialog.md
│ │ │ ├── ModalDialog.module.scss
│ │ │ ├── ModalDialog.spec.ts
│ │ │ ├── ModalDialog.tsx
│ │ │ ├── ModalDialogNative.tsx
│ │ │ └── ModalVisibilityContext.tsx
│ │ ├── NavGroup
│ │ │ ├── NavGroup.md
│ │ │ ├── NavGroup.module.scss
│ │ │ ├── NavGroup.spec.ts
│ │ │ ├── NavGroup.tsx
│ │ │ ├── NavGroupContext.ts
│ │ │ └── NavGroupNative.tsx
│ │ ├── NavLink
│ │ │ ├── NavLink.md
│ │ │ ├── NavLink.module.scss
│ │ │ ├── NavLink.spec.ts
│ │ │ ├── NavLink.tsx
│ │ │ └── NavLinkNative.tsx
│ │ ├── NavPanel
│ │ │ ├── NavPanel.md
│ │ │ ├── NavPanel.module.scss
│ │ │ ├── NavPanel.spec.ts
│ │ │ ├── NavPanel.tsx
│ │ │ └── NavPanelNative.tsx
│ │ ├── NestedApp
│ │ │ ├── AppWithCodeView.module.scss
│ │ │ ├── AppWithCodeView.tsx
│ │ │ ├── AppWithCodeViewNative.tsx
│ │ │ ├── defaultProps.tsx
│ │ │ ├── logo.svg
│ │ │ ├── NestedApp.module.scss
│ │ │ ├── NestedApp.tsx
│ │ │ ├── NestedAppNative.tsx
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.tsx
│ │ │ └── utils.ts
│ │ ├── NoResult
│ │ │ ├── NoResult.md
│ │ │ ├── NoResult.module.scss
│ │ │ ├── NoResult.spec.ts
│ │ │ ├── NoResult.tsx
│ │ │ └── NoResultNative.tsx
│ │ ├── NumberBox
│ │ │ ├── numberbox-abstractions.ts
│ │ │ ├── NumberBox.md
│ │ │ ├── NumberBox.module.scss
│ │ │ ├── NumberBox.spec.ts
│ │ │ ├── NumberBox.tsx
│ │ │ └── NumberBoxNative.tsx
│ │ ├── Option
│ │ │ ├── Option.md
│ │ │ ├── Option.spec.ts
│ │ │ ├── Option.tsx
│ │ │ ├── OptionNative.tsx
│ │ │ └── OptionTypeProvider.tsx
│ │ ├── PageMetaTitle
│ │ │ ├── PageMetaTilteNative.tsx
│ │ │ ├── PageMetaTitle.md
│ │ │ ├── PageMetaTitle.spec.ts
│ │ │ └── PageMetaTitle.tsx
│ │ ├── Pages
│ │ │ ├── Page.md
│ │ │ ├── Pages.md
│ │ │ ├── Pages.module.scss
│ │ │ ├── Pages.tsx
│ │ │ └── PagesNative.tsx
│ │ ├── Pagination
│ │ │ ├── Pagination.md
│ │ │ ├── Pagination.module.scss
│ │ │ ├── Pagination.spec.ts
│ │ │ ├── Pagination.tsx
│ │ │ └── PaginationNative.tsx
│ │ ├── PositionedContainer
│ │ │ ├── PositionedContainer.module.scss
│ │ │ ├── PositionedContainer.tsx
│ │ │ └── PositionedContainerNative.tsx
│ │ ├── ProfileMenu
│ │ │ ├── ProfileMenu.module.scss
│ │ │ └── ProfileMenu.tsx
│ │ ├── ProgressBar
│ │ │ ├── ProgressBar.md
│ │ │ ├── ProgressBar.module.scss
│ │ │ ├── ProgressBar.spec.ts
│ │ │ ├── ProgressBar.tsx
│ │ │ └── ProgressBarNative.tsx
│ │ ├── Queue
│ │ │ ├── Queue.md
│ │ │ ├── Queue.spec.ts
│ │ │ ├── Queue.tsx
│ │ │ ├── queueActions.ts
│ │ │ └── QueueNative.tsx
│ │ ├── RadioGroup
│ │ │ ├── RadioGroup.md
│ │ │ ├── RadioGroup.module.scss
│ │ │ ├── RadioGroup.spec.ts
│ │ │ ├── RadioGroup.tsx
│ │ │ ├── RadioGroupNative.tsx
│ │ │ ├── RadioItem.tsx
│ │ │ └── RadioItemNative.tsx
│ │ ├── RealTimeAdapter
│ │ │ ├── RealTimeAdapter.tsx
│ │ │ └── RealTimeAdapterNative.tsx
│ │ ├── Redirect
│ │ │ ├── Redirect.md
│ │ │ ├── Redirect.spec.ts
│ │ │ └── Redirect.tsx
│ │ ├── ResponsiveBar
│ │ │ ├── README.md
│ │ │ ├── ResponsiveBar.md
│ │ │ ├── ResponsiveBar.module.scss
│ │ │ ├── ResponsiveBar.spec.ts
│ │ │ ├── ResponsiveBar.tsx
│ │ │ └── ResponsiveBarNative.tsx
│ │ ├── Select
│ │ │ ├── HiddenOption.tsx
│ │ │ ├── OptionContext.ts
│ │ │ ├── Select.md
│ │ │ ├── Select.module.scss
│ │ │ ├── Select.spec.ts
│ │ │ ├── Select.tsx
│ │ │ ├── SelectContext.tsx
│ │ │ └── SelectNative.tsx
│ │ ├── SelectionStore
│ │ │ ├── SelectionStore.md
│ │ │ ├── SelectionStore.tsx
│ │ │ └── SelectionStoreNative.tsx
│ │ ├── Slider
│ │ │ ├── Slider.md
│ │ │ ├── Slider.module.scss
│ │ │ ├── Slider.spec.ts
│ │ │ ├── Slider.tsx
│ │ │ └── SliderNative.tsx
│ │ ├── Slot
│ │ │ ├── Slot.md
│ │ │ ├── Slot.spec.ts
│ │ │ └── Slot.ts
│ │ ├── SlotItem.tsx
│ │ ├── SpaceFiller
│ │ │ ├── SpaceFiller.md
│ │ │ ├── SpaceFiller.module.scss
│ │ │ ├── SpaceFiller.spec.ts
│ │ │ ├── SpaceFiller.tsx
│ │ │ └── SpaceFillerNative.tsx
│ │ ├── Spinner
│ │ │ ├── Spinner.md
│ │ │ ├── Spinner.module.scss
│ │ │ ├── Spinner.spec.ts
│ │ │ ├── Spinner.tsx
│ │ │ └── SpinnerNative.tsx
│ │ ├── Splitter
│ │ │ ├── HSplitter.md
│ │ │ ├── HSplitter.spec.ts
│ │ │ ├── Splitter.md
│ │ │ ├── Splitter.module.scss
│ │ │ ├── Splitter.spec.ts
│ │ │ ├── Splitter.tsx
│ │ │ ├── SplitterNative.tsx
│ │ │ ├── utils.ts
│ │ │ ├── VSplitter.md
│ │ │ └── VSplitter.spec.ts
│ │ ├── Stack
│ │ │ ├── CHStack.md
│ │ │ ├── CHStack.spec.ts
│ │ │ ├── CVStack.md
│ │ │ ├── CVStack.spec.ts
│ │ │ ├── HStack.md
│ │ │ ├── HStack.spec.ts
│ │ │ ├── Stack.md
│ │ │ ├── Stack.module.scss
│ │ │ ├── Stack.spec.ts
│ │ │ ├── Stack.tsx
│ │ │ ├── StackNative.tsx
│ │ │ ├── VStack.md
│ │ │ └── VStack.spec.ts
│ │ ├── StickyBox
│ │ │ ├── StickyBox.md
│ │ │ ├── StickyBox.module.scss
│ │ │ ├── StickyBox.tsx
│ │ │ └── StickyBoxNative.tsx
│ │ ├── Switch
│ │ │ ├── Switch.md
│ │ │ ├── Switch.spec.ts
│ │ │ └── Switch.tsx
│ │ ├── Table
│ │ │ ├── doc-resources
│ │ │ │ └── list-component-data.js
│ │ │ ├── react-table-config.d.ts
│ │ │ ├── Table.md
│ │ │ ├── Table.module.scss
│ │ │ ├── Table.spec.ts
│ │ │ ├── Table.tsx
│ │ │ ├── TableNative.tsx
│ │ │ └── useRowSelection.tsx
│ │ ├── TableOfContents
│ │ │ ├── TableOfContents.module.scss
│ │ │ ├── TableOfContents.spec.ts
│ │ │ ├── TableOfContents.tsx
│ │ │ └── TableOfContentsNative.tsx
│ │ ├── Tabs
│ │ │ ├── TabContext.tsx
│ │ │ ├── TabItem.md
│ │ │ ├── TabItem.tsx
│ │ │ ├── TabItemNative.tsx
│ │ │ ├── Tabs.md
│ │ │ ├── Tabs.module.scss
│ │ │ ├── Tabs.spec.ts
│ │ │ ├── Tabs.tsx
│ │ │ └── TabsNative.tsx
│ │ ├── Text
│ │ │ ├── Text.md
│ │ │ ├── Text.module.scss
│ │ │ ├── Text.spec.ts
│ │ │ ├── Text.tsx
│ │ │ └── TextNative.tsx
│ │ ├── TextArea
│ │ │ ├── TextArea.md
│ │ │ ├── TextArea.module.scss
│ │ │ ├── TextArea.spec.ts
│ │ │ ├── TextArea.tsx
│ │ │ ├── TextAreaNative.tsx
│ │ │ ├── TextAreaResizable.tsx
│ │ │ └── useComposedRef.ts
│ │ ├── TextBox
│ │ │ ├── TextBox.md
│ │ │ ├── TextBox.module.scss
│ │ │ ├── TextBox.spec.ts
│ │ │ ├── TextBox.tsx
│ │ │ └── TextBoxNative.tsx
│ │ ├── Theme
│ │ │ ├── NotificationToast.tsx
│ │ │ ├── Theme.md
│ │ │ ├── Theme.module.scss
│ │ │ ├── Theme.spec.ts
│ │ │ ├── Theme.tsx
│ │ │ └── ThemeNative.tsx
│ │ ├── TimeInput
│ │ │ ├── TimeInput.md
│ │ │ ├── TimeInput.module.scss
│ │ │ ├── TimeInput.spec.ts
│ │ │ ├── TimeInput.tsx
│ │ │ ├── TimeInputNative.tsx
│ │ │ └── utils.ts
│ │ ├── Timer
│ │ │ ├── Timer.md
│ │ │ ├── Timer.spec.ts
│ │ │ ├── Timer.tsx
│ │ │ └── TimerNative.tsx
│ │ ├── Toggle
│ │ │ ├── Toggle.module.scss
│ │ │ └── Toggle.tsx
│ │ ├── ToneChangerButton
│ │ │ ├── ToneChangerButton.md
│ │ │ ├── ToneChangerButton.spec.ts
│ │ │ └── ToneChangerButton.tsx
│ │ ├── ToneSwitch
│ │ │ ├── ToneSwitch.md
│ │ │ ├── ToneSwitch.module.scss
│ │ │ ├── ToneSwitch.spec.ts
│ │ │ ├── ToneSwitch.tsx
│ │ │ └── ToneSwitchNative.tsx
│ │ ├── Tooltip
│ │ │ ├── Tooltip.md
│ │ │ ├── Tooltip.module.scss
│ │ │ ├── Tooltip.spec.ts
│ │ │ ├── Tooltip.tsx
│ │ │ └── TooltipNative.tsx
│ │ ├── Tree
│ │ │ ├── testData.ts
│ │ │ ├── Tree-dynamic.spec.ts
│ │ │ ├── Tree-icons.spec.ts
│ │ │ ├── Tree.md
│ │ │ ├── Tree.spec.ts
│ │ │ ├── TreeComponent.module.scss
│ │ │ ├── TreeComponent.tsx
│ │ │ └── TreeNative.tsx
│ │ ├── TreeDisplay
│ │ │ ├── TreeDisplay.md
│ │ │ ├── TreeDisplay.module.scss
│ │ │ ├── TreeDisplay.tsx
│ │ │ └── TreeDisplayNative.tsx
│ │ ├── ValidationSummary
│ │ │ ├── ValidationSummary.module.scss
│ │ │ └── ValidationSummary.tsx
│ │ └── VisuallyHidden.tsx
│ ├── components-core
│ │ ├── abstractions
│ │ │ ├── ComponentRenderer.ts
│ │ │ ├── LoaderRenderer.ts
│ │ │ ├── standalone.ts
│ │ │ └── treeAbstractions.ts
│ │ ├── action
│ │ │ ├── actions.ts
│ │ │ ├── APICall.tsx
│ │ │ ├── FileDownloadAction.tsx
│ │ │ ├── FileUploadAction.tsx
│ │ │ ├── NavigateAction.tsx
│ │ │ └── TimedAction.tsx
│ │ ├── ApiBoundComponent.tsx
│ │ ├── appContext
│ │ │ ├── date-functions.ts
│ │ │ ├── math-function.ts
│ │ │ └── misc-utils.ts
│ │ ├── AppContext.tsx
│ │ ├── behaviors
│ │ │ ├── Behavior.tsx
│ │ │ └── CoreBehaviors.tsx
│ │ ├── component-hooks.ts
│ │ ├── ComponentDecorator.tsx
│ │ ├── ComponentViewer.tsx
│ │ ├── CompoundComponent.tsx
│ │ ├── constants.ts
│ │ ├── DebugViewProvider.tsx
│ │ ├── descriptorHelper.ts
│ │ ├── devtools
│ │ │ ├── InspectorDialog.module.scss
│ │ │ ├── InspectorDialog.tsx
│ │ │ └── InspectorDialogVisibilityContext.tsx
│ │ ├── EngineError.ts
│ │ ├── event-handlers.ts
│ │ ├── InspectorButton.module.scss
│ │ ├── InspectorContext.tsx
│ │ ├── interception
│ │ │ ├── abstractions.ts
│ │ │ ├── ApiInterceptor.ts
│ │ │ ├── ApiInterceptorProvider.tsx
│ │ │ ├── apiInterceptorWorker.ts
│ │ │ ├── Backend.ts
│ │ │ ├── Errors.ts
│ │ │ ├── IndexedDb.ts
│ │ │ ├── initMock.ts
│ │ │ ├── InMemoryDb.ts
│ │ │ ├── ReadonlyCollection.ts
│ │ │ └── useApiInterceptorContext.tsx
│ │ ├── loader
│ │ │ ├── ApiLoader.tsx
│ │ │ ├── DataLoader.tsx
│ │ │ ├── ExternalDataLoader.tsx
│ │ │ ├── Loader.tsx
│ │ │ ├── MockLoaderRenderer.tsx
│ │ │ └── PageableLoader.tsx
│ │ ├── LoaderComponent.tsx
│ │ ├── markup-check.ts
│ │ ├── parts.ts
│ │ ├── renderers.ts
│ │ ├── rendering
│ │ │ ├── AppContent.tsx
│ │ │ ├── AppRoot.tsx
│ │ │ ├── AppWrapper.tsx
│ │ │ ├── buildProxy.ts
│ │ │ ├── collectFnVarDeps.ts
│ │ │ ├── ComponentAdapter.tsx
│ │ │ ├── ComponentWrapper.tsx
│ │ │ ├── Container.tsx
│ │ │ ├── containers.ts
│ │ │ ├── ContainerWrapper.tsx
│ │ │ ├── ErrorBoundary.module.scss
│ │ │ ├── ErrorBoundary.tsx
│ │ │ ├── InvalidComponent.module.scss
│ │ │ ├── InvalidComponent.tsx
│ │ │ ├── nodeUtils.ts
│ │ │ ├── reducer.ts
│ │ │ ├── renderChild.tsx
│ │ │ ├── StandaloneComponent.tsx
│ │ │ ├── StateContainer.tsx
│ │ │ ├── UnknownComponent.module.scss
│ │ │ ├── UnknownComponent.tsx
│ │ │ └── valueExtractor.ts
│ │ ├── reportEngineError.ts
│ │ ├── RestApiProxy.ts
│ │ ├── script-runner
│ │ │ ├── asyncProxy.ts
│ │ │ ├── AttributeValueParser.ts
│ │ │ ├── bannedFunctions.ts
│ │ │ ├── BindingTreeEvaluationContext.ts
│ │ │ ├── eval-tree-async.ts
│ │ │ ├── eval-tree-common.ts
│ │ │ ├── eval-tree-sync.ts
│ │ │ ├── ParameterParser.ts
│ │ │ ├── process-statement-async.ts
│ │ │ ├── process-statement-common.ts
│ │ │ ├── process-statement-sync.ts
│ │ │ ├── ScriptingSourceTree.ts
│ │ │ ├── simplify-expression.ts
│ │ │ ├── statement-queue.ts
│ │ │ └── visitors.ts
│ │ ├── StandaloneApp.tsx
│ │ ├── StandaloneExtensionManager.ts
│ │ ├── TableOfContentsContext.tsx
│ │ ├── theming
│ │ │ ├── _themes.scss
│ │ │ ├── component-layout-resolver.ts
│ │ │ ├── extendThemeUtils.ts
│ │ │ ├── hvar.ts
│ │ │ ├── layout-resolver.ts
│ │ │ ├── parse-layout-props.ts
│ │ │ ├── StyleContext.tsx
│ │ │ ├── StyleRegistry.ts
│ │ │ ├── ThemeContext.tsx
│ │ │ ├── ThemeProvider.tsx
│ │ │ ├── themes
│ │ │ │ ├── base-utils.ts
│ │ │ │ ├── palette.ts
│ │ │ │ ├── root.ts
│ │ │ │ ├── solid.ts
│ │ │ │ ├── theme-colors.ts
│ │ │ │ └── xmlui.ts
│ │ │ ├── themeVars.module.scss
│ │ │ ├── themeVars.ts
│ │ │ ├── transformThemeVars.ts
│ │ │ └── utils.ts
│ │ ├── utils
│ │ │ ├── actionUtils.ts
│ │ │ ├── audio-utils.ts
│ │ │ ├── base64-utils.ts
│ │ │ ├── compound-utils.ts
│ │ │ ├── css-utils.ts
│ │ │ ├── DataLoaderQueryKeyGenerator.ts
│ │ │ ├── date-utils.ts
│ │ │ ├── extractParam.ts
│ │ │ ├── hooks.tsx
│ │ │ ├── LruCache.ts
│ │ │ ├── mergeProps.ts
│ │ │ ├── misc.ts
│ │ │ ├── request-params.ts
│ │ │ ├── statementUtils.ts
│ │ │ └── treeUtils.ts
│ │ └── xmlui-parser.ts
│ ├── index-standalone.ts
│ ├── index.scss
│ ├── index.ts
│ ├── language-server
│ │ ├── server-common.ts
│ │ ├── server-web-worker.ts
│ │ ├── server.ts
│ │ ├── services
│ │ │ ├── common
│ │ │ │ ├── docs-generation.ts
│ │ │ │ ├── lsp-utils.ts
│ │ │ │ ├── metadata-utils.ts
│ │ │ │ └── syntax-node-utilities.ts
│ │ │ ├── completion.ts
│ │ │ ├── diagnostic.ts
│ │ │ ├── format.ts
│ │ │ └── hover.ts
│ │ └── xmlui-metadata-generated.js
│ ├── logging
│ │ ├── LoggerContext.tsx
│ │ ├── LoggerInitializer.tsx
│ │ ├── LoggerService.ts
│ │ └── xmlui.ts
│ ├── logo.svg
│ ├── parsers
│ │ ├── common
│ │ │ ├── GenericToken.ts
│ │ │ ├── InputStream.ts
│ │ │ └── utils.ts
│ │ ├── scripting
│ │ │ ├── code-behind-collect.ts
│ │ │ ├── Lexer.ts
│ │ │ ├── modules.ts
│ │ │ ├── Parser.ts
│ │ │ ├── ParserError.ts
│ │ │ ├── ScriptingNodeTypes.ts
│ │ │ ├── TokenTrait.ts
│ │ │ ├── TokenType.ts
│ │ │ └── tree-visitor.ts
│ │ ├── style-parser
│ │ │ ├── errors.ts
│ │ │ ├── source-tree.ts
│ │ │ ├── StyleInputStream.ts
│ │ │ ├── StyleLexer.ts
│ │ │ ├── StyleParser.ts
│ │ │ └── tokens.ts
│ │ └── xmlui-parser
│ │ ├── CharacterCodes.ts
│ │ ├── diagnostics.ts
│ │ ├── fileExtensions.ts
│ │ ├── index.ts
│ │ ├── lint.ts
│ │ ├── parser.ts
│ │ ├── ParserError.ts
│ │ ├── scanner.ts
│ │ ├── syntax-kind.ts
│ │ ├── syntax-node.ts
│ │ ├── transform.ts
│ │ ├── utils.ts
│ │ ├── xmlui-serializer.ts
│ │ └── xmlui-tree.ts
│ ├── react-app-env.d.ts
│ ├── syntax
│ │ ├── monaco
│ │ │ ├── grammar.monacoLanguage.ts
│ │ │ ├── index.ts
│ │ │ ├── xmlui-dark.ts
│ │ │ ├── xmlui-light.ts
│ │ │ └── xmluiscript.monacoLanguage.ts
│ │ └── textMate
│ │ ├── index.ts
│ │ ├── xmlui-dark.json
│ │ ├── xmlui-light.json
│ │ ├── xmlui.json
│ │ └── xmlui.tmLanguage.json
│ ├── testing
│ │ ├── assertions.ts
│ │ ├── component-test-helpers.ts
│ │ ├── ComponentDrivers.ts
│ │ ├── drivers
│ │ │ ├── DateInputDriver.ts
│ │ │ ├── index.ts
│ │ │ ├── ModalDialogDriver.ts
│ │ │ ├── NumberBoxDriver.ts
│ │ │ ├── TextBoxDriver.ts
│ │ │ ├── TimeInputDriver.ts
│ │ │ ├── TimerDriver.ts
│ │ │ └── TreeDriver.ts
│ │ ├── fixtures.ts
│ │ ├── index.ts
│ │ ├── infrastructure
│ │ │ ├── index.html
│ │ │ ├── main.tsx
│ │ │ ├── public
│ │ │ │ ├── mockServiceWorker.js
│ │ │ │ ├── resources
│ │ │ │ │ ├── bell.svg
│ │ │ │ │ ├── box.svg
│ │ │ │ │ ├── doc.svg
│ │ │ │ │ ├── eye.svg
│ │ │ │ │ ├── flower-640x480.jpg
│ │ │ │ │ ├── sun.svg
│ │ │ │ │ ├── test-image-100x100.jpg
│ │ │ │ │ └── txt.svg
│ │ │ │ └── serve.json
│ │ │ └── TestBed.tsx
│ │ └── themed-app-test-helpers.ts
│ └── vite-env.d.ts
├── tests
│ ├── components
│ │ ├── CodeBlock
│ │ │ └── hightlight-code.test.ts
│ │ ├── playground-pattern.test.ts
│ │ └── Tree
│ │ └── Tree-states.test.ts
│ ├── components-core
│ │ ├── abstractions
│ │ │ └── treeAbstractions.test.ts
│ │ ├── container
│ │ │ └── buildProxy.test.ts
│ │ ├── interception
│ │ │ ├── orderBy.test.ts
│ │ │ ├── ReadOnlyCollection.test.ts
│ │ │ └── request-param-converter.test.ts
│ │ ├── scripts-runner
│ │ │ ├── AttributeValueParser.test.ts
│ │ │ ├── eval-tree-arrow-async.test.ts
│ │ │ ├── eval-tree-arrow.test.ts
│ │ │ ├── eval-tree-func-decl-async.test.ts
│ │ │ ├── eval-tree-func-decl.test.ts
│ │ │ ├── eval-tree-pre-post.test.ts
│ │ │ ├── eval-tree-regression.test.ts
│ │ │ ├── eval-tree.test.ts
│ │ │ ├── function-proxy.test.ts
│ │ │ ├── parser-regression.test.ts
│ │ │ ├── process-event.test.ts
│ │ │ ├── process-function.test.ts
│ │ │ ├── process-implicit-context.test.ts
│ │ │ ├── process-statement-asgn.test.ts
│ │ │ ├── process-statement-destruct.test.ts
│ │ │ ├── process-statement-regs.test.ts
│ │ │ ├── process-statement-sync.test.ts
│ │ │ ├── process-statement.test.ts
│ │ │ ├── process-switch-sync.test.ts
│ │ │ ├── process-switch.test.ts
│ │ │ ├── process-try-sync.test.ts
│ │ │ ├── process-try.test.ts
│ │ │ └── test-helpers.ts
│ │ ├── test-metadata-handler.ts
│ │ ├── theming
│ │ │ ├── border-segments.test.ts
│ │ │ ├── component-layout.resolver.test.ts
│ │ │ ├── layout-property-parser.test.ts
│ │ │ ├── layout-resolver.test.ts
│ │ │ ├── layout-resolver2.test.ts
│ │ │ ├── layout-vp-override.test.ts
│ │ │ └── padding-segments.test.ts
│ │ └── utils
│ │ ├── date-utils.test.ts
│ │ ├── format-human-elapsed-time.test.ts
│ │ └── LruCache.test.ts
│ ├── language-server
│ │ ├── completion.test.ts
│ │ ├── format.test.ts
│ │ ├── hover.test.ts
│ │ └── mockData.ts
│ └── parsers
│ ├── common
│ │ └── input-stream.test.ts
│ ├── markdown
│ │ └── parse-binding-expression.test.ts
│ ├── parameter-parser.test.ts
│ ├── paremeter-parser.test.ts
│ ├── scripting
│ │ ├── eval-tree-arrow.test.ts
│ │ ├── eval-tree-pre-post.test.ts
│ │ ├── eval-tree.test.ts
│ │ ├── function-proxy.test.ts
│ │ ├── lexer-literals.test.ts
│ │ ├── lexer-misc.test.ts
│ │ ├── module-parse.test.ts
│ │ ├── parser-arrow.test.ts
│ │ ├── parser-assignments.test.ts
│ │ ├── parser-binary.test.ts
│ │ ├── parser-destructuring.test.ts
│ │ ├── parser-errors.test.ts
│ │ ├── parser-expressions.test.ts
│ │ ├── parser-function.test.ts
│ │ ├── parser-literals.test.ts
│ │ ├── parser-primary.test.ts
│ │ ├── parser-regex.test.ts
│ │ ├── parser-statements.test.ts
│ │ ├── parser-unary.test.ts
│ │ ├── process-event.test.ts
│ │ ├── process-implicit-context.test.ts
│ │ ├── process-statement-asgn.test.ts
│ │ ├── process-statement-destruct.test.ts
│ │ ├── process-statement-regs.test.ts
│ │ ├── process-statement-sync.test.ts
│ │ ├── process-statement.test.ts
│ │ ├── process-switch-sync.test.ts
│ │ ├── process-switch.test.ts
│ │ ├── process-try-sync.test.ts
│ │ ├── process-try.test.ts
│ │ ├── simplify-expression.test.ts
│ │ ├── statement-hooks.test.ts
│ │ └── test-helpers.ts
│ ├── style-parser
│ │ ├── generateHvarChain.test.ts
│ │ ├── parseHVar.test.ts
│ │ ├── parser.test.ts
│ │ └── tokens.test.ts
│ └── xmlui
│ ├── lint.test.ts
│ ├── parser.test.ts
│ ├── scanner.test.ts
│ ├── transform.attr.test.ts
│ ├── transform.circular.test.ts
│ ├── transform.element.test.ts
│ ├── transform.errors.test.ts
│ ├── transform.escape.test.ts
│ ├── transform.regression.test.ts
│ ├── transform.script.test.ts
│ ├── transform.test.ts
│ └── xmlui.ts
├── tests-e2e
│ ├── api-bound-component-regression.spec.ts
│ ├── api-call-as-extracted-component.spec.ts
│ ├── assign-to-object-or-array-regression.spec.ts
│ ├── binding-regression.spec.ts
│ ├── children-as-template-context-vars.spec.ts
│ ├── compound-component.spec.ts
│ ├── context-vars-regression.spec.ts
│ ├── data-bindings.spec.ts
│ ├── datasource-and-api-usage-in-var.spec.ts
│ ├── datasource-direct-binding.spec.ts
│ ├── datasource-onLoaded-regression.spec.ts
│ ├── modify-array-item-regression.spec.ts
│ ├── namespaces.spec.ts
│ ├── push-to-array-regression.spec.ts
│ ├── screen-breakpoints.spec.ts
│ ├── scripting.spec.ts
│ ├── state-scope-in-pages.spec.ts
│ └── state-var-scopes.spec.ts
├── tsconfig.json
├── tsdown.config.ts
├── vite.config.ts
└── vitest.config.ts
```
# Files
--------------------------------------------------------------------------------
/xmlui/tests/parsers/scripting/parser-statements.test.ts:
--------------------------------------------------------------------------------
```typescript
1 | import { assert, describe, expect, it } from "vitest";
2 |
3 | import { Parser } from "../../../src/parsers/scripting/Parser";
4 | import type {
5 | BlockStatement,
6 | ConstStatement,
7 | DoWhileStatement,
8 | ExpressionStatement,
9 | ForInStatement,
10 | ForOfStatement,
11 | ForStatement,
12 | IfStatement,
13 | LetStatement,
14 | ReturnStatement,
15 | SwitchStatement,
16 | ThrowStatement,
17 | TryStatement,
18 | VarStatement,
19 | WhileStatement} from "../../../src/components-core/script-runner/ScriptingSourceTree";
20 | import {
21 | T_ARRAY_LITERAL,
22 | T_BINARY_EXPRESSION,
23 | T_BLOCK_STATEMENT,
24 | T_BREAK_STATEMENT,
25 | T_CONST_STATEMENT,
26 | T_CONTINUE_STATEMENT,
27 | T_DO_WHILE_STATEMENT,
28 | T_EMPTY_STATEMENT,
29 | T_EXPRESSION_STATEMENT,
30 | T_FOR_IN_STATEMENT,
31 | T_FOR_OF_STATEMENT,
32 | T_FOR_STATEMENT,
33 | T_IDENTIFIER,
34 | T_IF_STATEMENT,
35 | T_LET_STATEMENT,
36 | T_LITERAL,
37 | T_POSTFIX_OP_EXPRESSION,
38 | T_RETURN_STATEMENT,
39 | T_SPREAD_EXPRESSION,
40 | T_SWITCH_STATEMENT,
41 | T_THROW_STATEMENT,
42 | T_TRY_STATEMENT,
43 | T_UNARY_EXPRESSION,
44 | T_VAR_STATEMENT,
45 | T_WHILE_STATEMENT
46 | } from "../../../src/components-core/script-runner/ScriptingSourceTree";
47 |
48 | describe("Parser - statements", () => {
49 | it("Empty source", () => {
50 | // --- Arrange
51 | const wParser = new Parser("");
52 |
53 | // --- Act
54 | const stmts = wParser.parseStatements();
55 |
56 | // --- Assert
57 | expect(stmts?.length).equal(0);
58 | });
59 |
60 | it("Empty statement", () => {
61 | // --- Arrange
62 | const wParser = new Parser(";");
63 |
64 | // --- Act
65 | const stmts = wParser.parseStatements()!;
66 |
67 | // --- Assert
68 | expect(stmts.length).equal(1);
69 | expect(stmts[0].type).equal(T_EMPTY_STATEMENT);
70 | });
71 |
72 | it("Multiple empty statement", () => {
73 | // --- Arrange
74 | const wParser = new Parser(";;");
75 |
76 | // --- Act
77 | const stmts = wParser.parseStatements()!;
78 |
79 | // --- Assert
80 | expect(stmts.length).equal(2);
81 | expect(stmts[0].type).equal(T_EMPTY_STATEMENT);
82 | expect(stmts[1].type).equal(T_EMPTY_STATEMENT);
83 | });
84 |
85 | const exprStmts = [
86 | { expr: "(a + b)", top: T_BINARY_EXPRESSION },
87 | { expr: "myId", top: T_IDENTIFIER },
88 | { expr: "+myId", top: T_UNARY_EXPRESSION },
89 | { expr: "-myId", top: T_UNARY_EXPRESSION },
90 | { expr: "~myId", top: T_UNARY_EXPRESSION },
91 | { expr: "[1, 2, 3]", top: T_ARRAY_LITERAL },
92 | { expr: "!myId", top: T_UNARY_EXPRESSION },
93 | { expr: "...[1, 2, 3]", top: T_SPREAD_EXPRESSION },
94 | { expr: "123", top: T_LITERAL },
95 | { expr: "0x123", top: T_LITERAL },
96 | { expr: "0b00_11", top: T_LITERAL },
97 | { expr: "true", top: T_LITERAL },
98 | { expr: "false", top: T_LITERAL },
99 | { expr: "Infinity", top: T_LITERAL },
100 | { expr: "typeof a", top: T_UNARY_EXPRESSION },
101 | { expr: "$item", top: T_IDENTIFIER },
102 | { expr: "null", top: T_LITERAL },
103 | { expr: "undefined", top: T_LITERAL },
104 | ];
105 | exprStmts.forEach((st, idx) => {
106 | it(`Statement #${idx + 1}: ${st.expr}`, () => {
107 | // --- Arrange
108 | const wParser = new Parser(st.expr);
109 |
110 | // --- Act
111 | const stmts = wParser.parseStatements();
112 |
113 | // --- Assert
114 | expect(stmts?.length).equal(1);
115 | expect(stmts?.[0].type).equal(T_EXPRESSION_STATEMENT);
116 | const exprStmt = stmts?.[0] as ExpressionStatement;
117 | expect(exprStmt.expr.type).equal(st.top);
118 | });
119 | });
120 |
121 | it("Let statement - no init", () => {
122 | // --- Arrange
123 | const wParser = new Parser("let x");
124 |
125 | // --- Act
126 | const stmts = wParser.parseStatements()!;
127 |
128 | // --- Assert
129 | expect(stmts.length).equal(1);
130 | expect(stmts[0].type).equal(T_LET_STATEMENT);
131 | const letStmt = stmts[0] as LetStatement;
132 | expect(letStmt.decls.length).equal(1);
133 | expect(letStmt.decls[0].id).equal("x");
134 | expect(letStmt.decls[0].expr).equal(undefined);
135 | });
136 |
137 | it("Let statement - with init", () => {
138 | // --- Arrange
139 | const wParser = new Parser("let x = 3");
140 |
141 | // --- Act
142 | const stmts = wParser.parseStatements()!;
143 |
144 | // --- Assert
145 | expect(stmts.length).equal(1);
146 | expect(stmts[0].type).equal(T_LET_STATEMENT);
147 | const letStmt = stmts[0] as LetStatement;
148 | expect(letStmt.decls.length).equal(1);
149 | expect(letStmt.decls[0].id).equal("x");
150 | expect(letStmt.decls[0].expr).not.equal(null);
151 | expect(letStmt.decls[0].expr!.type).equal(T_LITERAL);
152 | });
153 |
154 | it("Let statement - with '$'", () => {
155 | // --- Arrange
156 | const wParser = new Parser("let $x = 3");
157 |
158 | // --- Act
159 | try {
160 | wParser.parseStatements()!;
161 | } catch (err) {
162 | expect(wParser.errors[0].code).equal("W031");
163 | return;
164 | }
165 | assert.fail("Exception expected");
166 | });
167 |
168 | it("Const statement #1", () => {
169 | // --- Arrange
170 | const wParser = new Parser("const x = 3");
171 |
172 | // --- Act
173 | const stmts = wParser.parseStatements()!;
174 |
175 | // --- Assert
176 | expect(stmts.length).equal(1);
177 | expect(stmts[0].type).equal(T_CONST_STATEMENT);
178 | const constStmt = stmts[0] as ConstStatement;
179 | expect(constStmt.decls.length).equal(1);
180 | expect(constStmt.decls[0].id).equal("x");
181 | expect(constStmt.decls[0].expr).not.equal(null);
182 | expect(constStmt.decls[0].expr!.type).equal(T_LITERAL);
183 | });
184 |
185 | it("Const statement with '$'", () => {
186 | // --- Arrange
187 | const wParser = new Parser("const $x = 3");
188 |
189 | // --- Act
190 | try {
191 | wParser.parseStatements()!;
192 | } catch (err) {
193 | expect(wParser.errors[0].code).equal("W031");
194 | return;
195 | }
196 | assert.fail("Exception expected");
197 | });
198 |
199 | it("Const statement #2", () => {
200 | // --- Arrange
201 | const wParser = new Parser("const x = 3, y = 4");
202 |
203 | // --- Act
204 | const stmts = wParser.parseStatements()!;
205 |
206 | // --- Assert
207 | expect(stmts.length).equal(1);
208 | expect(stmts[0].type).equal(T_CONST_STATEMENT);
209 | const constStmt = stmts[0] as ConstStatement;
210 | expect(constStmt.decls.length).equal(2);
211 | expect(constStmt.decls[0].id).equal("x");
212 | expect(constStmt.decls[0].expr).not.equal(null);
213 | expect(constStmt.decls[0].expr!.type).equal(T_LITERAL);
214 | expect(constStmt.decls[1].id).equal("y");
215 | expect(constStmt.decls[1].expr).not.equal(null);
216 | expect(constStmt.decls[1].expr!.type).equal(T_LITERAL);
217 | });
218 |
219 | it("Var statement with '$'", () => {
220 | // --- Arrange
221 | const wParser = new Parser("var $x = 3");
222 |
223 | // --- Act
224 | try {
225 | wParser.parseStatements()!;
226 | } catch (err) {
227 | expect(wParser.errors[0].code).equal("W031");
228 | return;
229 | }
230 | assert.fail("Exception expected");
231 | });
232 |
233 | it("Var statement #1", () => {
234 | // --- Arrange
235 | const wParser = new Parser("var x = 3");
236 |
237 | // --- Act
238 | const stmts = wParser.parseStatements()!;
239 |
240 | // --- Assert
241 | expect(stmts.length).equal(1);
242 | expect(stmts[0].type).equal(T_VAR_STATEMENT);
243 | const constStmt = stmts[0] as VarStatement;
244 | expect(constStmt.decls.length).equal(1);
245 | expect(constStmt.decls[0].id.name).equal("x");
246 | expect(constStmt.decls[0].expr).not.equal(null);
247 | expect(constStmt.decls[0].expr!.type).equal(T_LITERAL);
248 | });
249 |
250 | it("Var statement #2", () => {
251 | // --- Arrange
252 | const wParser = new Parser("var x = 3, y = 4");
253 |
254 | // --- Act
255 | const stmts = wParser.parseStatements()!;
256 |
257 | // --- Assert
258 | expect(stmts.length).equal(1);
259 | expect(stmts[0].type).equal(T_VAR_STATEMENT);
260 | const constStmt = stmts[0] as VarStatement;
261 | expect(constStmt.decls.length).equal(2);
262 | expect(constStmt.decls[0].id.name).equal("x");
263 | expect(constStmt.decls[0].expr).not.equal(null);
264 | expect(constStmt.decls[0].expr!.type).equal(T_LITERAL);
265 | expect(constStmt.decls[1].id.name).equal("y");
266 | expect(constStmt.decls[1].expr).not.equal(null);
267 | expect(constStmt.decls[1].expr!.type).equal(T_LITERAL);
268 | });
269 |
270 | it("Block statement - empty", () => {
271 | // --- Arrange
272 | const wParser = new Parser("{}");
273 |
274 | // --- Act
275 | const stmts = wParser.parseStatements()!;
276 |
277 | // --- Assert
278 | expect(stmts.length).equal(1);
279 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
280 | const blockStmt = stmts[0] as BlockStatement;
281 | expect(blockStmt.stmts.length).equal(0);
282 | });
283 |
284 | it("Block statement - single #1", () => {
285 | // --- Arrange
286 | const wParser = new Parser("{;}");
287 |
288 | // --- Act
289 | const stmts = wParser.parseStatements()!;
290 |
291 | // --- Assert
292 | expect(stmts.length).equal(1);
293 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
294 | const blockStmt = stmts[0] as BlockStatement;
295 | expect(blockStmt.stmts.length).equal(1);
296 | expect(blockStmt.stmts[0].type).equal(T_EMPTY_STATEMENT);
297 | });
298 |
299 | it("Block statement - single #1", () => {
300 | // --- Arrange
301 | const wParser = new Parser("{ x; }");
302 |
303 | // --- Act
304 | const stmts = wParser.parseStatements()!;
305 |
306 | // --- Assert
307 | expect(stmts.length).equal(1);
308 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
309 | const blockStmt = stmts[0] as BlockStatement;
310 | expect(blockStmt.stmts.length).equal(1);
311 | expect(blockStmt.stmts[0].type).equal(T_EXPRESSION_STATEMENT);
312 | });
313 |
314 | it("Block statement - single #2", () => {
315 | // --- Arrange
316 | const wParser = new Parser("{ let x }");
317 |
318 | // --- Act
319 | const stmts = wParser.parseStatements()!;
320 |
321 | // --- Assert
322 | expect(stmts.length).equal(1);
323 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
324 | const blockStmt = stmts[0] as BlockStatement;
325 | expect(blockStmt.stmts.length).equal(1);
326 | expect(blockStmt.stmts[0].type).equal(T_LET_STATEMENT);
327 | });
328 |
329 | it("Block statement - multiple #1", () => {
330 | // --- Arrange
331 | const wParser = new Parser("{ x; let y; }");
332 |
333 | // --- Act
334 | const stmts = wParser.parseStatements()!;
335 |
336 | // --- Assert
337 | expect(stmts.length).equal(1);
338 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
339 | const blockStmt = stmts[0] as BlockStatement;
340 | expect(blockStmt.stmts.length).equal(2);
341 | expect(blockStmt.stmts[0].type).equal(T_EXPRESSION_STATEMENT);
342 | expect(blockStmt.stmts[1].type).equal(T_LET_STATEMENT);
343 | });
344 |
345 | it("Block statement - multiple #2", () => {
346 | // --- Arrange
347 | const wParser = new Parser("{ x; { let y; z} }");
348 |
349 | // --- Act
350 | const stmts = wParser.parseStatements()!;
351 |
352 | // --- Assert
353 | expect(stmts.length).equal(1);
354 | expect(stmts[0].type).equal(T_BLOCK_STATEMENT);
355 | const blockStmt = stmts[0] as BlockStatement;
356 | expect(blockStmt.stmts.length).equal(2);
357 | expect(blockStmt.stmts[0].type).equal(T_EXPRESSION_STATEMENT);
358 | expect(blockStmt.stmts[1].type).equal(T_BLOCK_STATEMENT);
359 | const nested = blockStmt.stmts[1] as BlockStatement;
360 | expect(nested.stmts.length).equal(2);
361 | expect(nested.stmts[0].type).equal(T_LET_STATEMENT);
362 | expect(nested.stmts[1].type).equal(T_EXPRESSION_STATEMENT);
363 | });
364 |
365 | it("If statement - single then no else", () => {
366 | // --- Arrange
367 | const wParser = new Parser("if (true) x;");
368 |
369 | // --- Act
370 | const stmts = wParser.parseStatements()!;
371 |
372 | // --- Assert
373 | expect(stmts.length).equal(1);
374 | expect(stmts[0].type).equal(T_IF_STATEMENT);
375 | const blockStmt = stmts[0] as IfStatement;
376 | expect(blockStmt.cond.type).equal(T_LITERAL);
377 | expect(blockStmt.thenB.type).equal(T_EXPRESSION_STATEMENT);
378 | expect(blockStmt.elseB).equal(null);
379 | });
380 |
381 | it("If statement - block then no else", () => {
382 | // --- Arrange
383 | const wParser = new Parser("if (true) {x; let y }");
384 |
385 | // --- Act
386 | const stmts = wParser.parseStatements()!;
387 |
388 | // --- Assert
389 | expect(stmts.length).equal(1);
390 | expect(stmts[0].type).equal(T_IF_STATEMENT);
391 | const blockStmt = stmts[0] as IfStatement;
392 | expect(blockStmt.cond.type).equal(T_LITERAL);
393 | expect(blockStmt.thenB.type).equal(T_BLOCK_STATEMENT);
394 | expect(blockStmt.elseB).equal(null);
395 | });
396 |
397 | it("If statement - block then single else", () => {
398 | // --- Arrange
399 | const wParser = new Parser("if (true) {x; let y } else z");
400 |
401 | // --- Act
402 | const stmts = wParser.parseStatements()!;
403 |
404 | // --- Assert
405 | expect(stmts.length).equal(1);
406 | expect(stmts[0].type).equal(T_IF_STATEMENT);
407 | const blockStmt = stmts[0] as IfStatement;
408 | expect(blockStmt.cond.type).equal(T_LITERAL);
409 | expect(blockStmt.thenB.type).equal(T_BLOCK_STATEMENT);
410 | expect(blockStmt.elseB!.type).equal(T_EXPRESSION_STATEMENT);
411 | });
412 |
413 | it("If statement - block then block else", () => {
414 | // --- Arrange
415 | const wParser = new Parser("if (true) {x; let y } else { let z; y = 12; }");
416 |
417 | // --- Act
418 | const stmts = wParser.parseStatements()!;
419 |
420 | // --- Assert
421 | expect(stmts.length).equal(1);
422 | expect(stmts[0].type).equal(T_IF_STATEMENT);
423 | const blockStmt = stmts[0] as IfStatement;
424 | expect(blockStmt.cond.type).equal(T_LITERAL);
425 | expect(blockStmt.thenB.type).equal(T_BLOCK_STATEMENT);
426 | expect(blockStmt.elseB!.type).equal(T_BLOCK_STATEMENT);
427 | });
428 |
429 | it("If statement - single then block else", () => {
430 | // --- Arrange
431 | const wParser = new Parser("if (true) y=13; else { let z; y = 12; }");
432 |
433 | // --- Act
434 | const stmts = wParser.parseStatements()!;
435 |
436 | // --- Assert
437 | expect(stmts.length).equal(1);
438 | expect(stmts[0].type).equal(T_IF_STATEMENT);
439 | const blockStmt = stmts[0] as IfStatement;
440 | expect(blockStmt.cond.type).equal(T_LITERAL);
441 | expect(blockStmt.thenB.type).equal(T_EXPRESSION_STATEMENT);
442 | expect(blockStmt.elseB!.type).equal(T_BLOCK_STATEMENT);
443 | });
444 |
445 | it("If statement - single then single else", () => {
446 | // --- Arrange
447 | const wParser = new Parser("if (true) y=13; else y = 12;");
448 |
449 | // --- Act
450 | const stmts = wParser.parseStatements()!;
451 |
452 | // --- Assert
453 | expect(stmts.length).equal(1);
454 | expect(stmts[0].type).equal(T_IF_STATEMENT);
455 | const blockStmt = stmts[0] as IfStatement;
456 | expect(blockStmt.cond.type).equal(T_LITERAL);
457 | expect(blockStmt.thenB.type).equal(T_EXPRESSION_STATEMENT);
458 | expect(blockStmt.elseB!.type).equal(T_EXPRESSION_STATEMENT);
459 | });
460 |
461 | it("Return statement - no expression", () => {
462 | // --- Arrange
463 | const wParser = new Parser("return");
464 |
465 | // --- Act
466 | const stmts = wParser.parseStatements()!;
467 |
468 | // --- Assert
469 | expect(stmts.length).equal(1);
470 | expect(stmts[0].type).equal(T_RETURN_STATEMENT);
471 | const returnStmt = stmts[0] as ReturnStatement;
472 | expect(returnStmt.expr).equal(undefined);
473 | });
474 |
475 | it("Return statement - with expression", () => {
476 | // --- Arrange
477 | const wParser = new Parser("return 123;");
478 |
479 | // --- Act
480 | const stmts = wParser.parseStatements()!;
481 |
482 | // --- Assert
483 | expect(stmts.length).equal(1);
484 | expect(stmts[0].type).equal(T_RETURN_STATEMENT);
485 | const returnStmt = stmts[0] as ReturnStatement;
486 | expect(returnStmt.expr!.type).equal(T_LITERAL);
487 | });
488 |
489 | it("Break statement", () => {
490 | // --- Arrange
491 | const wParser = new Parser("break;");
492 |
493 | // --- Act
494 | const stmts = wParser.parseStatements()!;
495 |
496 | // --- Assert
497 | expect(stmts.length).equal(1);
498 | expect(stmts[0].type).equal(T_BREAK_STATEMENT);
499 | });
500 |
501 | it("Continue statement", () => {
502 | // --- Arrange
503 | const wParser = new Parser("continue;");
504 |
505 | // --- Act
506 | const stmts = wParser.parseStatements()!;
507 |
508 | // --- Assert
509 | expect(stmts.length).equal(1);
510 | expect(stmts[0].type).equal(T_CONTINUE_STATEMENT);
511 | });
512 |
513 | it("while statement - empty body", () => {
514 | // --- Arrange
515 | const wParser = new Parser("while (a > b);");
516 |
517 | // --- Act
518 | const stmts = wParser.parseStatements()!;
519 |
520 | // --- Assert
521 | expect(stmts.length).equal(1);
522 | expect(stmts[0].type).equal(T_WHILE_STATEMENT);
523 | const whileStmt = stmts[0] as WhileStatement;
524 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
525 | expect(whileStmt.body.type).equal(T_EMPTY_STATEMENT);
526 | });
527 |
528 | it("while statement - single statement body", () => {
529 | // --- Arrange
530 | const wParser = new Parser("while (a > b) break;");
531 |
532 | // --- Act
533 | const stmts = wParser.parseStatements()!;
534 |
535 | // --- Assert
536 | expect(stmts.length).equal(1);
537 | expect(stmts[0].type).equal(T_WHILE_STATEMENT);
538 | const whileStmt = stmts[0] as WhileStatement;
539 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
540 | expect(whileStmt.body.type).equal(T_BREAK_STATEMENT);
541 | });
542 |
543 | it("while statement - block body", () => {
544 | // --- Arrange
545 | const wParser = new Parser("while (a > b) { let x = 1; break; }");
546 |
547 | // --- Act
548 | const stmts = wParser.parseStatements()!;
549 |
550 | // --- Assert
551 |
552 | expect(stmts.length).equal(1);
553 | expect(stmts[0].type).equal(T_WHILE_STATEMENT);
554 | const whileStmt = stmts[0] as WhileStatement;
555 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
556 | expect(whileStmt.body.type).equal(T_BLOCK_STATEMENT);
557 | const blockStmt = whileStmt.body as BlockStatement;
558 | expect(blockStmt.stmts.length).equal(2);
559 | expect(blockStmt.stmts[0].type).equal(T_LET_STATEMENT);
560 | expect(blockStmt.stmts[1].type).equal(T_BREAK_STATEMENT);
561 | });
562 |
563 | it("do-while statement - empty body", () => {
564 | // --- Arrange
565 | const wParser = new Parser("do ; while (a > b);");
566 |
567 | // --- Act
568 | const stmts = wParser.parseStatements()!;
569 |
570 | // --- Assert
571 |
572 | expect(stmts.length).equal(1);
573 | expect(stmts[0].type).equal(T_DO_WHILE_STATEMENT);
574 | const whileStmt = stmts[0] as DoWhileStatement;
575 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
576 | expect(whileStmt.body.type).equal(T_EMPTY_STATEMENT);
577 | });
578 |
579 | it("do-while statement - single statement body", () => {
580 | // --- Arrange
581 | const wParser = new Parser("do break; while (a > b)");
582 |
583 | // --- Act
584 | const stmts = wParser.parseStatements()!;
585 |
586 | // --- Assert
587 |
588 | expect(stmts.length).equal(1);
589 | expect(stmts[0].type).equal(T_DO_WHILE_STATEMENT);
590 | const whileStmt = stmts[0] as DoWhileStatement;
591 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
592 | expect(whileStmt.body.type).equal(T_BREAK_STATEMENT);
593 | });
594 |
595 | it("do-while statement - block body", () => {
596 | // --- Arrange
597 | const wParser = new Parser("do { let x = 1; break; } while (a > b)");
598 |
599 | // --- Act
600 | const stmts = wParser.parseStatements()!;
601 |
602 | // --- Assert
603 |
604 | expect(stmts.length).equal(1);
605 | expect(stmts[0].type).equal(T_DO_WHILE_STATEMENT);
606 | const whileStmt = stmts[0] as DoWhileStatement;
607 | expect(whileStmt.cond.type).equal(T_BINARY_EXPRESSION);
608 | expect(whileStmt.body.type).equal(T_BLOCK_STATEMENT);
609 | const blockStmt = whileStmt.body as BlockStatement;
610 | expect(blockStmt.stmts.length).equal(2);
611 | expect(blockStmt.stmts[0].type).equal(T_LET_STATEMENT);
612 | expect(blockStmt.stmts[1].type).equal(T_BREAK_STATEMENT);
613 | });
614 |
615 | it("for loop - no declaration, no body", () => {
616 | // --- Arrange
617 | const wParser = new Parser("for (;;);");
618 |
619 | // --- Act
620 | const stmts = wParser.parseStatements()!;
621 |
622 | // --- Assert
623 |
624 | expect(stmts.length).equal(1);
625 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
626 | const forStmt = stmts[0] as ForStatement;
627 | expect(forStmt.init).equal(undefined);
628 | expect(forStmt.cond).equal(undefined);
629 | expect(forStmt.upd).equal(undefined);
630 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
631 | });
632 |
633 | it("for loop - no init, no condition, no body", () => {
634 | // --- Arrange
635 | const wParser = new Parser("for (;; x++);");
636 |
637 | // --- Act
638 | const stmts = wParser.parseStatements()!;
639 |
640 | // --- Assert
641 |
642 | expect(stmts.length).equal(1);
643 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
644 | const forStmt = stmts[0] as ForStatement;
645 | expect(forStmt.init).equal(undefined);
646 | expect(forStmt.cond).equal(undefined);
647 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
648 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
649 | });
650 |
651 | it("for loop - no init, no body", () => {
652 | // --- Arrange
653 | const wParser = new Parser("for (; x < 3; x++);");
654 |
655 | // --- Act
656 | const stmts = wParser.parseStatements()!;
657 |
658 | // --- Assert
659 |
660 | expect(stmts.length).equal(1);
661 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
662 | const forStmt = stmts[0] as ForStatement;
663 | expect(forStmt.init).equal(undefined);
664 | expect(forStmt.cond!.type).equal(T_BINARY_EXPRESSION);
665 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
666 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
667 | });
668 |
669 | it("for loop - expr init, no body", () => {
670 | // --- Arrange
671 | const wParser = new Parser("for (x = 0; x < 3; x++);");
672 |
673 | // --- Act
674 | const stmts = wParser.parseStatements()!;
675 |
676 | // --- Assert
677 |
678 | expect(stmts.length).equal(1);
679 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
680 | const forStmt = stmts[0] as ForStatement;
681 | expect(forStmt.init!.type).equal(T_EXPRESSION_STATEMENT);
682 | expect(forStmt.cond!.type).equal(T_BINARY_EXPRESSION);
683 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
684 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
685 | });
686 |
687 | it("for loop - let init, no body", () => {
688 | // --- Arrange
689 | const wParser = new Parser("for (let x = 0; x < 3; x++);");
690 |
691 | // --- Act
692 | const stmts = wParser.parseStatements()!;
693 |
694 | // --- Assert
695 |
696 | expect(stmts.length).equal(1);
697 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
698 | const forStmt = stmts[0] as ForStatement;
699 | expect(forStmt.init!.type).equal(T_LET_STATEMENT);
700 | expect(forStmt.cond!.type).equal(T_BINARY_EXPRESSION);
701 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
702 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
703 | });
704 |
705 | it("for loop - let init with '$'", () => {
706 | // --- Arrange
707 | const wParser = new Parser("for (let $x = 0; x < 3; x++);");
708 |
709 | // --- Act
710 | try {
711 | wParser.parseStatements()!;
712 | } catch (err) {
713 | expect(wParser.errors[0].code).equal("W031");
714 | return;
715 | }
716 | assert.fail("Exception expected");
717 | });
718 |
719 | it("for loop - single statement body", () => {
720 | // --- Arrange
721 | const wParser = new Parser("for (let x = 0; x < 3; x++) y++");
722 |
723 | // --- Act
724 | const stmts = wParser.parseStatements()!;
725 |
726 | // --- Assert
727 |
728 | expect(stmts.length).equal(1);
729 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
730 | const forStmt = stmts[0] as ForStatement;
731 | expect(forStmt.init!.type).equal(T_LET_STATEMENT);
732 | expect(forStmt.cond!.type).equal(T_BINARY_EXPRESSION);
733 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
734 | expect(forStmt.body.type).equal(T_EXPRESSION_STATEMENT);
735 | });
736 |
737 | it("for loop - block statement body", () => {
738 | // --- Arrange
739 | const wParser = new Parser("for (let x = 0; x < 3; x++) {y++; break;}");
740 |
741 | // --- Act
742 | const stmts = wParser.parseStatements()!;
743 |
744 | // --- Assert
745 |
746 | expect(stmts.length).equal(1);
747 | expect(stmts[0].type).equal(T_FOR_STATEMENT);
748 | const forStmt = stmts[0] as ForStatement;
749 | expect(forStmt.init!.type).equal(T_LET_STATEMENT);
750 | expect(forStmt.cond!.type).equal(T_BINARY_EXPRESSION);
751 | expect(forStmt.upd!.type).equal(T_POSTFIX_OP_EXPRESSION);
752 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
753 | });
754 |
755 | it("Throw statement - with expression", () => {
756 | // --- Arrange
757 | const wParser = new Parser("throw 123;");
758 |
759 | // --- Act
760 | const stmts = wParser.parseStatements()!;
761 |
762 | // --- Assert
763 |
764 | expect(stmts.length).equal(1);
765 | expect(stmts[0].type).equal(T_THROW_STATEMENT);
766 | const throwStmt = stmts[0] as ThrowStatement;
767 | expect(throwStmt.expr!.type).equal(T_LITERAL);
768 | });
769 |
770 | it("Try statement - with catch", () => {
771 | // --- Arrange
772 | const wParser = new Parser("try { let x = 1; } catch { return; }");
773 |
774 | // --- Act
775 | const stmts = wParser.parseStatements()!;
776 |
777 | // --- Assert
778 |
779 | expect(stmts.length).equal(1);
780 | expect(stmts[0].type).equal(T_TRY_STATEMENT);
781 | const tryStmt = stmts[0] as TryStatement;
782 | expect(tryStmt.tryB.stmts[0].type).equal(T_LET_STATEMENT);
783 | expect(tryStmt.catchV).equal(undefined);
784 | expect(tryStmt.catchB!.stmts[0].type).equal(T_RETURN_STATEMENT);
785 | expect(tryStmt.finallyB).equal(undefined);
786 | });
787 |
788 | it("Try statement - with catch and catch variable", () => {
789 | // --- Arrange
790 | const wParser = new Parser("try { let x = 1; } catch (err) { return; }");
791 |
792 | // --- Act
793 | const stmts = wParser.parseStatements()!;
794 |
795 | // --- Assert
796 |
797 | expect(stmts.length).equal(1);
798 | expect(stmts[0].type).equal(T_TRY_STATEMENT);
799 | const tryStmt = stmts[0] as TryStatement;
800 | expect(tryStmt.tryB.stmts[0].type).equal(T_LET_STATEMENT);
801 | expect(tryStmt.catchV!.name).equal("err");
802 | expect(tryStmt.catchB!.stmts[0].type).equal(T_RETURN_STATEMENT);
803 | expect(tryStmt.finallyB).equal(undefined);
804 | });
805 |
806 | it("Try statement - with finally", () => {
807 | // --- Arrange
808 | const wParser = new Parser("try { let x = 1; } finally { return; }");
809 |
810 | // --- Act
811 | const stmts = wParser.parseStatements()!;
812 |
813 | // --- Assert
814 |
815 | expect(stmts.length).equal(1);
816 | expect(stmts[0].type).equal(T_TRY_STATEMENT);
817 | const tryStmt = stmts[0] as TryStatement;
818 | expect(tryStmt.tryB.stmts[0].type).equal(T_LET_STATEMENT);
819 | expect(tryStmt.catchV).equal(undefined);
820 | expect(tryStmt.catchB).equal(undefined);
821 | expect(tryStmt.finallyB!.stmts[0].type).equal(T_RETURN_STATEMENT);
822 | });
823 |
824 | it("Try statement - with catch and finally", () => {
825 | // --- Arrange
826 | const wParser = new Parser("try { let x = 1; } catch { return; } finally { break; }");
827 |
828 | // --- Act
829 | const stmts = wParser.parseStatements()!;
830 |
831 | // --- Assert
832 |
833 | expect(stmts.length).equal(1);
834 | expect(stmts[0].type).equal(T_TRY_STATEMENT);
835 | const tryStmt = stmts[0] as TryStatement;
836 | expect(tryStmt.tryB.stmts[0].type).equal(T_LET_STATEMENT);
837 | expect(tryStmt.catchV).equal(undefined);
838 | expect(tryStmt.catchB!.stmts[0].type).equal(T_RETURN_STATEMENT);
839 | expect(tryStmt.finallyB!.stmts[0].type).equal(T_BREAK_STATEMENT);
840 | });
841 |
842 | it("Try statement - with catch, catch variable, and finally", () => {
843 | // --- Arrange
844 | const wParser = new Parser("try { let x = 1; } catch (err) { return; } finally { break; }");
845 |
846 | // --- Act
847 | const stmts = wParser.parseStatements()!;
848 |
849 | // --- Assert
850 |
851 | expect(stmts.length).equal(1);
852 | expect(stmts[0].type).equal(T_TRY_STATEMENT);
853 | const tryStmt = stmts[0] as TryStatement;
854 | expect(tryStmt.tryB.stmts[0].type).equal(T_LET_STATEMENT);
855 | expect(tryStmt.catchV!.name).equal("err");
856 | expect(tryStmt.catchB!.stmts[0].type).equal(T_RETURN_STATEMENT);
857 | expect(tryStmt.finallyB!.stmts[0].type).equal(T_BREAK_STATEMENT);
858 | });
859 |
860 | it("Switch statement - empty", () => {
861 | // --- Arrange
862 | const wParser = new Parser("switch (myValue) { }");
863 |
864 | // --- Act
865 | const stmts = wParser.parseStatements()!;
866 |
867 | // --- Assert
868 |
869 | expect(stmts.length).equal(1);
870 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
871 | const swcStmt = stmts[0] as SwitchStatement;
872 | expect(swcStmt.cases.length).equal(0);
873 | });
874 |
875 | it("Switch statement - single empty label", () => {
876 | // --- Arrange
877 | const wParser = new Parser(`
878 | switch (myValue) {
879 | case 0:
880 | }`);
881 |
882 | // --- Act
883 | const stmts = wParser.parseStatements()!;
884 |
885 | // --- Assert
886 |
887 | expect(stmts.length).equal(1);
888 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
889 | const swcStmt = stmts[0] as SwitchStatement;
890 | expect(swcStmt.cases.length).equal(1);
891 | const swcCase = swcStmt.cases[0];
892 | expect(swcCase.caseE!.type).equal(T_LITERAL);
893 | expect(swcCase.stmts!.length).equal(0);
894 | });
895 |
896 | it("Switch statement - single label/single statement", () => {
897 | // --- Arrange
898 | const wParser = new Parser(`
899 | switch (myValue) {
900 | case 0:
901 | let x = 3;
902 | }`);
903 |
904 | // --- Act
905 | const stmts = wParser.parseStatements()!;
906 |
907 | // --- Assert
908 |
909 | expect(stmts.length).equal(1);
910 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
911 | const swcStmt = stmts[0] as SwitchStatement;
912 | expect(swcStmt.cases.length).equal(1);
913 | const swcCase = swcStmt.cases[0];
914 | expect(swcCase.caseE!.type).equal(T_LITERAL);
915 | expect(swcCase.stmts!.length).equal(1);
916 | });
917 |
918 | it("Switch statement - single label/multiple statements", () => {
919 | // --- Arrange
920 | const wParser = new Parser(`
921 | switch (myValue) {
922 | case 0:
923 | let x = 3;
924 | console.log(x);
925 | }`);
926 |
927 | // --- Act
928 | const stmts = wParser.parseStatements()!;
929 |
930 | // --- Assert
931 |
932 | expect(stmts.length).equal(1);
933 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
934 | const swcStmt = stmts[0] as SwitchStatement;
935 | expect(swcStmt.cases.length).equal(1);
936 | const swcCase = swcStmt.cases[0];
937 | expect(swcCase.caseE!.type).equal(T_LITERAL);
938 | expect(swcCase.stmts!.length).equal(2);
939 | });
940 |
941 | it("Switch statement - multiple label #1", () => {
942 | // --- Arrange
943 | const wParser = new Parser(`
944 | switch (myValue) {
945 | case 0:
946 | case 1:
947 | let x = 3;
948 | console.log(x);
949 | }`);
950 |
951 | // --- Act
952 | const stmts = wParser.parseStatements()!;
953 |
954 | // --- Assert
955 |
956 | expect(stmts.length).equal(1);
957 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
958 | const swcStmt = stmts[0] as SwitchStatement;
959 | expect(swcStmt.cases.length).equal(2);
960 | let swcCase = swcStmt.cases[0];
961 | expect(swcCase.caseE!.type).equal(T_LITERAL);
962 | expect(swcCase.stmts!.length).equal(0);
963 | swcCase = swcStmt.cases[1];
964 | expect(swcCase.caseE!.type).equal(T_LITERAL);
965 | expect(swcCase.stmts!.length).equal(2);
966 | });
967 |
968 | it("Switch statement - multiple label #2", () => {
969 | // --- Arrange
970 | const wParser = new Parser(`
971 | switch (myValue) {
972 | case 0:
973 | let x = 3;
974 | console.log(x);
975 | case 1:
976 | }`);
977 |
978 | // --- Act
979 | const stmts = wParser.parseStatements()!;
980 |
981 | // --- Assert
982 |
983 | expect(stmts.length).equal(1);
984 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
985 | const swcStmt = stmts[0] as SwitchStatement;
986 | expect(swcStmt.cases.length).equal(2);
987 | let swcCase = swcStmt.cases[0];
988 | expect(swcCase.caseE!.type).equal(T_LITERAL);
989 | expect(swcCase.stmts!.length).equal(2);
990 | swcCase = swcStmt.cases[1];
991 | expect(swcCase.caseE!.type).equal(T_LITERAL);
992 | expect(swcCase.stmts!.length).equal(0);
993 | });
994 |
995 | it("Switch statement - multiple label #3", () => {
996 | // --- Arrange
997 | const wParser = new Parser(`
998 | switch (myValue) {
999 | case 0:
1000 | let x = 3;
1001 | console.log(x);
1002 | case 1:
1003 | break;
1004 | }`);
1005 |
1006 | // --- Act
1007 | const stmts = wParser.parseStatements()!;
1008 |
1009 | // --- Assert
1010 |
1011 | expect(stmts.length).equal(1);
1012 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1013 | const swcStmt = stmts[0] as SwitchStatement;
1014 | expect(swcStmt.cases.length).equal(2);
1015 | let swcCase = swcStmt.cases[0];
1016 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1017 | expect(swcCase.stmts!.length).equal(2);
1018 | swcCase = swcStmt.cases[1];
1019 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1020 | expect(swcCase.stmts!.length).equal(1);
1021 | });
1022 |
1023 | it("Switch statement - multiple label #4", () => {
1024 | // --- Arrange
1025 | const wParser = new Parser(`
1026 | switch (myValue) {
1027 | default:
1028 | case 0:
1029 | let x = 3;
1030 | console.log(x);
1031 | case 1:
1032 | break;
1033 | }`);
1034 |
1035 | // --- Act
1036 | const stmts = wParser.parseStatements()!;
1037 |
1038 | // --- Assert
1039 |
1040 | expect(stmts.length).equal(1);
1041 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1042 | const swcStmt = stmts[0] as SwitchStatement;
1043 | expect(swcStmt.cases.length).equal(3);
1044 | let swcCase = swcStmt.cases[0];
1045 | expect(swcCase.caseE).equal(undefined);
1046 | expect(swcCase.stmts!.length).equal(0);
1047 | swcCase = swcStmt.cases[1];
1048 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1049 | expect(swcCase.stmts!.length).equal(2);
1050 | swcCase = swcStmt.cases[2];
1051 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1052 | expect(swcCase.stmts!.length).equal(1);
1053 | });
1054 |
1055 | it("Switch statement - multiple label #5", () => {
1056 | // --- Arrange
1057 | const wParser = new Parser(`
1058 | switch (myValue) {
1059 | case 0:
1060 | let x = 3;
1061 | console.log(x);
1062 | default:
1063 | case 1:
1064 | break;
1065 | }`);
1066 |
1067 | // --- Act
1068 | const stmts = wParser.parseStatements()!;
1069 |
1070 | // --- Assert
1071 |
1072 | expect(stmts.length).equal(1);
1073 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1074 | const swcStmt = stmts[0] as SwitchStatement;
1075 | expect(swcStmt.cases.length).equal(3);
1076 | let swcCase = swcStmt.cases[0];
1077 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1078 | expect(swcCase.stmts!.length).equal(2);
1079 | swcCase = swcStmt.cases![1];
1080 | expect(swcCase.caseE).equal(undefined);
1081 | expect(swcCase.stmts!.length).equal(0);
1082 | swcCase = swcStmt.cases![2];
1083 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1084 | expect(swcCase.stmts!.length).equal(1);
1085 | });
1086 |
1087 | it("Switch statement - multiple label #6", () => {
1088 | // --- Arrange
1089 | const wParser = new Parser(`
1090 | switch (myValue) {
1091 | case 0:
1092 | let x = 3;
1093 | console.log(x);
1094 | case 1:
1095 | default:
1096 | break;
1097 | }`);
1098 |
1099 | // --- Act
1100 | const stmts = wParser.parseStatements()!;
1101 |
1102 | // --- Assert
1103 |
1104 | expect(stmts.length).equal(1);
1105 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1106 | const swcStmt = stmts[0] as SwitchStatement;
1107 | expect(swcStmt.cases.length).equal(3);
1108 | let swcCase = swcStmt.cases[0];
1109 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1110 | expect(swcCase.stmts!.length).equal(2);
1111 | swcCase = swcStmt.cases[1];
1112 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1113 | expect(swcCase.stmts!.length).equal(0);
1114 | swcCase = swcStmt.cases[2];
1115 | expect(swcCase.caseE).equal(undefined);
1116 | expect(swcCase.stmts!.length).equal(1);
1117 | });
1118 |
1119 | it("Switch statement - multiple label #7", () => {
1120 | // --- Arrange
1121 | const wParser = new Parser(`
1122 | switch (myValue) {
1123 | case 0:
1124 | let x = 3;
1125 | console.log(x);
1126 | case 1:
1127 | break;
1128 | default:
1129 | }`);
1130 |
1131 | // --- Act
1132 | const stmts = wParser.parseStatements()!;
1133 |
1134 | // --- Assert
1135 |
1136 | expect(stmts.length).equal(1);
1137 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1138 | const swcStmt = stmts[0] as SwitchStatement;
1139 | expect(swcStmt.cases.length).equal(3);
1140 | let swcCase = swcStmt.cases[0];
1141 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1142 | expect(swcCase.stmts!.length).equal(2);
1143 | swcCase = swcStmt.cases[1];
1144 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1145 | expect(swcCase.stmts!.length).equal(1);
1146 | swcCase = swcStmt.cases[2];
1147 | expect(swcCase.caseE).equal(undefined);
1148 | expect(swcCase.stmts!.length).equal(0);
1149 | });
1150 |
1151 | it("Switch statement - multiple label #8", () => {
1152 | // --- Arrange
1153 | const wParser = new Parser(`
1154 | switch (myValue) {
1155 | case 0:
1156 | let x = 3;
1157 | console.log(x);
1158 | case 1:
1159 | break;
1160 | default: {
1161 | let x = 0;
1162 | console.log(x);
1163 | }
1164 | }`);
1165 |
1166 | // --- Act
1167 | const stmts = wParser.parseStatements()!;
1168 |
1169 | // --- Assert
1170 |
1171 | expect(stmts.length).equal(1);
1172 | expect(stmts[0].type).equal(T_SWITCH_STATEMENT);
1173 | const swcStmt = stmts[0] as SwitchStatement;
1174 | expect(swcStmt.cases.length).equal(3);
1175 | let swcCase = swcStmt.cases[0];
1176 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1177 | expect(swcCase.stmts!.length).equal(2);
1178 | swcCase = swcStmt.cases[1];
1179 | expect(swcCase.caseE!.type).equal(T_LITERAL);
1180 | expect(swcCase.stmts!.length).equal(1);
1181 | swcCase = swcStmt.cases[2];
1182 | expect(swcCase.caseE).equal(undefined);
1183 | expect(swcCase.stmts!.length).equal(1);
1184 | });
1185 |
1186 | it("Switch statement - multiple default", () => {
1187 | // --- Arrange
1188 | const wParser = new Parser(`
1189 | switch (myValue) {
1190 | default:
1191 | let x = 3;
1192 | console.log(x);
1193 | case 1:
1194 | break;
1195 | default: {
1196 | let x = 0;
1197 | console.log(x);
1198 | }
1199 | }`);
1200 |
1201 | // --- Act/Assert
1202 | try {
1203 | wParser.parseStatements()!;
1204 | } catch (err) {
1205 | expect(wParser.errors.length).equal(1);
1206 | expect(wParser.errors[0].code).equal("W016");
1207 | return;
1208 | }
1209 | assert.fail("Exception expected");
1210 | });
1211 |
1212 | it("for..in loop - no var binding, no body", () => {
1213 | // --- Arrange
1214 | const wParser = new Parser("for (myVar in collection);");
1215 |
1216 | // --- Act
1217 | const stmts = wParser.parseStatements()!;
1218 |
1219 | // --- Assert
1220 |
1221 | expect(stmts.length).equal(1);
1222 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1223 | const forStmt = stmts[0] as ForInStatement;
1224 | expect(forStmt.varB).equal("none");
1225 | expect(forStmt.id.name).equal("myVar");
1226 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1227 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1228 | });
1229 |
1230 | it("for..in loop - 'let' binding, no body", () => {
1231 | // --- Arrange
1232 | const wParser = new Parser("for (let myVar in collection);");
1233 |
1234 | // --- Act
1235 | const stmts = wParser.parseStatements()!;
1236 |
1237 | // --- Assert
1238 |
1239 | expect(stmts.length).equal(1);
1240 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1241 | const forStmt = stmts[0] as ForInStatement;
1242 | expect(forStmt.varB).equal("let");
1243 | expect(forStmt.id.name).equal("myVar");
1244 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1245 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1246 | });
1247 |
1248 | it("for..in loop - 'let' binding with '$'", () => {
1249 | // --- Arrange
1250 | const wParser = new Parser("for (let $myVar in collection);");
1251 |
1252 | // --- Act
1253 | try {
1254 | wParser.parseStatements()!;
1255 | } catch (err) {
1256 | expect(wParser.errors[0].code).equal("W031");
1257 | return;
1258 | }
1259 | assert.fail("Exception expected");
1260 | });
1261 |
1262 | it("for..in loop - 'const' binding, no body", () => {
1263 | // --- Arrange
1264 | const wParser = new Parser("for (const myVar in collection);");
1265 |
1266 | // --- Act
1267 | const stmts = wParser.parseStatements()!;
1268 |
1269 | // --- Assert
1270 |
1271 | expect(stmts.length).equal(1);
1272 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1273 | const forStmt = stmts[0] as ForInStatement;
1274 | expect(forStmt.varB).equal("const");
1275 | expect(forStmt.id.name).equal("myVar");
1276 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1277 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1278 | });
1279 |
1280 | it("for..in loop - 'const' binding with '$'", () => {
1281 | // --- Arrange
1282 | const wParser = new Parser("for (const $myVar in collection);");
1283 |
1284 | // --- Act
1285 | try {
1286 | wParser.parseStatements()!;
1287 | } catch (err) {
1288 | expect(wParser.errors[0].code).equal("W031");
1289 | return;
1290 | }
1291 | assert.fail("Exception expected");
1292 | });
1293 |
1294 | it("for..in loop - no var binding, body", () => {
1295 | // --- Arrange
1296 | const wParser = new Parser("for (myVar in collection) { console.log(myVar); }");
1297 |
1298 | // --- Act
1299 | const stmts = wParser.parseStatements()!;
1300 |
1301 | // --- Assert
1302 |
1303 | expect(stmts.length).equal(1);
1304 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1305 | const forStmt = stmts[0] as ForInStatement;
1306 | expect(forStmt.varB).equal("none");
1307 | expect(forStmt.id.name).equal("myVar");
1308 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1309 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1310 | });
1311 |
1312 | it("for..in loop - 'let' binding, body", () => {
1313 | // --- Arrange
1314 | const wParser = new Parser("for (let myVar in collection) { console.log(myVar); }");
1315 |
1316 | // --- Act
1317 | const stmts = wParser.parseStatements()!;
1318 |
1319 | // --- Assert
1320 |
1321 | expect(stmts.length).equal(1);
1322 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1323 | const forStmt = stmts[0] as ForInStatement;
1324 | expect(forStmt.varB).equal("let");
1325 | expect(forStmt.id.name).equal("myVar");
1326 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1327 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1328 | });
1329 |
1330 | it("for..in loop - 'const' binding, body", () => {
1331 | // --- Arrange
1332 | const wParser = new Parser("for (const myVar in collection) { console.log(myVar); }");
1333 |
1334 | // --- Act
1335 | const stmts = wParser.parseStatements()!;
1336 |
1337 | // --- Assert
1338 |
1339 | expect(stmts.length).equal(1);
1340 | expect(stmts[0].type).equal(T_FOR_IN_STATEMENT);
1341 | const forStmt = stmts[0] as ForInStatement;
1342 | expect(forStmt.varB).equal("const");
1343 | expect(forStmt.id.name).equal("myVar");
1344 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1345 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1346 | });
1347 |
1348 | it("for..of loop - no var binding, no body", () => {
1349 | // --- Arrange
1350 | const wParser = new Parser("for (myVar of collection);");
1351 |
1352 | // --- Act
1353 | const stmts = wParser.parseStatements()!;
1354 |
1355 | // --- Assert
1356 |
1357 | expect(stmts.length).equal(1);
1358 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1359 | const forStmt = stmts[0] as ForOfStatement;
1360 | expect(forStmt.varB).equal("none");
1361 | expect(forStmt.id.name).equal("myVar");
1362 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1363 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1364 | });
1365 |
1366 | it("for..of loop - 'let' binding, no body", () => {
1367 | // --- Arrange
1368 | const wParser = new Parser("for (let myVar of collection);");
1369 |
1370 | // --- Act
1371 | const stmts = wParser.parseStatements()!;
1372 |
1373 | // --- Assert
1374 |
1375 | expect(stmts.length).equal(1);
1376 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1377 | const forStmt = stmts[0] as ForOfStatement;
1378 | expect(forStmt.varB).equal("let");
1379 | expect(forStmt.id.name).equal("myVar");
1380 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1381 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1382 | });
1383 |
1384 | it("for..of loop - 'let' binding with '$'", () => {
1385 | // --- Arrange
1386 | const wParser = new Parser("for (let $myVar of collection);");
1387 |
1388 | // --- Act
1389 | try {
1390 | wParser.parseStatements()!;
1391 | } catch (err) {
1392 | expect(wParser.errors[0].code).equal("W031");
1393 | return;
1394 | }
1395 | assert.fail("Exception expected");
1396 | });
1397 |
1398 | it("for..of loop - 'const' binding, no body", () => {
1399 | // --- Arrange
1400 | const wParser = new Parser("for (const myVar of collection);");
1401 |
1402 | // --- Act
1403 | const stmts = wParser.parseStatements()!;
1404 |
1405 | // --- Assert
1406 |
1407 | expect(stmts.length).equal(1);
1408 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1409 | const forStmt = stmts[0] as ForOfStatement;
1410 | expect(forStmt.varB).equal("const");
1411 | expect(forStmt.id.name).equal("myVar");
1412 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1413 | expect(forStmt.body.type).equal(T_EMPTY_STATEMENT);
1414 | });
1415 |
1416 | it("for..of loop - 'const' binding with '$'", () => {
1417 | // --- Arrange
1418 | const wParser = new Parser("for (const $myVar of collection);");
1419 |
1420 | // --- Act
1421 | try {
1422 | wParser.parseStatements()!;
1423 | } catch (err) {
1424 | expect(wParser.errors[0].code).equal("W031");
1425 | return;
1426 | }
1427 | assert.fail("Exception expected");
1428 | });
1429 |
1430 | it("for..of loop - no var binding, body", () => {
1431 | // --- Arrange
1432 | const wParser = new Parser("for (myVar of collection) { console.log(myVar); }");
1433 |
1434 | // --- Act
1435 | const stmts = wParser.parseStatements()!;
1436 |
1437 | // --- Assert
1438 |
1439 | expect(stmts.length).equal(1);
1440 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1441 | const forStmt = stmts[0] as ForOfStatement;
1442 | expect(forStmt.varB).equal("none");
1443 | expect(forStmt.id.name).equal("myVar");
1444 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1445 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1446 | });
1447 |
1448 | it("for..of loop - 'let' binding, body", () => {
1449 | // --- Arrange
1450 | const wParser = new Parser("for (let myVar of collection) { console.log(myVar); }");
1451 |
1452 | // --- Act
1453 | const stmts = wParser.parseStatements()!;
1454 |
1455 | // --- Assert
1456 |
1457 | expect(stmts.length).equal(1);
1458 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1459 | const forStmt = stmts[0] as ForOfStatement;
1460 | expect(forStmt.varB).equal("let");
1461 | expect(forStmt.id.name).equal("myVar");
1462 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1463 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1464 | });
1465 |
1466 | it("for..of loop - 'const' binding, body", () => {
1467 | // --- Arrange
1468 | const wParser = new Parser("for (const myVar of collection) { console.log(myVar); }");
1469 |
1470 | // --- Act
1471 | const stmts = wParser.parseStatements()!;
1472 |
1473 | // --- Assert
1474 |
1475 | expect(stmts.length).equal(1);
1476 | expect(stmts[0].type).equal(T_FOR_OF_STATEMENT);
1477 | const forStmt = stmts[0] as ForOfStatement;
1478 | expect(forStmt.varB).equal("const");
1479 | expect(forStmt.id.name).equal("myVar");
1480 | expect(forStmt.expr.type).equal(T_IDENTIFIER);
1481 | expect(forStmt.body.type).equal(T_BLOCK_STATEMENT);
1482 | });
1483 | });
1484 |
```