├── .github └── workflows │ └── deploy.yml ├── .gitignore ├── README.md ├── README_EN.md ├── doc ├── .vscode │ └── extensions.json ├── README.md ├── index.html ├── package.json ├── pnpm-lock.yaml ├── public │ ├── nighta.png │ ├── nighta.svg │ └── nighta_transparent.png ├── src │ ├── App.vue │ ├── assets │ │ └── vue.svg │ ├── components │ │ ├── monacoEditor │ │ │ ├── MonacoEditor.vue │ │ │ └── monacoEditorType.ts │ │ ├── navbar │ │ │ └── Navbar.vue │ │ ├── section │ │ │ └── Section.vue │ │ └── sideMenu │ │ │ └── SideMenu.vue │ ├── documents │ │ └── sectionList.ts │ ├── main.ts │ ├── pages │ │ ├── home │ │ │ └── Home.vue │ │ ├── main │ │ │ └── Main.vue │ │ └── playground │ │ │ └── Playground.vue │ ├── router │ │ └── router.ts │ ├── style.css │ ├── util │ │ ├── interpreter.js │ │ └── safeJsonStringify.ts │ └── vite-env.d.ts ├── tsconfig.json ├── tsconfig.node.json └── vite.config.ts ├── lib ├── esm │ └── index.esm.js └── umd │ └── index.umd.js ├── package.json ├── pnpm-lock.yaml ├── rollup.config.js └── src ├── Nighta.js ├── environment └── Environment.js ├── parser ├── Parser.js ├── gen.ps1 ├── grammar.bnf └── grammar.js ├── test ├── block-test.js ├── build-in-function-test.js ├── class-test.js ├── eval-test.js ├── if-test.js ├── index.js ├── lambda-function-test.js ├── math-test.js ├── switch-test.js ├── user-defined-function-test.js ├── variable-test.js └── while-test.js └── transformer └── Transformer.js /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Vue Site to GitHub Pages 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | workflow_dispatch: 7 | 8 | permissions: 9 | contents: read 10 | pages: write 11 | id-token: write 12 | 13 | concurrency: 14 | group: ${{ github.workflow }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | build-and-deploy: 19 | runs-on: ubuntu-latest 20 | concurrency: 21 | group: deploy 22 | steps: 23 | - name: Checkout Repository 24 | uses: actions/checkout@v4 25 | with: 26 | fetch-depth: 0 27 | 28 | - name: Install PNPM 29 | run: npm install -g pnpm 30 | 31 | - name: Setup Node.js 32 | uses: actions/setup-node@v4 33 | with: 34 | node-version: 20 35 | cache: 'pnpm' 36 | 37 | - name: Setup pnpm 38 | uses: pnpm/action-setup@v3 39 | with: 40 | version: 8 41 | 42 | - name: Install Dependencies in Doc Directory 43 | working-directory: ./doc 44 | run: pnpm install 45 | 46 | - name: Build Vue App 47 | working-directory: ./doc 48 | run: pnpm run build 49 | 50 | # 使用官方的actions/deploy-pages行动部署到GitHub Pages,但需注意actions/deploy-pages@v4并不存在,应使用其他适合的部署action 51 | - name: Deploy to GitHub Pages 52 | uses: peaceiris/actions-gh-pages@v3 53 | with: 54 | personal_token: ${{ secrets.TOKEN }} 55 | publish_dir: ./doc/dist -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Nighta 2 | 3 | 语言: [中文](.) | [ENGLISH](./README_EN.md) 4 | 5 |
6 | Nighta 10 |
11 | 12 | `Nighta` 是一款轻量级的脚本语言。其名字的寓意是“一夜之间产生的事物”。 13 | 14 | ## 代码示例 15 | 16 | ```nighta 17 | (var msg1 "Hello,") 18 | (var msg2 "World!") 19 | (say (msg1 + msg2)) 20 | ``` 21 | 22 | ## 快速开始 23 | 现阶段,我们可以在 [Playground](https://coderserio.github.io/Nighta/#/playground/) 中使用 Nighta 进行编程。 24 | 25 | ## 文档 26 | 阅读 [文档](https://coderserio.github.io/Nighta/#/) 获取更多关于 Nighta 的细节! 27 | 28 | ## 贡献指南 29 | 想要为Nighta的发展添砖加瓦?这或许还不到时候... -------------------------------------------------------------------------------- /README_EN.md: -------------------------------------------------------------------------------- 1 | # Nighta 2 | 3 | language: [中文](./README.md) | [ENGLISH](.) 4 | 5 |
6 | Nighta 10 |
11 | 12 | `Nighta` is a lightweight scripting language, with its name signifying "something created overnight." 13 | 14 | ## Code Sample 15 | 16 | ```nighta 17 | (var msg1 "Hello,") 18 | (var msg2 "World!") 19 | (say (msg1 + msg2)) 20 | ``` 21 | 22 | ## Quick Start 23 | Currently, we can code with Nighta in the [Playground](https://coderserio.github.io/Nighta/#/playground/) 24 | 25 | ## Document 26 | Read [Document](https://coderserio.github.io/Nighta/#/) to learn about Nighta more! 27 | 28 | ## Contribution Guide 29 | Eager to contribute to Nighta's growth? It might not be the time just yet... -------------------------------------------------------------------------------- /doc/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["Vue.volar"] 3 | } 4 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | # Vue 3 + TypeScript + Vite 2 | 3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` 12 | 13 | 14 | -------------------------------------------------------------------------------- /doc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "doc", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vue-tsc && vite build", 9 | "preview": "vite preview" 10 | }, 11 | "dependencies": { 12 | "@devui-design/icons": "^1.4.0", 13 | "devui-theme": "^0.0.7", 14 | "vue": "^3.4.21", 15 | "vue-devui": "^1.6.20", 16 | "vue-router": "4", 17 | "monaco-editor": "^0.50.0" 18 | }, 19 | "devDependencies": { 20 | "@vitejs/plugin-vue": "^5.0.4", 21 | "rollup-plugin-node-resolve": "^5.2.0", 22 | "sass": "^1.77.6", 23 | "typescript": "^5.2.2", 24 | "vite": "^5.2.0", 25 | "vue-tsc": "^2.0.6" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /doc/pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '9.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | importers: 8 | 9 | .: 10 | dependencies: 11 | '@devui-design/icons': 12 | specifier: ^1.4.0 13 | version: 1.4.0 14 | devui-theme: 15 | specifier: ^0.0.7 16 | version: 0.0.7 17 | monaco-editor: 18 | specifier: ^0.50.0 19 | version: 0.50.0 20 | vue: 21 | specifier: ^3.4.21 22 | version: 3.4.29(typescript@5.4.5) 23 | vue-devui: 24 | specifier: ^1.6.20 25 | version: 1.6.20(vue@3.4.29(typescript@5.4.5)) 26 | vue-router: 27 | specifier: '4' 28 | version: 4.3.3(vue@3.4.29(typescript@5.4.5)) 29 | devDependencies: 30 | '@vitejs/plugin-vue': 31 | specifier: ^5.0.4 32 | version: 5.0.5(vite@5.3.1(@types/node@20.14.6)(sass@1.77.6))(vue@3.4.29(typescript@5.4.5)) 33 | rollup-plugin-node-resolve: 34 | specifier: ^5.2.0 35 | version: 5.2.0(rollup@4.18.0) 36 | sass: 37 | specifier: ^1.77.6 38 | version: 1.77.6 39 | typescript: 40 | specifier: ^5.2.2 41 | version: 5.4.5 42 | vite: 43 | specifier: ^5.2.0 44 | version: 5.3.1(@types/node@20.14.6)(sass@1.77.6) 45 | vue-tsc: 46 | specifier: ^2.0.6 47 | version: 2.0.21(typescript@5.4.5) 48 | 49 | packages: 50 | 51 | '@babel/helper-hoist-variables@7.24.7': 52 | resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} 53 | engines: {node: '>=6.9.0'} 54 | 55 | '@babel/helper-string-parser@7.24.7': 56 | resolution: {integrity: sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==} 57 | engines: {node: '>=6.9.0'} 58 | 59 | '@babel/helper-validator-identifier@7.24.7': 60 | resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} 61 | engines: {node: '>=6.9.0'} 62 | 63 | '@babel/parser@7.24.7': 64 | resolution: {integrity: sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==} 65 | engines: {node: '>=6.0.0'} 66 | hasBin: true 67 | 68 | '@babel/types@7.24.7': 69 | resolution: {integrity: sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==} 70 | engines: {node: '>=6.9.0'} 71 | 72 | '@braintree/sanitize-url@6.0.4': 73 | resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} 74 | 75 | '@devui-design/icons@1.4.0': 76 | resolution: {integrity: sha512-taAX1RNW0QHUqQTRPqLTYTB2PZIqUplhWeF4hcmWkSTjpWlDNI40DssG/WRb3sISkfBk/4BMUxxC5XeTL3jo7A==} 77 | 78 | '@esbuild/aix-ppc64@0.21.5': 79 | resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} 80 | engines: {node: '>=12'} 81 | cpu: [ppc64] 82 | os: [aix] 83 | 84 | '@esbuild/android-arm64@0.21.5': 85 | resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} 86 | engines: {node: '>=12'} 87 | cpu: [arm64] 88 | os: [android] 89 | 90 | '@esbuild/android-arm@0.21.5': 91 | resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} 92 | engines: {node: '>=12'} 93 | cpu: [arm] 94 | os: [android] 95 | 96 | '@esbuild/android-x64@0.21.5': 97 | resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} 98 | engines: {node: '>=12'} 99 | cpu: [x64] 100 | os: [android] 101 | 102 | '@esbuild/darwin-arm64@0.21.5': 103 | resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} 104 | engines: {node: '>=12'} 105 | cpu: [arm64] 106 | os: [darwin] 107 | 108 | '@esbuild/darwin-x64@0.21.5': 109 | resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} 110 | engines: {node: '>=12'} 111 | cpu: [x64] 112 | os: [darwin] 113 | 114 | '@esbuild/freebsd-arm64@0.21.5': 115 | resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} 116 | engines: {node: '>=12'} 117 | cpu: [arm64] 118 | os: [freebsd] 119 | 120 | '@esbuild/freebsd-x64@0.21.5': 121 | resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} 122 | engines: {node: '>=12'} 123 | cpu: [x64] 124 | os: [freebsd] 125 | 126 | '@esbuild/linux-arm64@0.21.5': 127 | resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} 128 | engines: {node: '>=12'} 129 | cpu: [arm64] 130 | os: [linux] 131 | 132 | '@esbuild/linux-arm@0.21.5': 133 | resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} 134 | engines: {node: '>=12'} 135 | cpu: [arm] 136 | os: [linux] 137 | 138 | '@esbuild/linux-ia32@0.21.5': 139 | resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} 140 | engines: {node: '>=12'} 141 | cpu: [ia32] 142 | os: [linux] 143 | 144 | '@esbuild/linux-loong64@0.21.5': 145 | resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} 146 | engines: {node: '>=12'} 147 | cpu: [loong64] 148 | os: [linux] 149 | 150 | '@esbuild/linux-mips64el@0.21.5': 151 | resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} 152 | engines: {node: '>=12'} 153 | cpu: [mips64el] 154 | os: [linux] 155 | 156 | '@esbuild/linux-ppc64@0.21.5': 157 | resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} 158 | engines: {node: '>=12'} 159 | cpu: [ppc64] 160 | os: [linux] 161 | 162 | '@esbuild/linux-riscv64@0.21.5': 163 | resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} 164 | engines: {node: '>=12'} 165 | cpu: [riscv64] 166 | os: [linux] 167 | 168 | '@esbuild/linux-s390x@0.21.5': 169 | resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} 170 | engines: {node: '>=12'} 171 | cpu: [s390x] 172 | os: [linux] 173 | 174 | '@esbuild/linux-x64@0.21.5': 175 | resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} 176 | engines: {node: '>=12'} 177 | cpu: [x64] 178 | os: [linux] 179 | 180 | '@esbuild/netbsd-x64@0.21.5': 181 | resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} 182 | engines: {node: '>=12'} 183 | cpu: [x64] 184 | os: [netbsd] 185 | 186 | '@esbuild/openbsd-x64@0.21.5': 187 | resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} 188 | engines: {node: '>=12'} 189 | cpu: [x64] 190 | os: [openbsd] 191 | 192 | '@esbuild/sunos-x64@0.21.5': 193 | resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} 194 | engines: {node: '>=12'} 195 | cpu: [x64] 196 | os: [sunos] 197 | 198 | '@esbuild/win32-arm64@0.21.5': 199 | resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} 200 | engines: {node: '>=12'} 201 | cpu: [arm64] 202 | os: [win32] 203 | 204 | '@esbuild/win32-ia32@0.21.5': 205 | resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} 206 | engines: {node: '>=12'} 207 | cpu: [ia32] 208 | os: [win32] 209 | 210 | '@esbuild/win32-x64@0.21.5': 211 | resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} 212 | engines: {node: '>=12'} 213 | cpu: [x64] 214 | os: [win32] 215 | 216 | '@floating-ui/core@1.6.2': 217 | resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} 218 | 219 | '@floating-ui/dom@1.2.5': 220 | resolution: {integrity: sha512-+sAUfpQ3Frz+VCbPCqj+cZzvEESy3fjSeT/pDWkYCWOBXYNNKZfuVsHuv8/JO2zze8+Eb/Q7a6hZVgzS81fLbQ==} 221 | 222 | '@floating-ui/utils@0.2.2': 223 | resolution: {integrity: sha512-J4yDIIthosAsRZ5CPYP/jQvUAQtlZTTD/4suA08/FEnlxqW3sKS9iAhgsa9VYLZ6vDHn/ixJgIqRQPotoBjxIw==} 224 | 225 | '@iktakahiro/markdown-it-katex@4.0.1': 226 | resolution: {integrity: sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==} 227 | 228 | '@jridgewell/sourcemap-codec@1.4.15': 229 | resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} 230 | 231 | '@rollup/rollup-android-arm-eabi@4.18.0': 232 | resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} 233 | cpu: [arm] 234 | os: [android] 235 | 236 | '@rollup/rollup-android-arm64@4.18.0': 237 | resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} 238 | cpu: [arm64] 239 | os: [android] 240 | 241 | '@rollup/rollup-darwin-arm64@4.18.0': 242 | resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} 243 | cpu: [arm64] 244 | os: [darwin] 245 | 246 | '@rollup/rollup-darwin-x64@4.18.0': 247 | resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} 248 | cpu: [x64] 249 | os: [darwin] 250 | 251 | '@rollup/rollup-linux-arm-gnueabihf@4.18.0': 252 | resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} 253 | cpu: [arm] 254 | os: [linux] 255 | libc: [glibc] 256 | 257 | '@rollup/rollup-linux-arm-musleabihf@4.18.0': 258 | resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} 259 | cpu: [arm] 260 | os: [linux] 261 | libc: [musl] 262 | 263 | '@rollup/rollup-linux-arm64-gnu@4.18.0': 264 | resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} 265 | cpu: [arm64] 266 | os: [linux] 267 | libc: [glibc] 268 | 269 | '@rollup/rollup-linux-arm64-musl@4.18.0': 270 | resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} 271 | cpu: [arm64] 272 | os: [linux] 273 | libc: [musl] 274 | 275 | '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': 276 | resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} 277 | cpu: [ppc64] 278 | os: [linux] 279 | libc: [glibc] 280 | 281 | '@rollup/rollup-linux-riscv64-gnu@4.18.0': 282 | resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} 283 | cpu: [riscv64] 284 | os: [linux] 285 | libc: [glibc] 286 | 287 | '@rollup/rollup-linux-s390x-gnu@4.18.0': 288 | resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} 289 | cpu: [s390x] 290 | os: [linux] 291 | libc: [glibc] 292 | 293 | '@rollup/rollup-linux-x64-gnu@4.18.0': 294 | resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} 295 | cpu: [x64] 296 | os: [linux] 297 | libc: [glibc] 298 | 299 | '@rollup/rollup-linux-x64-musl@4.18.0': 300 | resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} 301 | cpu: [x64] 302 | os: [linux] 303 | libc: [musl] 304 | 305 | '@rollup/rollup-win32-arm64-msvc@4.18.0': 306 | resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} 307 | cpu: [arm64] 308 | os: [win32] 309 | 310 | '@rollup/rollup-win32-ia32-msvc@4.18.0': 311 | resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} 312 | cpu: [ia32] 313 | os: [win32] 314 | 315 | '@rollup/rollup-win32-x64-msvc@4.18.0': 316 | resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} 317 | cpu: [x64] 318 | os: [win32] 319 | 320 | '@types/codemirror@0.0.97': 321 | resolution: {integrity: sha512-n5d7o9nWhC49DjfhsxANP7naWSeTzrjXASkUDQh7626sM4zK9XP2EVcHp1IcCf/IPV6c7ORzDUDF3Bkt231VKg==} 322 | 323 | '@types/estree@1.0.5': 324 | resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} 325 | 326 | '@types/lodash-es@4.17.12': 327 | resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} 328 | 329 | '@types/lodash@4.17.5': 330 | resolution: {integrity: sha512-MBIOHVZqVqgfro1euRDWX7OO0fBVUUMrN6Pwm8LQsz8cWhEpihlvR70ENj3f40j58TNxZaWv2ndSkInykNBBJw==} 331 | 332 | '@types/node@20.14.6': 333 | resolution: {integrity: sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==} 334 | 335 | '@types/resolve@0.0.8': 336 | resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==} 337 | 338 | '@types/tern@0.23.9': 339 | resolution: {integrity: sha512-ypzHFE/wBzh+BlH6rrBgS5I/Z7RD21pGhZ2rltb/+ZrVM1awdZwjx7hE5XfuYgHWk9uvV5HLZN3SloevCAp3Bw==} 340 | 341 | '@types/web-bluetooth@0.0.14': 342 | resolution: {integrity: sha512-5d2RhCard1nQUC3aHcq/gHzWYO6K0WJmAbjO7mQJgCQKtZpgXxv1rOM6O/dBDhDYYVutk1sciOgNSe+5YyfM8A==} 343 | 344 | '@vitejs/plugin-vue@5.0.5': 345 | resolution: {integrity: sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ==} 346 | engines: {node: ^18.0.0 || >=20.0.0} 347 | peerDependencies: 348 | vite: ^5.0.0 349 | vue: ^3.2.25 350 | 351 | '@volar/language-core@2.3.0': 352 | resolution: {integrity: sha512-pvhL24WUh3VDnv7Yw5N1sjhPtdx7q9g+Wl3tggmnkMcyK8GcCNElF2zHiKznryn0DiUGk+eez/p2qQhz+puuHw==} 353 | 354 | '@volar/source-map@2.3.0': 355 | resolution: {integrity: sha512-G/228aZjAOGhDjhlyZ++nDbKrS9uk+5DMaEstjvzglaAw7nqtDyhnQAsYzUg6BMP9BtwZ59RIw5HGePrutn00Q==} 356 | 357 | '@volar/typescript@2.3.0': 358 | resolution: {integrity: sha512-PtUwMM87WsKVeLJN33GSTUjBexlKfKgouWlOUIv7pjrOnTwhXHZNSmpc312xgXdTjQPpToK6KXSIcKu9sBQ5LQ==} 359 | 360 | '@vue/compiler-core@3.4.29': 361 | resolution: {integrity: sha512-TFKiRkKKsRCKvg/jTSSKK7mYLJEQdUiUfykbG49rubC9SfDyvT2JrzTReopWlz2MxqeLyxh9UZhvxEIBgAhtrg==} 362 | 363 | '@vue/compiler-dom@3.4.29': 364 | resolution: {integrity: sha512-A6+iZ2fKIEGnfPJejdB7b1FlJzgiD+Y/sxxKwJWg1EbJu6ZPgzaPQQ51ESGNv0CP6jm6Z7/pO6Ia8Ze6IKrX7w==} 365 | 366 | '@vue/compiler-sfc@3.4.29': 367 | resolution: {integrity: sha512-zygDcEtn8ZimDlrEQyLUovoWgKQic6aEQqRXce2WXBvSeHbEbcAsXyCk9oG33ZkyWH4sl9D3tkYc1idoOkdqZQ==} 368 | 369 | '@vue/compiler-ssr@3.4.29': 370 | resolution: {integrity: sha512-rFbwCmxJ16tDp3N8XCx5xSQzjhidYjXllvEcqX/lopkoznlNPz3jyy0WGJCyhAaVQK677WWFt3YO/WUEkMMUFQ==} 371 | 372 | '@vue/devtools-api@6.6.3': 373 | resolution: {integrity: sha512-0MiMsFma/HqA6g3KLKn+AGpL1kgKhFWszC9U29NfpWK5LE7bjeXxySWJrOJ77hBz+TBrBQ7o4QJqbPbqbs8rJw==} 374 | 375 | '@vue/language-core@2.0.21': 376 | resolution: {integrity: sha512-vjs6KwnCK++kIXT+eI63BGpJHfHNVJcUCr3RnvJsccT3vbJnZV5IhHR2puEkoOkIbDdp0Gqi1wEnv3hEd3WsxQ==} 377 | peerDependencies: 378 | typescript: '*' 379 | peerDependenciesMeta: 380 | typescript: 381 | optional: true 382 | 383 | '@vue/reactivity@3.4.29': 384 | resolution: {integrity: sha512-w8+KV+mb1a8ornnGQitnMdLfE0kXmteaxLdccm2XwdFxXst4q/Z7SEboCV5SqJNpZbKFeaRBBJBhW24aJyGINg==} 385 | 386 | '@vue/runtime-core@3.4.29': 387 | resolution: {integrity: sha512-s8fmX3YVR/Rk5ig0ic0NuzTNjK2M7iLuVSZyMmCzN/+Mjuqqif1JasCtEtmtoJWF32pAtUjyuT2ljNKNLeOmnQ==} 388 | 389 | '@vue/runtime-dom@3.4.29': 390 | resolution: {integrity: sha512-gI10atCrtOLf/2MPPMM+dpz3NGulo9ZZR9d1dWo4fYvm+xkfvRrw1ZmJ7mkWtiJVXSsdmPbcK1p5dZzOCKDN0g==} 391 | 392 | '@vue/server-renderer@3.4.29': 393 | resolution: {integrity: sha512-HMLCmPI2j/k8PVkSBysrA2RxcxC5DgBiCdj7n7H2QtR8bQQPqKAe8qoaxLcInzouBmzwJ+J0x20ygN/B5mYBng==} 394 | peerDependencies: 395 | vue: 3.4.29 396 | 397 | '@vue/shared@3.4.29': 398 | resolution: {integrity: sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA==} 399 | 400 | '@vueuse/core@8.9.4': 401 | resolution: {integrity: sha512-B/Mdj9TK1peFyWaPof+Zf/mP9XuGAngaJZBwPaXBvU3aCTZlx3ltlrFFFyMV4iGBwsjSCeUCgZrtkEj9dS2Y3Q==} 402 | peerDependencies: 403 | '@vue/composition-api': ^1.1.0 404 | vue: ^2.6.0 || ^3.2.0 405 | peerDependenciesMeta: 406 | '@vue/composition-api': 407 | optional: true 408 | vue: 409 | optional: true 410 | 411 | '@vueuse/metadata@8.9.4': 412 | resolution: {integrity: sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==} 413 | 414 | '@vueuse/shared@8.9.4': 415 | resolution: {integrity: sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==} 416 | peerDependencies: 417 | '@vue/composition-api': ^1.1.0 418 | vue: ^2.6.0 || ^3.2.0 419 | peerDependenciesMeta: 420 | '@vue/composition-api': 421 | optional: true 422 | vue: 423 | optional: true 424 | 425 | abbrev@1.1.1: 426 | resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} 427 | 428 | anymatch@3.1.3: 429 | resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} 430 | engines: {node: '>= 8'} 431 | 432 | argparse@2.0.1: 433 | resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} 434 | 435 | async-validator@4.2.5: 436 | resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} 437 | 438 | balanced-match@1.0.2: 439 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 440 | 441 | binary-extensions@2.3.0: 442 | resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} 443 | engines: {node: '>=8'} 444 | 445 | brace-expansion@2.0.1: 446 | resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} 447 | 448 | braces@3.0.3: 449 | resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} 450 | engines: {node: '>=8'} 451 | 452 | builtin-modules@3.3.0: 453 | resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} 454 | engines: {node: '>=6'} 455 | 456 | chokidar@3.6.0: 457 | resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} 458 | engines: {node: '>= 8.10.0'} 459 | 460 | clipboard-copy@4.0.1: 461 | resolution: {integrity: sha512-wOlqdqziE/NNTUJsfSgXmBMIrYmfd5V0HCGsR8uAKHcg+h9NENWINcfRjtWGU77wDHC8B8ijV4hMTGYbrKovng==} 462 | 463 | clipboard@2.0.11: 464 | resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==} 465 | 466 | codemirror@5.63.3: 467 | resolution: {integrity: sha512-1C+LELr+5grgJYqwZKqxrcbPsHFHapVaVAloBsFBASbpLnQqLw1U8yXJ3gT5D+rhxIiSpo+kTqN+hQ+9ialIXw==} 468 | 469 | commander@2.20.3: 470 | resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} 471 | 472 | commander@7.2.0: 473 | resolution: {integrity: sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==} 474 | engines: {node: '>= 10'} 475 | 476 | computeds@0.0.1: 477 | resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==} 478 | 479 | cssfilter@0.0.10: 480 | resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} 481 | 482 | csstype@3.1.3: 483 | resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} 484 | 485 | d3-array@1.2.4: 486 | resolution: {integrity: sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==} 487 | 488 | d3-array@3.2.4: 489 | resolution: {integrity: sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==} 490 | engines: {node: '>=12'} 491 | 492 | d3-axis@1.0.12: 493 | resolution: {integrity: sha512-ejINPfPSNdGFKEOAtnBtdkpr24c4d4jsei6Lg98mxf424ivoDP2956/5HDpIAtmHo85lqT4pruy+zEgvRUBqaQ==} 494 | 495 | d3-axis@3.0.0: 496 | resolution: {integrity: sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==} 497 | engines: {node: '>=12'} 498 | 499 | d3-brush@1.1.6: 500 | resolution: {integrity: sha512-7RW+w7HfMCPyZLifTz/UnJmI5kdkXtpCbombUSs8xniAyo0vIbrDzDwUJB6eJOgl9u5DQOt2TQlYumxzD1SvYA==} 501 | 502 | d3-brush@3.0.0: 503 | resolution: {integrity: sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==} 504 | engines: {node: '>=12'} 505 | 506 | d3-chord@1.0.6: 507 | resolution: {integrity: sha512-JXA2Dro1Fxw9rJe33Uv+Ckr5IrAa74TlfDEhE/jfLOaXegMQFQTAgAw9WnZL8+HxVBRXaRGCkrNU7pJeylRIuA==} 508 | 509 | d3-chord@3.0.1: 510 | resolution: {integrity: sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==} 511 | engines: {node: '>=12'} 512 | 513 | d3-collection@1.0.7: 514 | resolution: {integrity: sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==} 515 | 516 | d3-color@1.4.1: 517 | resolution: {integrity: sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==} 518 | 519 | d3-color@3.1.0: 520 | resolution: {integrity: sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==} 521 | engines: {node: '>=12'} 522 | 523 | d3-contour@1.3.2: 524 | resolution: {integrity: sha512-hoPp4K/rJCu0ladiH6zmJUEz6+u3lgR+GSm/QdM2BBvDraU39Vr7YdDCicJcxP1z8i9B/2dJLgDC1NcvlF8WCg==} 525 | 526 | d3-contour@4.0.2: 527 | resolution: {integrity: sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==} 528 | engines: {node: '>=12'} 529 | 530 | d3-delaunay@6.0.4: 531 | resolution: {integrity: sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==} 532 | engines: {node: '>=12'} 533 | 534 | d3-dispatch@1.0.6: 535 | resolution: {integrity: sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA==} 536 | 537 | d3-dispatch@3.0.1: 538 | resolution: {integrity: sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==} 539 | engines: {node: '>=12'} 540 | 541 | d3-drag@1.2.5: 542 | resolution: {integrity: sha512-rD1ohlkKQwMZYkQlYVCrSFxsWPzI97+W+PaEIBNTMxRuxz9RF0Hi5nJWHGVJ3Om9d2fRTe1yOBINJyy/ahV95w==} 543 | 544 | d3-drag@3.0.0: 545 | resolution: {integrity: sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==} 546 | engines: {node: '>=12'} 547 | 548 | d3-dsv@1.2.0: 549 | resolution: {integrity: sha512-9yVlqvZcSOMhCYzniHE7EVUws7Fa1zgw+/EAV2BxJoG3ME19V6BQFBwI855XQDsxyOuG7NibqRMTtiF/Qup46g==} 550 | hasBin: true 551 | 552 | d3-dsv@3.0.1: 553 | resolution: {integrity: sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==} 554 | engines: {node: '>=12'} 555 | hasBin: true 556 | 557 | d3-ease@1.0.7: 558 | resolution: {integrity: sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==} 559 | 560 | d3-ease@3.0.1: 561 | resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==} 562 | engines: {node: '>=12'} 563 | 564 | d3-fetch@1.2.0: 565 | resolution: {integrity: sha512-yC78NBVcd2zFAyR/HnUiBS7Lf6inSCoWcSxFfw8FYL7ydiqe80SazNwoffcqOfs95XaLo7yebsmQqDKSsXUtvA==} 566 | 567 | d3-fetch@3.0.1: 568 | resolution: {integrity: sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==} 569 | engines: {node: '>=12'} 570 | 571 | d3-force@1.2.1: 572 | resolution: {integrity: sha512-HHvehyaiUlVo5CxBJ0yF/xny4xoaxFxDnBXNvNcfW9adORGZfyNF1dj6DGLKyk4Yh3brP/1h3rnDzdIAwL08zg==} 573 | 574 | d3-force@3.0.0: 575 | resolution: {integrity: sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==} 576 | engines: {node: '>=12'} 577 | 578 | d3-format@1.4.5: 579 | resolution: {integrity: sha512-J0piedu6Z8iB6TbIGfZgDzfXxUFN3qQRMofy2oPdXzQibYGqPB/9iMcxr/TGalU+2RsyDO+U4f33id8tbnSRMQ==} 580 | 581 | d3-format@3.1.0: 582 | resolution: {integrity: sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==} 583 | engines: {node: '>=12'} 584 | 585 | d3-geo@1.12.1: 586 | resolution: {integrity: sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==} 587 | 588 | d3-geo@3.1.1: 589 | resolution: {integrity: sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==} 590 | engines: {node: '>=12'} 591 | 592 | d3-hierarchy@1.1.9: 593 | resolution: {integrity: sha512-j8tPxlqh1srJHAtxfvOUwKNYJkQuBFdM1+JAUfq6xqH5eAqf93L7oG1NVqDa4CpFZNvnNKtCYEUC8KY9yEn9lQ==} 594 | 595 | d3-hierarchy@3.1.2: 596 | resolution: {integrity: sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==} 597 | engines: {node: '>=12'} 598 | 599 | d3-interpolate@1.4.0: 600 | resolution: {integrity: sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==} 601 | 602 | d3-interpolate@3.0.1: 603 | resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==} 604 | engines: {node: '>=12'} 605 | 606 | d3-path@1.0.9: 607 | resolution: {integrity: sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==} 608 | 609 | d3-path@3.1.0: 610 | resolution: {integrity: sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==} 611 | engines: {node: '>=12'} 612 | 613 | d3-polygon@1.0.6: 614 | resolution: {integrity: sha512-k+RF7WvI08PC8reEoXa/w2nSg5AUMTi+peBD9cmFc+0ixHfbs4QmxxkarVal1IkVkgxVuk9JSHhJURHiyHKAuQ==} 615 | 616 | d3-polygon@3.0.1: 617 | resolution: {integrity: sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==} 618 | engines: {node: '>=12'} 619 | 620 | d3-quadtree@1.0.7: 621 | resolution: {integrity: sha512-RKPAeXnkC59IDGD0Wu5mANy0Q2V28L+fNe65pOCXVdVuTJS3WPKaJlFHer32Rbh9gIo9qMuJXio8ra4+YmIymA==} 622 | 623 | d3-quadtree@3.0.1: 624 | resolution: {integrity: sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==} 625 | engines: {node: '>=12'} 626 | 627 | d3-random@1.1.2: 628 | resolution: {integrity: sha512-6AK5BNpIFqP+cx/sreKzNjWbwZQCSUatxq+pPRmFIQaWuoD+NrbVWw7YWpHiXpCQ/NanKdtGDuB+VQcZDaEmYQ==} 629 | 630 | d3-random@3.0.1: 631 | resolution: {integrity: sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==} 632 | engines: {node: '>=12'} 633 | 634 | d3-scale-chromatic@1.5.0: 635 | resolution: {integrity: sha512-ACcL46DYImpRFMBcpk9HhtIyC7bTBR4fNOPxwVSl0LfulDAwyiHyPOTqcDG1+t5d4P9W7t/2NAuWu59aKko/cg==} 636 | 637 | d3-scale-chromatic@3.1.0: 638 | resolution: {integrity: sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==} 639 | engines: {node: '>=12'} 640 | 641 | d3-scale@2.2.2: 642 | resolution: {integrity: sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw==} 643 | 644 | d3-scale@4.0.2: 645 | resolution: {integrity: sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==} 646 | engines: {node: '>=12'} 647 | 648 | d3-selection@1.4.2: 649 | resolution: {integrity: sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==} 650 | 651 | d3-selection@3.0.0: 652 | resolution: {integrity: sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==} 653 | engines: {node: '>=12'} 654 | 655 | d3-shape@1.3.7: 656 | resolution: {integrity: sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==} 657 | 658 | d3-shape@3.2.0: 659 | resolution: {integrity: sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==} 660 | engines: {node: '>=12'} 661 | 662 | d3-time-format@2.3.0: 663 | resolution: {integrity: sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==} 664 | 665 | d3-time-format@4.1.0: 666 | resolution: {integrity: sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==} 667 | engines: {node: '>=12'} 668 | 669 | d3-time@1.1.0: 670 | resolution: {integrity: sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==} 671 | 672 | d3-time@3.1.0: 673 | resolution: {integrity: sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==} 674 | engines: {node: '>=12'} 675 | 676 | d3-timer@1.0.10: 677 | resolution: {integrity: sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==} 678 | 679 | d3-timer@3.0.1: 680 | resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==} 681 | engines: {node: '>=12'} 682 | 683 | d3-transition@1.3.2: 684 | resolution: {integrity: sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==} 685 | 686 | d3-transition@3.0.1: 687 | resolution: {integrity: sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==} 688 | engines: {node: '>=12'} 689 | peerDependencies: 690 | d3-selection: 2 - 3 691 | 692 | d3-voronoi@1.1.4: 693 | resolution: {integrity: sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==} 694 | 695 | d3-zoom@1.8.3: 696 | resolution: {integrity: sha512-VoLXTK4wvy1a0JpH2Il+F2CiOhVu7VRXWF5M/LroMIh3/zBAC3WAt7QoIvPibOavVo20hN6/37vwAsdBejLyKQ==} 697 | 698 | d3-zoom@3.0.0: 699 | resolution: {integrity: sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==} 700 | engines: {node: '>=12'} 701 | 702 | d3@5.16.0: 703 | resolution: {integrity: sha512-4PL5hHaHwX4m7Zr1UapXW23apo6pexCgdetdJ5kTmADpG/7T9Gkxw0M0tf/pjoB63ezCCm0u5UaFYy2aMt0Mcw==} 704 | 705 | d3@7.9.0: 706 | resolution: {integrity: sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==} 707 | engines: {node: '>=12'} 708 | 709 | dagre-d3@0.6.4: 710 | resolution: {integrity: sha512-e/6jXeCP7/ptlAM48clmX4xTZc5Ek6T6kagS7Oz2HrYSdqcLZFLqpAfh7ldbZRFfxCZVyh61NEPR08UQRVxJzQ==} 711 | 712 | dagre@0.8.5: 713 | resolution: {integrity: sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==} 714 | 715 | dayjs@1.11.11: 716 | resolution: {integrity: sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==} 717 | 718 | de-indent@1.0.2: 719 | resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} 720 | 721 | delaunator@5.0.1: 722 | resolution: {integrity: sha512-8nvh+XBe96aCESrGOqMp/84b13H9cdKbG5P2ejQCh4d4sK9RL4371qou9drQjMhvnPmhWl5hnmqbEE0fXr9Xnw==} 723 | 724 | delegate@3.2.0: 725 | resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==} 726 | 727 | devui-theme@0.0.1: 728 | resolution: {integrity: sha512-5nF6fChlsXKeAtvkaAF4bZ0NMiEAbzwqQ9XZQiNuM0RRFz5lW29nnbhfDCNPkmnw5ZyCVyXqYwVRBIZrwZHXrA==} 729 | 730 | devui-theme@0.0.7: 731 | resolution: {integrity: sha512-sJWnkqOvqqVyvqaqyXn3/F+SIlNuoPUGdxG6TyDXuzZSAigWMuQsz8v8JJYTKL2Ash1q8kAKfRT01SqZmvlByA==} 732 | 733 | diff2html@3.4.48: 734 | resolution: {integrity: sha512-1lzNSg0G0VPKZPTyi4knzV2nAWTXBy/QaWCKzDto6iEIlcuOJEG0li4bElJfpHNz+pBqPu4AcC1i9ZCo9KMUOg==} 735 | engines: {node: '>=12'} 736 | 737 | diff@5.1.0: 738 | resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} 739 | engines: {node: '>=0.3.1'} 740 | 741 | dompurify@2.3.6: 742 | resolution: {integrity: sha512-OFP2u/3T1R5CEgWCEONuJ1a5+MFKnOYpkywpUSxv/dj1LeBT1erK+JwM7zK0ROy2BRhqVCf0LRw/kHqKuMkVGg==} 743 | 744 | echarts@5.3.3: 745 | resolution: {integrity: sha512-BRw2serInRwO5SIwRviZ6Xgm5Lb7irgz+sLiFMmy/HOaf4SQ+7oYqxKzRHAKp4xHQ05AuHw1xvoQWJjDQq/FGw==} 746 | 747 | entities@2.1.0: 748 | resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==} 749 | 750 | entities@4.5.0: 751 | resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} 752 | engines: {node: '>=0.12'} 753 | 754 | esbuild@0.21.5: 755 | resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} 756 | engines: {node: '>=12'} 757 | hasBin: true 758 | 759 | estree-walker@0.6.1: 760 | resolution: {integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==} 761 | 762 | estree-walker@2.0.2: 763 | resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} 764 | 765 | fill-range@7.1.1: 766 | resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} 767 | engines: {node: '>=8'} 768 | 769 | fs-extra@10.1.0: 770 | resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} 771 | engines: {node: '>=12'} 772 | 773 | fsevents@2.3.3: 774 | resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} 775 | engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} 776 | os: [darwin] 777 | 778 | function-bind@1.1.2: 779 | resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} 780 | 781 | glob-parent@5.1.2: 782 | resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} 783 | engines: {node: '>= 6'} 784 | 785 | good-listener@1.2.2: 786 | resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} 787 | 788 | graceful-fs@4.2.11: 789 | resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} 790 | 791 | graphlib@2.1.8: 792 | resolution: {integrity: sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==} 793 | 794 | hasown@2.0.2: 795 | resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} 796 | engines: {node: '>= 0.4'} 797 | 798 | he@1.2.0: 799 | resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} 800 | hasBin: true 801 | 802 | highlight.js@11.9.0: 803 | resolution: {integrity: sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==} 804 | engines: {node: '>=12.0.0'} 805 | 806 | hogan.js@3.0.2: 807 | resolution: {integrity: sha512-RqGs4wavGYJWE07t35JQccByczmNUXQT0E12ZYV1VKYu5UiAU9lsos/yBAcf840+zrUQQxgVduCR5/B8nNtibg==} 808 | hasBin: true 809 | 810 | iconv-lite@0.4.24: 811 | resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} 812 | engines: {node: '>=0.10.0'} 813 | 814 | iconv-lite@0.6.3: 815 | resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} 816 | engines: {node: '>=0.10.0'} 817 | 818 | immutable@4.3.6: 819 | resolution: {integrity: sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==} 820 | 821 | internmap@2.0.3: 822 | resolution: {integrity: sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==} 823 | engines: {node: '>=12'} 824 | 825 | is-binary-path@2.1.0: 826 | resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} 827 | engines: {node: '>=8'} 828 | 829 | is-core-module@2.13.1: 830 | resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} 831 | 832 | is-extglob@2.1.1: 833 | resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 834 | engines: {node: '>=0.10.0'} 835 | 836 | is-glob@4.0.3: 837 | resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} 838 | engines: {node: '>=0.10.0'} 839 | 840 | is-module@1.0.0: 841 | resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} 842 | 843 | is-number@7.0.0: 844 | resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} 845 | engines: {node: '>=0.12.0'} 846 | 847 | jsonfile@6.1.0: 848 | resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} 849 | 850 | katex@0.12.0: 851 | resolution: {integrity: sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==} 852 | hasBin: true 853 | 854 | khroma@2.1.0: 855 | resolution: {integrity: sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw==} 856 | 857 | linkify-it@3.0.3: 858 | resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} 859 | 860 | lodash-es@4.17.21: 861 | resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} 862 | 863 | lodash@4.17.21: 864 | resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} 865 | 866 | magic-string@0.30.10: 867 | resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} 868 | 869 | markdown-it-emoji@3.0.0: 870 | resolution: {integrity: sha512-+rUD93bXHubA4arpEZO3q80so0qgoFJEKRkRbjKX8RTdca89v2kfyF+xR3i2sQTwql9tpPZPOQN5B+PunspXRg==} 871 | 872 | markdown-it-plantuml@1.4.1: 873 | resolution: {integrity: sha512-13KgnZaGYTHBp4iUmGofzZSBz+Zj6cyqfR0SXUIc9wgWTto5Xhn7NjaXYxY0z7uBeTUMlc9LMQq5uP4OM5xCHg==} 874 | 875 | markdown-it@12.2.0: 876 | resolution: {integrity: sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg==} 877 | hasBin: true 878 | 879 | mdurl@1.0.1: 880 | resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} 881 | 882 | mermaid@9.1.1: 883 | resolution: {integrity: sha512-2RVD+WkzZ4VDyO9gQvQAuQ/ux2gLigJtKDTlbwjYqOR/NwsVzTSfGm/kx648/qWJsg6Sv04tE9BWCO8s6a+pFA==} 884 | 885 | minimatch@9.0.4: 886 | resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} 887 | engines: {node: '>=16 || 14 >=14.17'} 888 | 889 | mitt@3.0.1: 890 | resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} 891 | 892 | mkdirp@0.3.0: 893 | resolution: {integrity: sha512-OHsdUcVAQ6pOtg5JYWpCBo9W/GySVuwvP9hueRMW7UqshC0tbfzLv8wjySTPm3tfUZ/21CE9E1pJagOA91Pxew==} 894 | deprecated: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.) 895 | 896 | moment-mini@2.29.4: 897 | resolution: {integrity: sha512-uhXpYwHFeiTbY9KSgPPRoo1nt8OxNVdMVoTBYHfSEKeRkIkwGpO+gERmhuhBtzfaeOyTkykSrm2+noJBgqt3Hg==} 898 | 899 | monaco-editor@0.34.0: 900 | resolution: {integrity: sha512-VF+S5zG8wxfinLKLrWcl4WUizMx+LeJrG4PM/M78OhcwocpV0jiyhX/pG6Q9jIOhrb/ckYi6nHnaR5OojlOZCQ==} 901 | 902 | monaco-editor@0.50.0: 903 | resolution: {integrity: sha512-8CclLCmrRRh+sul7C08BmPBP3P8wVWfBHomsTcndxg5NRCEPfu/mc2AGU8k37ajjDVXcXFc12ORAMUkmk+lkFA==} 904 | 905 | muggle-string@0.4.1: 906 | resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} 907 | 908 | nanoid@3.3.7: 909 | resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} 910 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 911 | hasBin: true 912 | 913 | nopt@1.0.10: 914 | resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} 915 | hasBin: true 916 | 917 | normalize-path@3.0.0: 918 | resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} 919 | engines: {node: '>=0.10.0'} 920 | 921 | path-browserify@1.0.1: 922 | resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} 923 | 924 | path-parse@1.0.7: 925 | resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} 926 | 927 | picocolors@1.0.1: 928 | resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} 929 | 930 | picomatch@2.3.1: 931 | resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} 932 | engines: {node: '>=8.6'} 933 | 934 | postcss@8.4.38: 935 | resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} 936 | engines: {node: ^10 || ^12 || >=14} 937 | 938 | readdirp@3.6.0: 939 | resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} 940 | engines: {node: '>=8.10.0'} 941 | 942 | resolve@1.22.8: 943 | resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} 944 | hasBin: true 945 | 946 | robust-predicates@3.0.2: 947 | resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} 948 | 949 | rollup-plugin-node-resolve@5.2.0: 950 | resolution: {integrity: sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw==} 951 | deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve. 952 | peerDependencies: 953 | rollup: '>=1.11.0' 954 | 955 | rollup-pluginutils@2.8.2: 956 | resolution: {integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==} 957 | 958 | rollup@4.18.0: 959 | resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} 960 | engines: {node: '>=18.0.0', npm: '>=8.0.0'} 961 | hasBin: true 962 | 963 | rw@1.3.3: 964 | resolution: {integrity: sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==} 965 | 966 | rxjs@7.8.1: 967 | resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} 968 | 969 | safer-buffer@2.1.2: 970 | resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} 971 | 972 | sass@1.77.6: 973 | resolution: {integrity: sha512-ByXE1oLD79GVq9Ht1PeHWCPMPB8XHpBuz1r85oByKHjZY6qV6rWnQovQzXJXuQ/XyE1Oj3iPk3lo28uzaRA2/Q==} 974 | engines: {node: '>=14.0.0'} 975 | hasBin: true 976 | 977 | select@1.1.2: 978 | resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} 979 | 980 | semver@7.6.2: 981 | resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} 982 | engines: {node: '>=10'} 983 | hasBin: true 984 | 985 | source-map-js@1.2.0: 986 | resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} 987 | engines: {node: '>=0.10.0'} 988 | 989 | stylis@4.3.2: 990 | resolution: {integrity: sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==} 991 | 992 | supports-preserve-symlinks-flag@1.0.0: 993 | resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} 994 | engines: {node: '>= 0.4'} 995 | 996 | tiny-emitter@2.1.0: 997 | resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} 998 | 999 | to-fast-properties@2.0.0: 1000 | resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} 1001 | engines: {node: '>=4'} 1002 | 1003 | to-regex-range@5.0.1: 1004 | resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 1005 | engines: {node: '>=8.0'} 1006 | 1007 | tslib@2.3.0: 1008 | resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} 1009 | 1010 | tslib@2.6.3: 1011 | resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} 1012 | 1013 | typescript@5.4.5: 1014 | resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} 1015 | engines: {node: '>=14.17'} 1016 | hasBin: true 1017 | 1018 | uc.micro@1.0.6: 1019 | resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} 1020 | 1021 | undici-types@5.26.5: 1022 | resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} 1023 | 1024 | universalify@2.0.1: 1025 | resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} 1026 | engines: {node: '>= 10.0.0'} 1027 | 1028 | uuid@9.0.1: 1029 | resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} 1030 | hasBin: true 1031 | 1032 | vite@5.3.1: 1033 | resolution: {integrity: sha512-XBmSKRLXLxiaPYamLv3/hnP/KXDai1NDexN0FpkTaZXTfycHvkRHoenpgl/fvuK/kPbB6xAgoyiryAhQNxYmAQ==} 1034 | engines: {node: ^18.0.0 || >=20.0.0} 1035 | hasBin: true 1036 | peerDependencies: 1037 | '@types/node': ^18.0.0 || >=20.0.0 1038 | less: '*' 1039 | lightningcss: ^1.21.0 1040 | sass: '*' 1041 | stylus: '*' 1042 | sugarss: '*' 1043 | terser: ^5.4.0 1044 | peerDependenciesMeta: 1045 | '@types/node': 1046 | optional: true 1047 | less: 1048 | optional: true 1049 | lightningcss: 1050 | optional: true 1051 | sass: 1052 | optional: true 1053 | stylus: 1054 | optional: true 1055 | sugarss: 1056 | optional: true 1057 | terser: 1058 | optional: true 1059 | 1060 | vscode-uri@3.0.8: 1061 | resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} 1062 | 1063 | vue-demi@0.14.8: 1064 | resolution: {integrity: sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==} 1065 | engines: {node: '>=12'} 1066 | hasBin: true 1067 | peerDependencies: 1068 | '@vue/composition-api': ^1.0.0-rc.1 1069 | vue: ^3.0.0-0 || ^2.6.0 1070 | peerDependenciesMeta: 1071 | '@vue/composition-api': 1072 | optional: true 1073 | 1074 | vue-devui@1.6.20: 1075 | resolution: {integrity: sha512-lDxWRqT/u5WfdXsjjUbJMqgHfApNABOPZXsq0hUhdWvtU5LSTidXB1WXPntnvGlYlVWrqyHfvieW8imCnjDhJQ==} 1076 | peerDependencies: 1077 | vue: ^3.3 1078 | 1079 | vue-router@4.3.3: 1080 | resolution: {integrity: sha512-8Q+u+WP4N2SXY38FDcF2H1dUEbYVHVPtPCPZj/GTZx8RCbiB8AtJP9+YIxn4Vs0svMTNQcLIzka4GH7Utkx9xQ==} 1081 | peerDependencies: 1082 | vue: ^3.2.0 1083 | 1084 | vue-template-compiler@2.7.16: 1085 | resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} 1086 | 1087 | vue-tsc@2.0.21: 1088 | resolution: {integrity: sha512-E6x1p1HaHES6Doy8pqtm7kQern79zRtIewkf9fiv7Y43Zo4AFDS5hKi+iHi2RwEhqRmuiwliB1LCEFEGwvxQnw==} 1089 | hasBin: true 1090 | peerDependencies: 1091 | typescript: '*' 1092 | 1093 | vue@3.4.29: 1094 | resolution: {integrity: sha512-8QUYfRcYzNlYuzKPfge1UWC6nF9ym0lx7mpGVPJYNhddxEf3DD0+kU07NTL0sXuiT2HuJuKr/iEO8WvXvT0RSQ==} 1095 | peerDependencies: 1096 | typescript: '*' 1097 | peerDependenciesMeta: 1098 | typescript: 1099 | optional: true 1100 | 1101 | xss@1.0.15: 1102 | resolution: {integrity: sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==} 1103 | engines: {node: '>= 0.10.0'} 1104 | hasBin: true 1105 | 1106 | zrender@5.3.2: 1107 | resolution: {integrity: sha512-8IiYdfwHj2rx0UeIGZGGU4WEVSDEdeVCaIg/fomejg1Xu6OifAL1GVzIPHg2D+MyUkbNgPWji90t0a8IDk+39w==} 1108 | 1109 | snapshots: 1110 | 1111 | '@babel/helper-hoist-variables@7.24.7': 1112 | dependencies: 1113 | '@babel/types': 7.24.7 1114 | 1115 | '@babel/helper-string-parser@7.24.7': {} 1116 | 1117 | '@babel/helper-validator-identifier@7.24.7': {} 1118 | 1119 | '@babel/parser@7.24.7': 1120 | dependencies: 1121 | '@babel/types': 7.24.7 1122 | 1123 | '@babel/types@7.24.7': 1124 | dependencies: 1125 | '@babel/helper-string-parser': 7.24.7 1126 | '@babel/helper-validator-identifier': 7.24.7 1127 | to-fast-properties: 2.0.0 1128 | 1129 | '@braintree/sanitize-url@6.0.4': {} 1130 | 1131 | '@devui-design/icons@1.4.0': {} 1132 | 1133 | '@esbuild/aix-ppc64@0.21.5': 1134 | optional: true 1135 | 1136 | '@esbuild/android-arm64@0.21.5': 1137 | optional: true 1138 | 1139 | '@esbuild/android-arm@0.21.5': 1140 | optional: true 1141 | 1142 | '@esbuild/android-x64@0.21.5': 1143 | optional: true 1144 | 1145 | '@esbuild/darwin-arm64@0.21.5': 1146 | optional: true 1147 | 1148 | '@esbuild/darwin-x64@0.21.5': 1149 | optional: true 1150 | 1151 | '@esbuild/freebsd-arm64@0.21.5': 1152 | optional: true 1153 | 1154 | '@esbuild/freebsd-x64@0.21.5': 1155 | optional: true 1156 | 1157 | '@esbuild/linux-arm64@0.21.5': 1158 | optional: true 1159 | 1160 | '@esbuild/linux-arm@0.21.5': 1161 | optional: true 1162 | 1163 | '@esbuild/linux-ia32@0.21.5': 1164 | optional: true 1165 | 1166 | '@esbuild/linux-loong64@0.21.5': 1167 | optional: true 1168 | 1169 | '@esbuild/linux-mips64el@0.21.5': 1170 | optional: true 1171 | 1172 | '@esbuild/linux-ppc64@0.21.5': 1173 | optional: true 1174 | 1175 | '@esbuild/linux-riscv64@0.21.5': 1176 | optional: true 1177 | 1178 | '@esbuild/linux-s390x@0.21.5': 1179 | optional: true 1180 | 1181 | '@esbuild/linux-x64@0.21.5': 1182 | optional: true 1183 | 1184 | '@esbuild/netbsd-x64@0.21.5': 1185 | optional: true 1186 | 1187 | '@esbuild/openbsd-x64@0.21.5': 1188 | optional: true 1189 | 1190 | '@esbuild/sunos-x64@0.21.5': 1191 | optional: true 1192 | 1193 | '@esbuild/win32-arm64@0.21.5': 1194 | optional: true 1195 | 1196 | '@esbuild/win32-ia32@0.21.5': 1197 | optional: true 1198 | 1199 | '@esbuild/win32-x64@0.21.5': 1200 | optional: true 1201 | 1202 | '@floating-ui/core@1.6.2': 1203 | dependencies: 1204 | '@floating-ui/utils': 0.2.2 1205 | 1206 | '@floating-ui/dom@1.2.5': 1207 | dependencies: 1208 | '@floating-ui/core': 1.6.2 1209 | 1210 | '@floating-ui/utils@0.2.2': {} 1211 | 1212 | '@iktakahiro/markdown-it-katex@4.0.1': 1213 | dependencies: 1214 | katex: 0.12.0 1215 | 1216 | '@jridgewell/sourcemap-codec@1.4.15': {} 1217 | 1218 | '@rollup/rollup-android-arm-eabi@4.18.0': 1219 | optional: true 1220 | 1221 | '@rollup/rollup-android-arm64@4.18.0': 1222 | optional: true 1223 | 1224 | '@rollup/rollup-darwin-arm64@4.18.0': 1225 | optional: true 1226 | 1227 | '@rollup/rollup-darwin-x64@4.18.0': 1228 | optional: true 1229 | 1230 | '@rollup/rollup-linux-arm-gnueabihf@4.18.0': 1231 | optional: true 1232 | 1233 | '@rollup/rollup-linux-arm-musleabihf@4.18.0': 1234 | optional: true 1235 | 1236 | '@rollup/rollup-linux-arm64-gnu@4.18.0': 1237 | optional: true 1238 | 1239 | '@rollup/rollup-linux-arm64-musl@4.18.0': 1240 | optional: true 1241 | 1242 | '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': 1243 | optional: true 1244 | 1245 | '@rollup/rollup-linux-riscv64-gnu@4.18.0': 1246 | optional: true 1247 | 1248 | '@rollup/rollup-linux-s390x-gnu@4.18.0': 1249 | optional: true 1250 | 1251 | '@rollup/rollup-linux-x64-gnu@4.18.0': 1252 | optional: true 1253 | 1254 | '@rollup/rollup-linux-x64-musl@4.18.0': 1255 | optional: true 1256 | 1257 | '@rollup/rollup-win32-arm64-msvc@4.18.0': 1258 | optional: true 1259 | 1260 | '@rollup/rollup-win32-ia32-msvc@4.18.0': 1261 | optional: true 1262 | 1263 | '@rollup/rollup-win32-x64-msvc@4.18.0': 1264 | optional: true 1265 | 1266 | '@types/codemirror@0.0.97': 1267 | dependencies: 1268 | '@types/tern': 0.23.9 1269 | 1270 | '@types/estree@1.0.5': {} 1271 | 1272 | '@types/lodash-es@4.17.12': 1273 | dependencies: 1274 | '@types/lodash': 4.17.5 1275 | 1276 | '@types/lodash@4.17.5': {} 1277 | 1278 | '@types/node@20.14.6': 1279 | dependencies: 1280 | undici-types: 5.26.5 1281 | 1282 | '@types/resolve@0.0.8': 1283 | dependencies: 1284 | '@types/node': 20.14.6 1285 | 1286 | '@types/tern@0.23.9': 1287 | dependencies: 1288 | '@types/estree': 1.0.5 1289 | 1290 | '@types/web-bluetooth@0.0.14': {} 1291 | 1292 | '@vitejs/plugin-vue@5.0.5(vite@5.3.1(@types/node@20.14.6)(sass@1.77.6))(vue@3.4.29(typescript@5.4.5))': 1293 | dependencies: 1294 | vite: 5.3.1(@types/node@20.14.6)(sass@1.77.6) 1295 | vue: 3.4.29(typescript@5.4.5) 1296 | 1297 | '@volar/language-core@2.3.0': 1298 | dependencies: 1299 | '@volar/source-map': 2.3.0 1300 | 1301 | '@volar/source-map@2.3.0': 1302 | dependencies: 1303 | muggle-string: 0.4.1 1304 | 1305 | '@volar/typescript@2.3.0': 1306 | dependencies: 1307 | '@volar/language-core': 2.3.0 1308 | path-browserify: 1.0.1 1309 | vscode-uri: 3.0.8 1310 | 1311 | '@vue/compiler-core@3.4.29': 1312 | dependencies: 1313 | '@babel/parser': 7.24.7 1314 | '@vue/shared': 3.4.29 1315 | entities: 4.5.0 1316 | estree-walker: 2.0.2 1317 | source-map-js: 1.2.0 1318 | 1319 | '@vue/compiler-dom@3.4.29': 1320 | dependencies: 1321 | '@vue/compiler-core': 3.4.29 1322 | '@vue/shared': 3.4.29 1323 | 1324 | '@vue/compiler-sfc@3.4.29': 1325 | dependencies: 1326 | '@babel/parser': 7.24.7 1327 | '@vue/compiler-core': 3.4.29 1328 | '@vue/compiler-dom': 3.4.29 1329 | '@vue/compiler-ssr': 3.4.29 1330 | '@vue/shared': 3.4.29 1331 | estree-walker: 2.0.2 1332 | magic-string: 0.30.10 1333 | postcss: 8.4.38 1334 | source-map-js: 1.2.0 1335 | 1336 | '@vue/compiler-ssr@3.4.29': 1337 | dependencies: 1338 | '@vue/compiler-dom': 3.4.29 1339 | '@vue/shared': 3.4.29 1340 | 1341 | '@vue/devtools-api@6.6.3': {} 1342 | 1343 | '@vue/language-core@2.0.21(typescript@5.4.5)': 1344 | dependencies: 1345 | '@volar/language-core': 2.3.0 1346 | '@vue/compiler-dom': 3.4.29 1347 | '@vue/shared': 3.4.29 1348 | computeds: 0.0.1 1349 | minimatch: 9.0.4 1350 | path-browserify: 1.0.1 1351 | vue-template-compiler: 2.7.16 1352 | optionalDependencies: 1353 | typescript: 5.4.5 1354 | 1355 | '@vue/reactivity@3.4.29': 1356 | dependencies: 1357 | '@vue/shared': 3.4.29 1358 | 1359 | '@vue/runtime-core@3.4.29': 1360 | dependencies: 1361 | '@vue/reactivity': 3.4.29 1362 | '@vue/shared': 3.4.29 1363 | 1364 | '@vue/runtime-dom@3.4.29': 1365 | dependencies: 1366 | '@vue/reactivity': 3.4.29 1367 | '@vue/runtime-core': 3.4.29 1368 | '@vue/shared': 3.4.29 1369 | csstype: 3.1.3 1370 | 1371 | '@vue/server-renderer@3.4.29(vue@3.4.29(typescript@5.4.5))': 1372 | dependencies: 1373 | '@vue/compiler-ssr': 3.4.29 1374 | '@vue/shared': 3.4.29 1375 | vue: 3.4.29(typescript@5.4.5) 1376 | 1377 | '@vue/shared@3.4.29': {} 1378 | 1379 | '@vueuse/core@8.9.4(vue@3.4.29(typescript@5.4.5))': 1380 | dependencies: 1381 | '@types/web-bluetooth': 0.0.14 1382 | '@vueuse/metadata': 8.9.4 1383 | '@vueuse/shared': 8.9.4(vue@3.4.29(typescript@5.4.5)) 1384 | vue-demi: 0.14.8(vue@3.4.29(typescript@5.4.5)) 1385 | optionalDependencies: 1386 | vue: 3.4.29(typescript@5.4.5) 1387 | 1388 | '@vueuse/metadata@8.9.4': {} 1389 | 1390 | '@vueuse/shared@8.9.4(vue@3.4.29(typescript@5.4.5))': 1391 | dependencies: 1392 | vue-demi: 0.14.8(vue@3.4.29(typescript@5.4.5)) 1393 | optionalDependencies: 1394 | vue: 3.4.29(typescript@5.4.5) 1395 | 1396 | abbrev@1.1.1: {} 1397 | 1398 | anymatch@3.1.3: 1399 | dependencies: 1400 | normalize-path: 3.0.0 1401 | picomatch: 2.3.1 1402 | 1403 | argparse@2.0.1: {} 1404 | 1405 | async-validator@4.2.5: {} 1406 | 1407 | balanced-match@1.0.2: {} 1408 | 1409 | binary-extensions@2.3.0: {} 1410 | 1411 | brace-expansion@2.0.1: 1412 | dependencies: 1413 | balanced-match: 1.0.2 1414 | 1415 | braces@3.0.3: 1416 | dependencies: 1417 | fill-range: 7.1.1 1418 | 1419 | builtin-modules@3.3.0: {} 1420 | 1421 | chokidar@3.6.0: 1422 | dependencies: 1423 | anymatch: 3.1.3 1424 | braces: 3.0.3 1425 | glob-parent: 5.1.2 1426 | is-binary-path: 2.1.0 1427 | is-glob: 4.0.3 1428 | normalize-path: 3.0.0 1429 | readdirp: 3.6.0 1430 | optionalDependencies: 1431 | fsevents: 2.3.3 1432 | 1433 | clipboard-copy@4.0.1: {} 1434 | 1435 | clipboard@2.0.11: 1436 | dependencies: 1437 | good-listener: 1.2.2 1438 | select: 1.1.2 1439 | tiny-emitter: 2.1.0 1440 | 1441 | codemirror@5.63.3: {} 1442 | 1443 | commander@2.20.3: {} 1444 | 1445 | commander@7.2.0: {} 1446 | 1447 | computeds@0.0.1: {} 1448 | 1449 | cssfilter@0.0.10: {} 1450 | 1451 | csstype@3.1.3: {} 1452 | 1453 | d3-array@1.2.4: {} 1454 | 1455 | d3-array@3.2.4: 1456 | dependencies: 1457 | internmap: 2.0.3 1458 | 1459 | d3-axis@1.0.12: {} 1460 | 1461 | d3-axis@3.0.0: {} 1462 | 1463 | d3-brush@1.1.6: 1464 | dependencies: 1465 | d3-dispatch: 1.0.6 1466 | d3-drag: 1.2.5 1467 | d3-interpolate: 1.4.0 1468 | d3-selection: 1.4.2 1469 | d3-transition: 1.3.2 1470 | 1471 | d3-brush@3.0.0: 1472 | dependencies: 1473 | d3-dispatch: 3.0.1 1474 | d3-drag: 3.0.0 1475 | d3-interpolate: 3.0.1 1476 | d3-selection: 3.0.0 1477 | d3-transition: 3.0.1(d3-selection@3.0.0) 1478 | 1479 | d3-chord@1.0.6: 1480 | dependencies: 1481 | d3-array: 1.2.4 1482 | d3-path: 1.0.9 1483 | 1484 | d3-chord@3.0.1: 1485 | dependencies: 1486 | d3-path: 3.1.0 1487 | 1488 | d3-collection@1.0.7: {} 1489 | 1490 | d3-color@1.4.1: {} 1491 | 1492 | d3-color@3.1.0: {} 1493 | 1494 | d3-contour@1.3.2: 1495 | dependencies: 1496 | d3-array: 1.2.4 1497 | 1498 | d3-contour@4.0.2: 1499 | dependencies: 1500 | d3-array: 3.2.4 1501 | 1502 | d3-delaunay@6.0.4: 1503 | dependencies: 1504 | delaunator: 5.0.1 1505 | 1506 | d3-dispatch@1.0.6: {} 1507 | 1508 | d3-dispatch@3.0.1: {} 1509 | 1510 | d3-drag@1.2.5: 1511 | dependencies: 1512 | d3-dispatch: 1.0.6 1513 | d3-selection: 1.4.2 1514 | 1515 | d3-drag@3.0.0: 1516 | dependencies: 1517 | d3-dispatch: 3.0.1 1518 | d3-selection: 3.0.0 1519 | 1520 | d3-dsv@1.2.0: 1521 | dependencies: 1522 | commander: 2.20.3 1523 | iconv-lite: 0.4.24 1524 | rw: 1.3.3 1525 | 1526 | d3-dsv@3.0.1: 1527 | dependencies: 1528 | commander: 7.2.0 1529 | iconv-lite: 0.6.3 1530 | rw: 1.3.3 1531 | 1532 | d3-ease@1.0.7: {} 1533 | 1534 | d3-ease@3.0.1: {} 1535 | 1536 | d3-fetch@1.2.0: 1537 | dependencies: 1538 | d3-dsv: 1.2.0 1539 | 1540 | d3-fetch@3.0.1: 1541 | dependencies: 1542 | d3-dsv: 3.0.1 1543 | 1544 | d3-force@1.2.1: 1545 | dependencies: 1546 | d3-collection: 1.0.7 1547 | d3-dispatch: 1.0.6 1548 | d3-quadtree: 1.0.7 1549 | d3-timer: 1.0.10 1550 | 1551 | d3-force@3.0.0: 1552 | dependencies: 1553 | d3-dispatch: 3.0.1 1554 | d3-quadtree: 3.0.1 1555 | d3-timer: 3.0.1 1556 | 1557 | d3-format@1.4.5: {} 1558 | 1559 | d3-format@3.1.0: {} 1560 | 1561 | d3-geo@1.12.1: 1562 | dependencies: 1563 | d3-array: 1.2.4 1564 | 1565 | d3-geo@3.1.1: 1566 | dependencies: 1567 | d3-array: 3.2.4 1568 | 1569 | d3-hierarchy@1.1.9: {} 1570 | 1571 | d3-hierarchy@3.1.2: {} 1572 | 1573 | d3-interpolate@1.4.0: 1574 | dependencies: 1575 | d3-color: 1.4.1 1576 | 1577 | d3-interpolate@3.0.1: 1578 | dependencies: 1579 | d3-color: 3.1.0 1580 | 1581 | d3-path@1.0.9: {} 1582 | 1583 | d3-path@3.1.0: {} 1584 | 1585 | d3-polygon@1.0.6: {} 1586 | 1587 | d3-polygon@3.0.1: {} 1588 | 1589 | d3-quadtree@1.0.7: {} 1590 | 1591 | d3-quadtree@3.0.1: {} 1592 | 1593 | d3-random@1.1.2: {} 1594 | 1595 | d3-random@3.0.1: {} 1596 | 1597 | d3-scale-chromatic@1.5.0: 1598 | dependencies: 1599 | d3-color: 1.4.1 1600 | d3-interpolate: 1.4.0 1601 | 1602 | d3-scale-chromatic@3.1.0: 1603 | dependencies: 1604 | d3-color: 3.1.0 1605 | d3-interpolate: 3.0.1 1606 | 1607 | d3-scale@2.2.2: 1608 | dependencies: 1609 | d3-array: 1.2.4 1610 | d3-collection: 1.0.7 1611 | d3-format: 1.4.5 1612 | d3-interpolate: 1.4.0 1613 | d3-time: 1.1.0 1614 | d3-time-format: 2.3.0 1615 | 1616 | d3-scale@4.0.2: 1617 | dependencies: 1618 | d3-array: 3.2.4 1619 | d3-format: 3.1.0 1620 | d3-interpolate: 3.0.1 1621 | d3-time: 3.1.0 1622 | d3-time-format: 4.1.0 1623 | 1624 | d3-selection@1.4.2: {} 1625 | 1626 | d3-selection@3.0.0: {} 1627 | 1628 | d3-shape@1.3.7: 1629 | dependencies: 1630 | d3-path: 1.0.9 1631 | 1632 | d3-shape@3.2.0: 1633 | dependencies: 1634 | d3-path: 3.1.0 1635 | 1636 | d3-time-format@2.3.0: 1637 | dependencies: 1638 | d3-time: 1.1.0 1639 | 1640 | d3-time-format@4.1.0: 1641 | dependencies: 1642 | d3-time: 3.1.0 1643 | 1644 | d3-time@1.1.0: {} 1645 | 1646 | d3-time@3.1.0: 1647 | dependencies: 1648 | d3-array: 3.2.4 1649 | 1650 | d3-timer@1.0.10: {} 1651 | 1652 | d3-timer@3.0.1: {} 1653 | 1654 | d3-transition@1.3.2: 1655 | dependencies: 1656 | d3-color: 1.4.1 1657 | d3-dispatch: 1.0.6 1658 | d3-ease: 1.0.7 1659 | d3-interpolate: 1.4.0 1660 | d3-selection: 1.4.2 1661 | d3-timer: 1.0.10 1662 | 1663 | d3-transition@3.0.1(d3-selection@3.0.0): 1664 | dependencies: 1665 | d3-color: 3.1.0 1666 | d3-dispatch: 3.0.1 1667 | d3-ease: 3.0.1 1668 | d3-interpolate: 3.0.1 1669 | d3-selection: 3.0.0 1670 | d3-timer: 3.0.1 1671 | 1672 | d3-voronoi@1.1.4: {} 1673 | 1674 | d3-zoom@1.8.3: 1675 | dependencies: 1676 | d3-dispatch: 1.0.6 1677 | d3-drag: 1.2.5 1678 | d3-interpolate: 1.4.0 1679 | d3-selection: 1.4.2 1680 | d3-transition: 1.3.2 1681 | 1682 | d3-zoom@3.0.0: 1683 | dependencies: 1684 | d3-dispatch: 3.0.1 1685 | d3-drag: 3.0.0 1686 | d3-interpolate: 3.0.1 1687 | d3-selection: 3.0.0 1688 | d3-transition: 3.0.1(d3-selection@3.0.0) 1689 | 1690 | d3@5.16.0: 1691 | dependencies: 1692 | d3-array: 1.2.4 1693 | d3-axis: 1.0.12 1694 | d3-brush: 1.1.6 1695 | d3-chord: 1.0.6 1696 | d3-collection: 1.0.7 1697 | d3-color: 1.4.1 1698 | d3-contour: 1.3.2 1699 | d3-dispatch: 1.0.6 1700 | d3-drag: 1.2.5 1701 | d3-dsv: 1.2.0 1702 | d3-ease: 1.0.7 1703 | d3-fetch: 1.2.0 1704 | d3-force: 1.2.1 1705 | d3-format: 1.4.5 1706 | d3-geo: 1.12.1 1707 | d3-hierarchy: 1.1.9 1708 | d3-interpolate: 1.4.0 1709 | d3-path: 1.0.9 1710 | d3-polygon: 1.0.6 1711 | d3-quadtree: 1.0.7 1712 | d3-random: 1.1.2 1713 | d3-scale: 2.2.2 1714 | d3-scale-chromatic: 1.5.0 1715 | d3-selection: 1.4.2 1716 | d3-shape: 1.3.7 1717 | d3-time: 1.1.0 1718 | d3-time-format: 2.3.0 1719 | d3-timer: 1.0.10 1720 | d3-transition: 1.3.2 1721 | d3-voronoi: 1.1.4 1722 | d3-zoom: 1.8.3 1723 | 1724 | d3@7.9.0: 1725 | dependencies: 1726 | d3-array: 3.2.4 1727 | d3-axis: 3.0.0 1728 | d3-brush: 3.0.0 1729 | d3-chord: 3.0.1 1730 | d3-color: 3.1.0 1731 | d3-contour: 4.0.2 1732 | d3-delaunay: 6.0.4 1733 | d3-dispatch: 3.0.1 1734 | d3-drag: 3.0.0 1735 | d3-dsv: 3.0.1 1736 | d3-ease: 3.0.1 1737 | d3-fetch: 3.0.1 1738 | d3-force: 3.0.0 1739 | d3-format: 3.1.0 1740 | d3-geo: 3.1.1 1741 | d3-hierarchy: 3.1.2 1742 | d3-interpolate: 3.0.1 1743 | d3-path: 3.1.0 1744 | d3-polygon: 3.0.1 1745 | d3-quadtree: 3.0.1 1746 | d3-random: 3.0.1 1747 | d3-scale: 4.0.2 1748 | d3-scale-chromatic: 3.1.0 1749 | d3-selection: 3.0.0 1750 | d3-shape: 3.2.0 1751 | d3-time: 3.1.0 1752 | d3-time-format: 4.1.0 1753 | d3-timer: 3.0.1 1754 | d3-transition: 3.0.1(d3-selection@3.0.0) 1755 | d3-zoom: 3.0.0 1756 | 1757 | dagre-d3@0.6.4: 1758 | dependencies: 1759 | d3: 5.16.0 1760 | dagre: 0.8.5 1761 | graphlib: 2.1.8 1762 | lodash: 4.17.21 1763 | 1764 | dagre@0.8.5: 1765 | dependencies: 1766 | graphlib: 2.1.8 1767 | lodash: 4.17.21 1768 | 1769 | dayjs@1.11.11: {} 1770 | 1771 | de-indent@1.0.2: {} 1772 | 1773 | delaunator@5.0.1: 1774 | dependencies: 1775 | robust-predicates: 3.0.2 1776 | 1777 | delegate@3.2.0: {} 1778 | 1779 | devui-theme@0.0.1: {} 1780 | 1781 | devui-theme@0.0.7: {} 1782 | 1783 | diff2html@3.4.48: 1784 | dependencies: 1785 | diff: 5.1.0 1786 | hogan.js: 3.0.2 1787 | optionalDependencies: 1788 | highlight.js: 11.9.0 1789 | 1790 | diff@5.1.0: {} 1791 | 1792 | dompurify@2.3.6: {} 1793 | 1794 | echarts@5.3.3: 1795 | dependencies: 1796 | tslib: 2.3.0 1797 | zrender: 5.3.2 1798 | 1799 | entities@2.1.0: {} 1800 | 1801 | entities@4.5.0: {} 1802 | 1803 | esbuild@0.21.5: 1804 | optionalDependencies: 1805 | '@esbuild/aix-ppc64': 0.21.5 1806 | '@esbuild/android-arm': 0.21.5 1807 | '@esbuild/android-arm64': 0.21.5 1808 | '@esbuild/android-x64': 0.21.5 1809 | '@esbuild/darwin-arm64': 0.21.5 1810 | '@esbuild/darwin-x64': 0.21.5 1811 | '@esbuild/freebsd-arm64': 0.21.5 1812 | '@esbuild/freebsd-x64': 0.21.5 1813 | '@esbuild/linux-arm': 0.21.5 1814 | '@esbuild/linux-arm64': 0.21.5 1815 | '@esbuild/linux-ia32': 0.21.5 1816 | '@esbuild/linux-loong64': 0.21.5 1817 | '@esbuild/linux-mips64el': 0.21.5 1818 | '@esbuild/linux-ppc64': 0.21.5 1819 | '@esbuild/linux-riscv64': 0.21.5 1820 | '@esbuild/linux-s390x': 0.21.5 1821 | '@esbuild/linux-x64': 0.21.5 1822 | '@esbuild/netbsd-x64': 0.21.5 1823 | '@esbuild/openbsd-x64': 0.21.5 1824 | '@esbuild/sunos-x64': 0.21.5 1825 | '@esbuild/win32-arm64': 0.21.5 1826 | '@esbuild/win32-ia32': 0.21.5 1827 | '@esbuild/win32-x64': 0.21.5 1828 | 1829 | estree-walker@0.6.1: {} 1830 | 1831 | estree-walker@2.0.2: {} 1832 | 1833 | fill-range@7.1.1: 1834 | dependencies: 1835 | to-regex-range: 5.0.1 1836 | 1837 | fs-extra@10.1.0: 1838 | dependencies: 1839 | graceful-fs: 4.2.11 1840 | jsonfile: 6.1.0 1841 | universalify: 2.0.1 1842 | 1843 | fsevents@2.3.3: 1844 | optional: true 1845 | 1846 | function-bind@1.1.2: {} 1847 | 1848 | glob-parent@5.1.2: 1849 | dependencies: 1850 | is-glob: 4.0.3 1851 | 1852 | good-listener@1.2.2: 1853 | dependencies: 1854 | delegate: 3.2.0 1855 | 1856 | graceful-fs@4.2.11: {} 1857 | 1858 | graphlib@2.1.8: 1859 | dependencies: 1860 | lodash: 4.17.21 1861 | 1862 | hasown@2.0.2: 1863 | dependencies: 1864 | function-bind: 1.1.2 1865 | 1866 | he@1.2.0: {} 1867 | 1868 | highlight.js@11.9.0: {} 1869 | 1870 | hogan.js@3.0.2: 1871 | dependencies: 1872 | mkdirp: 0.3.0 1873 | nopt: 1.0.10 1874 | 1875 | iconv-lite@0.4.24: 1876 | dependencies: 1877 | safer-buffer: 2.1.2 1878 | 1879 | iconv-lite@0.6.3: 1880 | dependencies: 1881 | safer-buffer: 2.1.2 1882 | 1883 | immutable@4.3.6: {} 1884 | 1885 | internmap@2.0.3: {} 1886 | 1887 | is-binary-path@2.1.0: 1888 | dependencies: 1889 | binary-extensions: 2.3.0 1890 | 1891 | is-core-module@2.13.1: 1892 | dependencies: 1893 | hasown: 2.0.2 1894 | 1895 | is-extglob@2.1.1: {} 1896 | 1897 | is-glob@4.0.3: 1898 | dependencies: 1899 | is-extglob: 2.1.1 1900 | 1901 | is-module@1.0.0: {} 1902 | 1903 | is-number@7.0.0: {} 1904 | 1905 | jsonfile@6.1.0: 1906 | dependencies: 1907 | universalify: 2.0.1 1908 | optionalDependencies: 1909 | graceful-fs: 4.2.11 1910 | 1911 | katex@0.12.0: 1912 | dependencies: 1913 | commander: 2.20.3 1914 | 1915 | khroma@2.1.0: {} 1916 | 1917 | linkify-it@3.0.3: 1918 | dependencies: 1919 | uc.micro: 1.0.6 1920 | 1921 | lodash-es@4.17.21: {} 1922 | 1923 | lodash@4.17.21: {} 1924 | 1925 | magic-string@0.30.10: 1926 | dependencies: 1927 | '@jridgewell/sourcemap-codec': 1.4.15 1928 | 1929 | markdown-it-emoji@3.0.0: {} 1930 | 1931 | markdown-it-plantuml@1.4.1: {} 1932 | 1933 | markdown-it@12.2.0: 1934 | dependencies: 1935 | argparse: 2.0.1 1936 | entities: 2.1.0 1937 | linkify-it: 3.0.3 1938 | mdurl: 1.0.1 1939 | uc.micro: 1.0.6 1940 | 1941 | mdurl@1.0.1: {} 1942 | 1943 | mermaid@9.1.1: 1944 | dependencies: 1945 | '@braintree/sanitize-url': 6.0.4 1946 | d3: 7.9.0 1947 | dagre: 0.8.5 1948 | dagre-d3: 0.6.4 1949 | dompurify: 2.3.6 1950 | graphlib: 2.1.8 1951 | khroma: 2.1.0 1952 | moment-mini: 2.29.4 1953 | stylis: 4.3.2 1954 | 1955 | minimatch@9.0.4: 1956 | dependencies: 1957 | brace-expansion: 2.0.1 1958 | 1959 | mitt@3.0.1: {} 1960 | 1961 | mkdirp@0.3.0: {} 1962 | 1963 | moment-mini@2.29.4: {} 1964 | 1965 | monaco-editor@0.34.0: {} 1966 | 1967 | monaco-editor@0.50.0: {} 1968 | 1969 | muggle-string@0.4.1: {} 1970 | 1971 | nanoid@3.3.7: {} 1972 | 1973 | nopt@1.0.10: 1974 | dependencies: 1975 | abbrev: 1.1.1 1976 | 1977 | normalize-path@3.0.0: {} 1978 | 1979 | path-browserify@1.0.1: {} 1980 | 1981 | path-parse@1.0.7: {} 1982 | 1983 | picocolors@1.0.1: {} 1984 | 1985 | picomatch@2.3.1: {} 1986 | 1987 | postcss@8.4.38: 1988 | dependencies: 1989 | nanoid: 3.3.7 1990 | picocolors: 1.0.1 1991 | source-map-js: 1.2.0 1992 | 1993 | readdirp@3.6.0: 1994 | dependencies: 1995 | picomatch: 2.3.1 1996 | 1997 | resolve@1.22.8: 1998 | dependencies: 1999 | is-core-module: 2.13.1 2000 | path-parse: 1.0.7 2001 | supports-preserve-symlinks-flag: 1.0.0 2002 | 2003 | robust-predicates@3.0.2: {} 2004 | 2005 | rollup-plugin-node-resolve@5.2.0(rollup@4.18.0): 2006 | dependencies: 2007 | '@types/resolve': 0.0.8 2008 | builtin-modules: 3.3.0 2009 | is-module: 1.0.0 2010 | resolve: 1.22.8 2011 | rollup: 4.18.0 2012 | rollup-pluginutils: 2.8.2 2013 | 2014 | rollup-pluginutils@2.8.2: 2015 | dependencies: 2016 | estree-walker: 0.6.1 2017 | 2018 | rollup@4.18.0: 2019 | dependencies: 2020 | '@types/estree': 1.0.5 2021 | optionalDependencies: 2022 | '@rollup/rollup-android-arm-eabi': 4.18.0 2023 | '@rollup/rollup-android-arm64': 4.18.0 2024 | '@rollup/rollup-darwin-arm64': 4.18.0 2025 | '@rollup/rollup-darwin-x64': 4.18.0 2026 | '@rollup/rollup-linux-arm-gnueabihf': 4.18.0 2027 | '@rollup/rollup-linux-arm-musleabihf': 4.18.0 2028 | '@rollup/rollup-linux-arm64-gnu': 4.18.0 2029 | '@rollup/rollup-linux-arm64-musl': 4.18.0 2030 | '@rollup/rollup-linux-powerpc64le-gnu': 4.18.0 2031 | '@rollup/rollup-linux-riscv64-gnu': 4.18.0 2032 | '@rollup/rollup-linux-s390x-gnu': 4.18.0 2033 | '@rollup/rollup-linux-x64-gnu': 4.18.0 2034 | '@rollup/rollup-linux-x64-musl': 4.18.0 2035 | '@rollup/rollup-win32-arm64-msvc': 4.18.0 2036 | '@rollup/rollup-win32-ia32-msvc': 4.18.0 2037 | '@rollup/rollup-win32-x64-msvc': 4.18.0 2038 | fsevents: 2.3.3 2039 | 2040 | rw@1.3.3: {} 2041 | 2042 | rxjs@7.8.1: 2043 | dependencies: 2044 | tslib: 2.6.3 2045 | 2046 | safer-buffer@2.1.2: {} 2047 | 2048 | sass@1.77.6: 2049 | dependencies: 2050 | chokidar: 3.6.0 2051 | immutable: 4.3.6 2052 | source-map-js: 1.2.0 2053 | 2054 | select@1.1.2: {} 2055 | 2056 | semver@7.6.2: {} 2057 | 2058 | source-map-js@1.2.0: {} 2059 | 2060 | stylis@4.3.2: {} 2061 | 2062 | supports-preserve-symlinks-flag@1.0.0: {} 2063 | 2064 | tiny-emitter@2.1.0: {} 2065 | 2066 | to-fast-properties@2.0.0: {} 2067 | 2068 | to-regex-range@5.0.1: 2069 | dependencies: 2070 | is-number: 7.0.0 2071 | 2072 | tslib@2.3.0: {} 2073 | 2074 | tslib@2.6.3: {} 2075 | 2076 | typescript@5.4.5: {} 2077 | 2078 | uc.micro@1.0.6: {} 2079 | 2080 | undici-types@5.26.5: {} 2081 | 2082 | universalify@2.0.1: {} 2083 | 2084 | uuid@9.0.1: {} 2085 | 2086 | vite@5.3.1(@types/node@20.14.6)(sass@1.77.6): 2087 | dependencies: 2088 | esbuild: 0.21.5 2089 | postcss: 8.4.38 2090 | rollup: 4.18.0 2091 | optionalDependencies: 2092 | '@types/node': 20.14.6 2093 | fsevents: 2.3.3 2094 | sass: 1.77.6 2095 | 2096 | vscode-uri@3.0.8: {} 2097 | 2098 | vue-demi@0.14.8(vue@3.4.29(typescript@5.4.5)): 2099 | dependencies: 2100 | vue: 3.4.29(typescript@5.4.5) 2101 | 2102 | vue-devui@1.6.20(vue@3.4.29(typescript@5.4.5)): 2103 | dependencies: 2104 | '@babel/helper-hoist-variables': 7.24.7 2105 | '@devui-design/icons': 1.4.0 2106 | '@floating-ui/dom': 1.2.5 2107 | '@iktakahiro/markdown-it-katex': 4.0.1 2108 | '@types/codemirror': 0.0.97 2109 | '@types/lodash-es': 4.17.12 2110 | '@vue/shared': 3.4.29 2111 | '@vueuse/core': 8.9.4(vue@3.4.29(typescript@5.4.5)) 2112 | async-validator: 4.2.5 2113 | clipboard: 2.0.11 2114 | clipboard-copy: 4.0.1 2115 | codemirror: 5.63.3 2116 | dayjs: 1.11.11 2117 | devui-theme: 0.0.1 2118 | diff2html: 3.4.48 2119 | echarts: 5.3.3 2120 | fs-extra: 10.1.0 2121 | highlight.js: 11.9.0 2122 | katex: 0.12.0 2123 | lodash: 4.17.21 2124 | lodash-es: 4.17.21 2125 | markdown-it: 12.2.0 2126 | markdown-it-emoji: 3.0.0 2127 | markdown-it-plantuml: 1.4.1 2128 | mermaid: 9.1.1 2129 | mitt: 3.0.1 2130 | monaco-editor: 0.34.0 2131 | rxjs: 7.8.1 2132 | uuid: 9.0.1 2133 | vue: 3.4.29(typescript@5.4.5) 2134 | vue-router: 4.3.3(vue@3.4.29(typescript@5.4.5)) 2135 | xss: 1.0.15 2136 | transitivePeerDependencies: 2137 | - '@vue/composition-api' 2138 | 2139 | vue-router@4.3.3(vue@3.4.29(typescript@5.4.5)): 2140 | dependencies: 2141 | '@vue/devtools-api': 6.6.3 2142 | vue: 3.4.29(typescript@5.4.5) 2143 | 2144 | vue-template-compiler@2.7.16: 2145 | dependencies: 2146 | de-indent: 1.0.2 2147 | he: 1.2.0 2148 | 2149 | vue-tsc@2.0.21(typescript@5.4.5): 2150 | dependencies: 2151 | '@volar/typescript': 2.3.0 2152 | '@vue/language-core': 2.0.21(typescript@5.4.5) 2153 | semver: 7.6.2 2154 | typescript: 5.4.5 2155 | 2156 | vue@3.4.29(typescript@5.4.5): 2157 | dependencies: 2158 | '@vue/compiler-dom': 3.4.29 2159 | '@vue/compiler-sfc': 3.4.29 2160 | '@vue/runtime-dom': 3.4.29 2161 | '@vue/server-renderer': 3.4.29(vue@3.4.29(typescript@5.4.5)) 2162 | '@vue/shared': 3.4.29 2163 | optionalDependencies: 2164 | typescript: 5.4.5 2165 | 2166 | xss@1.0.15: 2167 | dependencies: 2168 | commander: 2.20.3 2169 | cssfilter: 0.0.10 2170 | 2171 | zrender@5.3.2: 2172 | dependencies: 2173 | tslib: 2.3.0 2174 | -------------------------------------------------------------------------------- /doc/public/nighta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderSerio/Nighta/9a97905e6730d0598d84426be90b1cdacf8cf545/doc/public/nighta.png -------------------------------------------------------------------------------- /doc/public/nighta_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CoderSerio/Nighta/9a97905e6730d0598d84426be90b1cdacf8cf545/doc/public/nighta_transparent.png -------------------------------------------------------------------------------- /doc/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | 26 | -------------------------------------------------------------------------------- /doc/src/assets/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /doc/src/components/monacoEditor/MonacoEditor.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 140 | 141 | 147 | -------------------------------------------------------------------------------- /doc/src/components/monacoEditor/monacoEditorType.ts: -------------------------------------------------------------------------------- 1 | import { PropType } from 'vue' 2 | export type Theme = 'vs' | 'hc-black' | 'vs-dark' 3 | export type FoldingStrategy = 'auto' | 'indentation' 4 | export type RenderLineHighlight = 'all' | 'line' | 'none' | 'gutter' 5 | export interface Options { 6 | automaticLayout: boolean 7 | foldingStrategy: FoldingStrategy 8 | renderLineHighlight: RenderLineHighlight 9 | selectOnLineNumbers: boolean 10 | minimap: { 11 | enabled: boolean 12 | } 13 | readOnly: boolean 14 | fontSize: number 15 | scrollBeyondLastLine: boolean 16 | overviewRulerBorder: boolean 17 | } 18 | export const editorProps = { 19 | modelValue: { 20 | type: String as PropType, 21 | default: null, 22 | }, 23 | width: { 24 | type: [String, Number] as PropType, 25 | default: '100%', 26 | }, 27 | height: { 28 | type: [String, Number] as PropType, 29 | default: '100%', 30 | }, 31 | language: { 32 | type: String as PropType, 33 | default: 'nighta', 34 | }, 35 | theme: { 36 | type: String as PropType, 37 | validator(value: string): boolean { 38 | return ['vs', 'hc-black', 'vs-dark'].includes(value) 39 | }, 40 | default: 'vs-dark', 41 | }, 42 | options: { 43 | type: Object as PropType, 44 | default: function () { 45 | return { 46 | automaticLayout: true, 47 | // foldingStrategy: 'indentation', 48 | renderLineHighlight: 'all', 49 | selectOnLineNumbers: true, 50 | minimap: { 51 | enabled: true, 52 | }, 53 | readOnly: false, 54 | fontSize: 16, 55 | scrollBeyondLastLine: false, 56 | overviewRulerBorder: false, 57 | } 58 | }, 59 | }, 60 | } -------------------------------------------------------------------------------- /doc/src/components/navbar/Navbar.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | 28 | 38 | -------------------------------------------------------------------------------- /doc/src/components/section/Section.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | 54 | 55 | 70 | -------------------------------------------------------------------------------- /doc/src/components/sideMenu/SideMenu.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 64 | 65 | 90 | -------------------------------------------------------------------------------- /doc/src/documents/sectionList.ts: -------------------------------------------------------------------------------- 1 | const sectionList = [ 2 | { 3 | title: `快速开始`, 4 | content: ` 5 | ## Nighta 的故事 6 | 一天夜里,睡不着,我打开手机一看,凌晨三点。做点什么好呢?看看编译原理吧。此后,我用了几天时间简单学习了编译原理,再到网吧里用了一晚上时间实现了一个解释器。这就是Nighta———几乎是一夜之间诞生的脚本语言。 7 | 它没有更好的性能,也没有更高级的特性,但是它是我对自己本科生涯画上的一个句号: 8 | 9 | > 还记得最初的 \`Hello World\` 吗?这是多少人编程的起点!原来,我们从一开始就是在面向世界编程,怀抱以一己之力改变全世界的壮志雄心,这一切是何等浪漫! 10 | > 而当我将要奔赴远方时,有感而发,挥毫提笔,留下代码作别,却仍是一句 \`Hello World\` 。 11 | 12 | 我想通过 Nighta 的故事,分享我四年的感悟,鼓励后来的编程学习者:**其实,很多技术并不是魔法,人人都可以学会**。 13 | 14 | ## Nighta 的特性 15 | 16 | Nighta 是一个基于 JavaScript 实现的跨平台语言,语法类似于 Lisp ,用\`()\`包裹每一条语句,形如: 17 | \`\`\`js 18 | (say "Hello World") 19 | \`\`\` 20 | 此外,Nighta 提倡万物皆函数,每一个 \`()\` 内的语句都是表达式,都可以被看作是函数,且均有返回值。 21 | 同时,函数也可以被反过来看作是 Nighta 中的变量,相关细节将在后续章节中介绍。 22 | 23 | 24 | ## 安装与使用 25 | 26 | TODO: 在不久的将来将会开放下载。 27 | 28 | 当前可以在 [Playground](https://coderserio.github.io/Nighta/#/playground/) 中进行体验。 29 | 30 | 具体用法请参考本文档左侧菜单中的各个栏目。 31 | > 当前仅提供了相关语法的案例,更细致的描述会在未来进行补充。 32 | ` 33 | }, 34 | { 35 | title: `变量`, 36 | content: ` 37 | ## var 38 | Nighta 是弱类型语言,使用 \`var\` 关键字声明变量,不严格区分类型: 39 | \`\`\`js 40 | (var a 100) 41 | (var b "string") 42 | (var c null) 43 | (var d undefined) 44 | (var e false) 45 | \`\`\` 46 | 47 | 也可以进行嵌套,并且对于换行或空格等格式是没有太多限制的,只需要保障关键字和变量名称等内容之间有空格分隔,同时让代码格式看起来美观(这很重要)即可。 48 | 下面是两种等价的写法: 49 | \`\`\`js 50 | (var f (var g "good night")) 51 | 52 | (var f 53 | (var g "good night") 54 | ) 55 | \`\`\` 56 | 57 | 你可以用内置函数 \`say\` 来输出结果上述结果: 58 | \`\`\`js 59 | (say a b c d e) 60 | \`\`\` 61 | ` 62 | }, 63 | { 64 | title: `基础运算`, 65 | content: ` 66 | Nighta 的每一个 \`()\` 中只支持单次运算: 67 | \`\`\`js 68 | (1 + (1 * (1 / 2))) 69 | (var a (1 + 1.1)) 70 | (a % 2) 71 | \`\`\` 72 | 73 | 由于是弱类型的缘故,不同类型的值也可以进行 \`+\` 运算,变量也可以跨类型地重新赋值: 74 | \`\`\`js 75 | (var msg1 "Hello") 76 | (var msg2 1024) 77 | (var msg (msg1 + msg2)) 78 | (msg = true) 79 | \`\`\` 80 | 81 | 82 | 同时,Nighta 中万物都是函数,除了\`=\`赋值语句以外的基础运算都可以被重写: 83 | 84 | \`\`\`js 85 | (var + ( 86 | fun (v1 v2) { 87 | (say v1 " say: [Hello] to " v2) 88 | }) 89 | ) 90 | (say ("You" + "World")) 91 | \`\`\` 92 | 93 | 上述代码的结果是: 94 | > You say [Hello] to World 95 | 96 | 不过,目前 nighta 还没有支持 \`++\` 等语法糖,所以现阶段使用这些语法时会抛出异常。 97 | 98 | ` 99 | }, 100 | { 101 | title: `作用域`, 102 | content: ` 103 | nighta 中,使用 \`{}\` 包裹内容即可创建一个局部作用域: 104 | \`\`\`js 105 | (var msg1 "oh!") 106 | { 107 | (var msg1 "Hello,") 108 | (var msg2 "World!") 109 | (say (msg1 + msg2)) 110 | } 111 | \`\`\` 112 | 113 | 最后输出的内容是: 114 | > Hello,World! 115 | 116 | 可以利用作用域的特性来创建局部变量,或者局部重写函数————当然,二者本质是一样的,因为在 nighta 中,函数也是一种变量。 117 | 118 | 此外,分支语句、函数中也涉及到作用域的使用————在这些场景下使用作用域时,如果该作用域中只有一条语句,那么可以省略\`{}\`。 119 | 120 | ` 121 | }, 122 | { 123 | title: `条件语句`, 124 | content: ` 125 | ## if 126 | 和其他大部分语言不太一样,nighta 中的 \`if\` 是一个三元表达式。 127 | 128 | \`\`\`js 129 | (var x 100) 130 | (if (x > 100) { 131 | (say "bigger") 132 | } { 133 | (say "smaller") 134 | }) 135 | \`\`\` 136 | 137 | 如果需要表示更复杂的判断逻辑,可以嵌套使用 \`if\` 语句。 138 | 139 | 另外,正如上一章节提到的那样,当作用域内只有一条语句时,可以省略 \`{}\` 140 | 141 | \`\`\`js 142 | (var x 100) 143 | (if (x > 100) 144 | (say "x is bigger than 100") 145 | (if (x < 100) 146 | (say "x is smaller than 100") 147 | (say "x is equal to 100") 148 | ) 149 | ) 150 | \`\`\` 151 | ` 152 | }, 153 | { 154 | title: `循环语句`, 155 | content: ` 156 | nighta 中的循环语句的语法较为常规: 157 | \`\`\`js 158 | (var i 0) 159 | (while (i < 10) { 160 | (i = (i + 1)) 161 | }) 162 | \`\`\` 163 | 164 | 类似地,\`{}\` 在其内只有一条语句时是可省略的。 165 | 166 | > 美中不足的是,目前 nighta 还不支持 \`++\` 等语法糖。 167 | 168 | ` 169 | }, 170 | { 171 | title: `函数`, 172 | content: ` 173 | ## 普通函数 174 | nighta 的函数声明和调用都非常简单: 175 | \`\`\`js 176 | (fun square (x y) 177 | { 178 | (var z 30) 179 | ((x + y) * z) 180 | } 181 | ) 182 | (square 10 2) 183 | \`\`\` 184 | 185 | 类似地,\`{}\` 在其内只有一条语句时是可省略的,具体内容可以参考下文中的匿名函数案例。 186 | 187 | ## 匿名函数 188 | 189 | \`\`\`js 190 | (fun sum (a b) (a + b)) 191 | 192 | (fun calc (callback x y) 193 | (callback x y) 194 | ) 195 | 196 | (calc sum 10 2) 197 | \`\`\` 198 | 199 | 注意到了吗?上方代码中的 \`callback\` 函数被当作参数传递了——这算是再次强调,在 nighta 中,函数可以被看做一种变量。 200 | 201 | ` 202 | }, 203 | { 204 | title: `类`, 205 | content: ` 206 | ## 基本使用 207 | 208 | nighta 仅简单支持了 OOP 的部分规范,基本语法如下: 209 | 210 | \`\`\`js 211 | (class Person null { 212 | (fun constructor (x) 213 | (self["x"] = x) 214 | ) 215 | 216 | (fun info () { 217 | (say x) 218 | }) 219 | }) 220 | 221 | (var person (new Person 1)) 222 | (person["info"]) 223 | \`\`\` 224 | 225 | class 中存在一个可以直接使用的变量 \`self\` 指向其当前的上下文环境。 226 | 227 | 同时使用 \`[]\` 可以访问 class 的属性——请注意,代码中访问属性是 \`"x"\` 而不是 \`x\` ! 前者是字符串,后者表示一个变量——可能是任何内容。 228 | > 这意味着,你可以在其中插入语句实现更复杂的属性名称计算,类似于这样: \`instance[(("a" + "good") + "name")]\` 229 | > 同时,还可以直接进行嵌套:\`instance[instance[key]]\` 230 | 231 | ## 继承 232 | 233 | 继承的语法也非常简单,只需要把上述声明 class 的语句中的 \`null\` 替换为要继承的类即可。 234 | 235 | 但是 nighta 的继承机制可能不像主流语言那样完善,它只支持会继承方法。 236 | 237 | \`\`\`js 238 | (class Person null { 239 | (fun constructor (num) { 240 | }) 241 | (fun info () { 242 | (say "This is OOP: " self["num"]) 243 | }) 244 | }) 245 | 246 | (class Worker Person { 247 | (fun constructor (num) { 248 | (self["num"] = num) 249 | }) 250 | }) 251 | 252 | (var worker (new Worker 12345)) 253 | (worker["info"]) 254 | \`\`\` 255 | ` 256 | }, 257 | { 258 | title: `数组`, 259 | content: ` 260 | ## List 261 | 数组、列表、字典———其实几乎就是同一个概念,在 nighta 中,使用 List 创建数组,而 \`List\` 本身实际上是基于上一章节的 class 进行封装的,所以其语法如下: 262 | \`\`\`js 263 | (var arr (new List 10)) 264 | 265 | (fun iterator () { 266 | (arr["map"] 267 | (fun (item index) { 268 | (say "arr[" index "] -----> " arr[index]) 269 | }) 270 | ) 271 | }) 272 | 273 | (arr["push"] "one") 274 | (arr["push"] "two") 275 | (arr["pop"]) 276 | (arr["unshift"] "one") 277 | (arr["unshift"] "two") 278 | (arr["shift"]) 279 | 280 | (iterator) 281 | \`\`\` 282 | 283 | 目前,\`List\` 提供了几个 API: 284 | - \`len\`: 属性,当前的数组长度。 285 | - \`push\`: 方法,在列表的末尾插入一个元素。 286 | - \`pop\`: 方法,移除列表的最后一个元素。 287 | - \`unshift\`: 方法,在列表的开头插入一个元素。 288 | - \`shift\`: 方法,移除列表的第一个元素。 289 | - \`map\`: 方法,迭代器,需要传入一个回调,提供两个参数 \`element\` 和 \`index\` 分别指代元素本身和其下标。 290 | 291 | 同时,可以使用形如 \`arr[10]\` 的语法对指定下标 \`10\` 的内容进行**访问**——请注意,最好不要用这个方式对**长度越界的部分**进行修改,因为这样的修改不会引起 \`len\` 的变化,进而导致获取数组长度错误。 292 | 293 | ` 294 | }, 295 | // { 296 | // title: `其他内容`, 297 | // content: ` 298 | // ## 这里该写点什么好呢 299 | // > 以后想到了再补上吧 300 | // ` 301 | // } 302 | ]; 303 | 304 | export default sectionList; -------------------------------------------------------------------------------- /doc/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import "./style.css"; 3 | import App from "./App.vue"; 4 | import DevUI from "vue-devui"; 5 | import "vue-devui/style.css"; 6 | import "@devui-design/icons/icomoon/devui-icon.css"; 7 | import { ThemeServiceInit, infinityTheme, galaxyTheme } from "devui-theme"; 8 | import router from "./router/router"; 9 | 10 | window.codeOutputList = [] 11 | console.originalLog = console.log; 12 | console.log = (content: any) => { 13 | console.originalLog(content); 14 | window.codeOutputList.push(content) 15 | }; 16 | 17 | console.originalDir = console.dir; 18 | console.dir = (content: any) => { 19 | console.originalDir(content) 20 | window.codeOutputList.push(content) 21 | } 22 | 23 | // so amazing, it doesn't trigger the overwrite 24 | console.originalError = console.error 25 | console.error = (content: any) => { 26 | console.originalError(content) 27 | window.codeOutputList = [] 28 | } 29 | 30 | ThemeServiceInit({ infinityTheme }, "infinityTheme")?.applyTheme(galaxyTheme); 31 | 32 | createApp(App).use(DevUI).use(router).mount("#app"); -------------------------------------------------------------------------------- /doc/src/pages/home/Home.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 34 | 35 | 130 | -------------------------------------------------------------------------------- /doc/src/pages/main/Main.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 16 | 17 | 36 | -------------------------------------------------------------------------------- /doc/src/pages/playground/Playground.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 73 | 74 | 108 | -------------------------------------------------------------------------------- /doc/src/router/router.ts: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from "vue-router"; 2 | 3 | import Home from "../pages/home/Home.vue"; 4 | import Main from "../pages/main/Main.vue"; 5 | import Section from "../components/section/Section.vue" 6 | import Playground from "../pages/playground/Playground.vue" 7 | import sectionList from "../documents/sectionList"; 8 | 9 | const routes: any = [ 10 | { path: "/", meta: { KeepAlive: true }, component: Home }, 11 | { path: "/main", meta: { KeepAlive: true }, component: Main, redirect: `/main/${sectionList[0].title}`, children: [{ path: ':section', component: Section }] }, 12 | { path: "/playground", meta: { KeepAlive: true }, component: Playground } 13 | ]; 14 | 15 | const router = createRouter({ 16 | history: createWebHashHistory(), 17 | routes, 18 | }); 19 | 20 | export default router; -------------------------------------------------------------------------------- /doc/src/style.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; 3 | line-height: 1.5; 4 | font-weight: 400; 5 | 6 | color-scheme: light dark; 7 | color: rgba(255, 255, 255, 0.87); 8 | background-color: #242424; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | body { 17 | min-height: 100vh; 18 | } 19 | 20 | h1 { 21 | font-size: 3.2em; 22 | line-height: 1.1; 23 | } 24 | 25 | .card { 26 | } 27 | 28 | #app { 29 | max-width: 100vw; 30 | } 31 | 32 | @media (prefers-color-scheme: light) { 33 | :root { 34 | color: #213547; 35 | background-color: #ffffff; 36 | } 37 | a:hover { 38 | color: #747bff; 39 | } 40 | button { 41 | background-color: #f9f9f9; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /doc/src/util/interpreter.js: -------------------------------------------------------------------------------- 1 | import t from"assert";var e=class{constructor(t={},e=null){this.record=t,this.parent=e}define(t,e){return this.record[t]=e,e}lookUp(t){return this.resolve(t).record[t]}resolve(t){if(this.record.hasOwnProperty(t))return this;if(null===this.parent)throw new ReferenceError(`Variable ${t} is not defined.`);return this.parent.resolve(t)}assign(t,e){return this.resolve(t).record[t]=e,e}};var n=class{transformSwitch(t){const[e,...n]=t,r=["if",null,null,null];let s=r;for(let t=0;t{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[1,1,t=>{s=Number(t)}],[1,1,t=>{s=t}],[1,1,t=>{s=t}],[2,3,(t,e,n)=>{s=e}],[3,2,(t,e)=>{t.push(e),s=t}],[3,0,()=>{s=[]}],[4,3,(t,e,n)=>{e.unshift("block"),s=e}],[5,2,(t,e)=>{t.push(e),s=t}],[5,0,()=>{s=[]}],[6,4,(t,e,n,r)=>{s=["prop",t,n]}]],l={NUMBER:"7",STRING:"8",SYMBOL:"9","'('":"10","')'":"11","'{'":"12","'}'":"13","'['":"14","']'":"15",$:"16"},u=[{0:1,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{16:"acc"},{7:"r1",8:"r1",9:"r1",10:"r1",11:"r1",12:"r1",13:"r1",14:"s11",15:"r1",16:"r1"},{7:"r2",8:"r2",9:"r2",10:"r2",11:"r2",12:"r2",13:"r2",15:"r2",16:"r2"},{7:"r3",8:"r3",9:"r3",10:"r3",11:"r3",12:"r3",13:"r3",15:"r3",16:"r3"},{7:"r4",8:"r4",9:"r4",10:"r4",11:"r4",12:"r4",13:"r4",15:"r4",16:"r4"},{7:"r5",8:"r5",9:"r5",10:"r5",11:"r5",12:"r5",13:"r5",14:"r5",15:"r5",16:"r5"},{7:"r6",8:"r6",9:"r6",10:"r6",11:"r6",12:"r6",13:"r6",14:"r6",15:"r6",16:"r6"},{7:"r7",8:"r7",9:"r7",10:"r7",11:"r7",12:"r7",13:"r7",14:"r7",15:"r7",16:"r7"},{3:14,7:"r10",8:"r10",9:"r10",10:"r10",11:"r10",12:"r10"},{5:17,7:"r13",8:"r13",9:"r13",10:"r13",12:"r13",13:"r13"},{0:12,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{15:"s13"},{7:"r14",8:"r14",9:"r14",10:"r14",11:"r14",12:"r14",13:"r14",15:"r14",16:"r14"},{0:16,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",11:"s15",12:"s10"},{7:"r8",8:"r8",9:"r8",10:"r8",11:"r8",12:"r8",13:"r8",15:"r8",16:"r8"},{7:"r9",8:"r9",9:"r9",10:"r9",11:"r9",12:"r9"},{0:19,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10",13:"s18"},{7:"r11",8:"r11",9:"r11",10:"r11",11:"r11",12:"r11",13:"r11",15:"r11",16:"r11"},{7:"r12",8:"r12",9:"r12",10:"r12",12:"r12",13:"r12"}],a=[];let h;const c=[[/^\(/,function(){return"'('"}],[/^\)/,function(){return"')'"}],[/^\{/,function(){return"'{'"}],[/^\}/,function(){return"'}'"}],[/^\[/,function(){return"'['"}],[/^\]/,function(){return"']'"}],[/^\s+/,function(){}],[/^"([^\"\\]*(\\.[^\"\\]*)*)"/,function(){return"STRING"}],[/^\d+/,function(){return"NUMBER"}],[/^[\w\-+*=<>/]+/,function(){return"SYMBOL"}],[/^\{/,function(){return"LBRACE"}],[/^\}/,function(){return"RBRACE"}]],f={INITIAL:[0,1,2,3,4,5,6,7,8,9,10,11]},p={type:"$",value:""};h={initString(t){return this._string=t,this._cursor=0,this._states=["INITIAL"],this._tokensQueue=[],this._currentLine=1,this._currentColumn=0,this._currentLineBeginOffset=0,this._tokenStartOffset=0,this._tokenEndOffset=0,this._tokenStartLine=1,this._tokenEndLine=1,this._tokenStartColumn=0,this._tokenEndColumn=0,this},getStates(){return this._states},getCurrentState(){return this._states[this._states.length-1]},pushState(t){this._states.push(t)},begin(t){this.pushState(t)},popState(){return this._states.length>1?this._states.pop():this._states[0]},getNextToken(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(p);let t=this._string.slice(this._cursor),e=f[this.getCurrentState()];for(let n=0;n0&&this._tokensQueue.unshift(...e)}return this.onToken(this._toToken(t,r))}}if(this.isEOF())return this._cursor++,p;this.throwUnexpectedToken(t[0],this._currentLine,this._currentColumn)},throwUnexpectedToken(t,e,n){const r=this._string.split("\n")[e-1];let s="";if(r){s="\n\n"+r+"\n"+" ".repeat(n)+"^\n"}throw new SyntaxError(`${s}Unexpected token: "${t}" at ${e}:${n}.`)},getCursor(){return this._cursor},getCurrentLine(){return this._currentLine},getCurrentColumn(){return this._currentColumn},_captureLocation(t){const e=/\n/g;let n;for(this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;null!==(n=e.exec(t));)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+n.index+1;this._tokenEndOffset=this._cursor+t.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},_toToken(t,e=""){return{type:t,value:e,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},isEOF(){return this._cursor===this._string.length},hasMoreTokens(){return this._cursor<=this._string.length},_match(t,e){let n=t.match(e);return n?(this._captureLocation(n[0]),this._cursor+=n[0].length,n[0]):null},onToken:t=>t},i.lexer=h,i.tokenizer=h,i.options={captureLocations:!1};const _={setOptions(t){return i.options=t,this},getOptions:()=>i.options,parse(t,e){if(!h)throw new Error("Tokenizer instance wasn't specified.");h.initString(t);let n=i.options;e&&(i.options=Object.assign({},i.options,e)),a.length=0,a.push(0);let c=h.getNextToken(),f=null;do{c||(i.options=n,g());let t=a[a.length-1],e=l[c.type];u[t].hasOwnProperty(e)||(i.options=n,d(c));let p=u[t][e];if("s"===p[0]){let t=null;i.options.captureLocations&&(t={startOffset:c.startOffset,endOffset:c.endOffset,startLine:c.startLine,endLine:c.endLine,startColumn:c.startColumn,endColumn:c.endColumn}),f=this.onShift(c),a.push({symbol:l[f.type],semanticValue:f.value,loc:t},Number(p.slice(1))),c=h.getNextToken()}else if("r"===p[0]){let t=p.slice(1),e=o[t],n="function"==typeof e[2],l=n?[]:null;const h=n&&i.options.captureLocations?[]:null;if(0!==e[1]){let t=e[1];for(;t-- >0;){a.pop();let t=a.pop();n&&(l.unshift(t.semanticValue),h&&h.unshift(t.loc))}}const c={symbol:e[0]};if(n){r=f?f.value:null,f&&f.value.length;const t=null!==h?l.concat(h):l;e[2](...t),c.semanticValue=s,h&&(c.loc=undefined)}const _=a[a.length-1],d=e[0];a.push(c,u[_][d])}else if("acc"===p){a.pop();let t=a.pop();return(1!==a.length||0!==a[0]||h.hasMoreTokens())&&(i.options=n,d(c)),t.hasOwnProperty("semanticValue")?(i.options=n,_.onParseEnd(t.semanticValue),t.semanticValue):(i.options=n,!0)}}while(h.hasMoreTokens()||a.length>1)},setTokenizer:t=>(h=t,_),getTokenizer:()=>h,onParseBegin(t,e,n){},onParseEnd(t){},onShift:t=>t};function d(t){"$"===t.type&&g(),h.throwUnexpectedToken(t.value,t.startLine,t.startColumn)}function g(){!function(t){throw new SyntaxError(t)}("Unexpected end of input.")}var k=_;const m="HERE_IS_NO_EXPECTED, WHY?";var v=class{constructor(t){this.nighta=t}parse(t){return k.parse(t)}parseTest(e,n=m){const r=this.parse(e);n===m?t.doesNotThrow((()=>this.nighta.eval(r))):t.strictEqual(this.nighta.eval(r),n)}};const w=new class{constructor(t=new e,r=null){this.global=t,this.parent=r,this.transformer=new n,this.parser=new v(this)}parse(t){return this.parser.parse(`{${t}}`)}eval(t,n=this.global){if(this._isNumber(t))return t;if(this._isString(t))return t.slice(1,-1);if(!this._isUndefined(t)){if("block"===t[0]){const r=new e({},n);return this._evalBlock(t,r)}if("var"===t[0]){const[e,r,s]=t;return n.define(r,this.eval(s,n))}if("if"===t[0]){const[e,r,s,i]=t;return this.eval(r,n)?this.eval(s,n):this.eval(i,n)}if("switch"===t[0]){const e=this.transformer.transformSwitch(t);return this.eval(e,n)}if("while"===t[0]){const[e,r,s]=t;let i;for(;this.eval(r,n);)i=this.eval(s,n);return i}if("fun"===t[0]){if(4===t.length){const[e,r,s,i]=t;return n.define(r,{params:s,body:i,env:n})}{const[e,r,s]=t;return{params:r,body:s,env:n}}}if("class"===t[0]){const[r,s,i,o]=t,l=this.eval(i,n),u=new e({_className:s},l||n);return l&&Object.keys(l.record).forEach((t=>{const e=l.record[t],n=u.record[t];let r;if("constructor"===t){const s=["block",[...e?.body?.[1]??[],...n.body?.[1]??[]]];r={params:[...e.params,...n?.params??[]],body:s,env:l},u.define(t,r)}else r=n??e;u.define(t,r)})),this._evalFunctionBody(o,u),n.define(s,u)}if("new"===t[0]){const[r,s,...i]=t,o=this.eval(s,n),l=new e({},o);l.define("self",l);const u={...o.parent?.record,...o.record};Object.keys(u).forEach((t=>{const e=u[t];let n;e instanceof Object?(n={...e},n.env&&(n.env=l)):n=e,l.define(t,n)}));const a=l.lookUp("constructor"),h=i.map((t=>this.eval(t,n)));return this._callUserDefinedFunction(a,h,l),l}if("prop"===t[0]){const[e,r,s]=t,i=this.eval(r,n);let o;return o=this._isString(s)?s.slice(1,-1):this.eval(s,n),i.lookUp(o)}if("super"===t[0]){const[e,r]=t;return this.eval(r,n).parent}if(this._isVariableName(t))return n.lookUp(t);if(Array.isArray(t)){let e,r;if("="===t[1]){const[e,r,s]=t,i=this.eval(s,n);if("prop"===e[0]){const[t,r,s]=e,o=this.eval(r,n);let l;return l=this._isString(s)?s.slice(1,-1):this.eval(s,n),o.define(l,i)}return n.assign(e,i)}if(["+","-","*","/","%","&&","||","&","|",">",">=","==","<=","<"].includes(t[1])){const[n,s,i]=t;e=s,r=[n,i]}else[e,...r]=t;const s=this.eval(e,n),i=r.map((t=>this.eval(t,n)));if("function"==typeof s)return s(...i);if(s.body&&s.env)return this._callUserDefinedFunction(s,i,s.env)}throw`Invalid Syntax: ${JSON.stringify(t)}\n\n${JSON.stringify(n)}`}}_callUserDefinedFunction(t,n,r){const s={};t.params?.forEach(((t,e)=>{s[t]=n[e]}));const i=new e(s,r);return this._evalFunctionBody(t.body,i)}_evalFunctionBody(t,e){return"block"===t[0]?this._evalBlock(t,e):this.eval(t,e)}_evalBlock(t,e){let n;const[r,...s]=t;return s.forEach((t=>{n=this.eval(t,e)})),n}_isNumber(t){return"number"==typeof t}_isString(t){return"string"==typeof t&&'"'===t[0]&&'"'===t.slice(-1)}_isUndefined(t){return void 0===t}_isVariableName(t){return"string"==typeof t&&/^[+\-*/<>=a-zA-Z0-9_]*$/.test(t)}}(new e({null:null,true:!0,false:!1,undefined:void 0,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"==":(t,e)=>t===e,"<=":(t,e)=>t<=e,"<":(t,e)=>tt&&e,"||":(t,e)=>t||e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,integer:t=>parseInt(t),say:(...t)=>{let e;return t.length>1?(e=t.reduce(((t,e)=>t+e),""),console.log(e)):(e=t?.[0],console.dir(e,{depth:3})),e}})),y=w.eval(w.parse('\n (class List null {\n (fun constructor (len) {\n (self["len"] = len)\n (var i 0)\n (while (i < len) {\n (self[i] = 0)\n (i = (i + 1))\n })\n })\n\n (fun push (item) {\n (self[self["len"]] = item)\n (self["len"] = (self["len"] + 1))\n })\n\n (fun pop () {\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun shift () {\n (var i 0)\n (while (i < (self["len"] - 1)) {\n (self[i] = self[(i + 1)])\n (i = (i + 1))\n })\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun unshift (item) {\n (self["len"] = (self["len"] + 1))\n (var i self["len"])\n (while (i > 0) {\n (self[i] = self[(i - 1)])\n (i = (i - 1))\n })\n (self[0] = item)\n })\n\n (fun map (callback) {\n (var _mapCounter 0)\n (while (_mapCounter < self["len"]) {\n (callback self[_mapCounter] _mapCounter)\n (_mapCounter = (1 + _mapCounter))\n })\n })\n })\n'),w.global);w.global.define("List",y);var S=w;export{S as default};"undefined"!=typeof window&&(window.MUD_VERSION="0.0.1"); 2 | -------------------------------------------------------------------------------- /doc/src/util/safeJsonStringify.ts: -------------------------------------------------------------------------------- 1 | const safeJsonStringify = (value: any) => { 2 | let cache: Array | null = []; 3 | let isFirstRecord = true; 4 | 5 | const str = JSON.stringify( 6 | value, 7 | (key, value) => { 8 | if (typeof value === "object" && value !== null) { 9 | if (cache?.indexOf(value) !== -1) { 10 | return; 11 | } 12 | cache.push(value); 13 | if (!Object.keys(value).length) { 14 | return () => { }; 15 | } 16 | } 17 | 18 | if (key === "record") { 19 | if (isFirstRecord) { 20 | isFirstRecord = false; 21 | } else { 22 | return () => { }; 23 | } 24 | } 25 | 26 | if (key === "parent") { 27 | return () => { }; 28 | } else if (key === "env") { 29 | return () => { }; 30 | } 31 | 32 | if (value instanceof Array) { 33 | return () => { }; 34 | } 35 | 36 | return value; 37 | }, 38 | 4 39 | ); 40 | 41 | cache = null; 42 | 43 | return (str as any)?.replaceAll('{}', '[Object]') ?? str; 44 | }; 45 | 46 | export default safeJsonStringify; 47 | -------------------------------------------------------------------------------- /doc/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module '*.vue' { 4 | import { DefineComponent } from 'vue' 5 | const component: DefineComponent<{}, {}, any> 6 | export default component 7 | } 8 | 9 | declare interface Window { 10 | [key: string]: any 11 | codeOutputList: Array 12 | } 13 | 14 | declare interface Console { 15 | originalLog: (...data: any[]) => void 16 | originalDir: (item?: any, options?: any) => void 17 | originalError: (...data: any[]) => void 18 | } 19 | 20 | declare module '*.js' { 21 | export default any 22 | } -------------------------------------------------------------------------------- /doc/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": ["ES2020", "DOM", "DOM.Iterable"], 7 | "skipLibCheck": true, 8 | 9 | /* Bundler mode */ 10 | "moduleResolution": "bundler", 11 | "allowImportingTsExtensions": true, 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "noEmit": true, 15 | "jsx": "preserve", 16 | 17 | /* Linting */ 18 | "strict": false, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /doc/tsconfig.node.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "composite": true, 4 | "skipLibCheck": true, 5 | "module": "ESNext", 6 | "moduleResolution": "bundler", 7 | "allowSyntheticDefaultImports": true, 8 | "strict": false 9 | }, 10 | "include": ["vite.config.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /doc/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import vue from '@vitejs/plugin-vue' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | base: '/Nighta/', 7 | plugins: [vue()], 8 | optimizeDeps: { 9 | include: [ 10 | `monaco-editor/esm/vs/language/json/json.worker`, 11 | `monaco-editor/esm/vs/language/css/css.worker`, 12 | `monaco-editor/esm/vs/language/html/html.worker`, 13 | `monaco-editor/esm/vs/language/typescript/ts.worker`, 14 | `monaco-editor/esm/vs/editor/editor.worker` 15 | ], 16 | }, 17 | }) 18 | -------------------------------------------------------------------------------- /lib/esm/index.esm.js: -------------------------------------------------------------------------------- 1 | import t from"assert";var e=class{constructor(t={},e=null){this.record=t,this.parent=e}define(t,e){return this.record[t]=e,e}lookUp(t){return this.resolve(t).record[t]}resolve(t){if(this.record.hasOwnProperty(t))return this;if(null===this.parent)throw new ReferenceError(`Variable ${t} is not defined.`);return this.parent.resolve(t)}assign(t,e){return this.resolve(t).record[t]=e,e}};var n=class{transformSwitch(t){const[e,...n]=t,r=["if",null,null,null];let s=r;for(let t=0;t{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[0,1,t=>{s=t}],[1,1,t=>{s=Number(t)}],[1,1,t=>{s=t}],[1,1,t=>{s=t}],[2,3,(t,e,n)=>{s=e}],[3,2,(t,e)=>{t.push(e),s=t}],[3,0,()=>{s=[]}],[4,3,(t,e,n)=>{e.unshift("block"),s=e}],[5,2,(t,e)=>{t.push(e),s=t}],[5,0,()=>{s=[]}],[6,4,(t,e,n,r)=>{s=["prop",t,n]}]],l={NUMBER:"7",STRING:"8",SYMBOL:"9","'('":"10","')'":"11","'{'":"12","'}'":"13","'['":"14","']'":"15",$:"16"},u=[{0:1,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{16:"acc"},{7:"r1",8:"r1",9:"r1",10:"r1",11:"r1",12:"r1",13:"r1",14:"s11",15:"r1",16:"r1"},{7:"r2",8:"r2",9:"r2",10:"r2",11:"r2",12:"r2",13:"r2",15:"r2",16:"r2"},{7:"r3",8:"r3",9:"r3",10:"r3",11:"r3",12:"r3",13:"r3",15:"r3",16:"r3"},{7:"r4",8:"r4",9:"r4",10:"r4",11:"r4",12:"r4",13:"r4",15:"r4",16:"r4"},{7:"r5",8:"r5",9:"r5",10:"r5",11:"r5",12:"r5",13:"r5",14:"r5",15:"r5",16:"r5"},{7:"r6",8:"r6",9:"r6",10:"r6",11:"r6",12:"r6",13:"r6",14:"r6",15:"r6",16:"r6"},{7:"r7",8:"r7",9:"r7",10:"r7",11:"r7",12:"r7",13:"r7",14:"r7",15:"r7",16:"r7"},{3:14,7:"r10",8:"r10",9:"r10",10:"r10",11:"r10",12:"r10"},{5:17,7:"r13",8:"r13",9:"r13",10:"r13",12:"r13",13:"r13"},{0:12,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{15:"s13"},{7:"r14",8:"r14",9:"r14",10:"r14",11:"r14",12:"r14",13:"r14",15:"r14",16:"r14"},{0:16,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",11:"s15",12:"s10"},{7:"r8",8:"r8",9:"r8",10:"r8",11:"r8",12:"r8",13:"r8",15:"r8",16:"r8"},{7:"r9",8:"r9",9:"r9",10:"r9",11:"r9",12:"r9"},{0:19,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10",13:"s18"},{7:"r11",8:"r11",9:"r11",10:"r11",11:"r11",12:"r11",13:"r11",15:"r11",16:"r11"},{7:"r12",8:"r12",9:"r12",10:"r12",12:"r12",13:"r12"}],a=[];let h;const c=[[/^\(/,function(){return"'('"}],[/^\)/,function(){return"')'"}],[/^\{/,function(){return"'{'"}],[/^\}/,function(){return"'}'"}],[/^\[/,function(){return"'['"}],[/^\]/,function(){return"']'"}],[/^\s+/,function(){}],[/^"([^\"\\]*(\\.[^\"\\]*)*)"/,function(){return"STRING"}],[/^\d+/,function(){return"NUMBER"}],[/^[\w\-+*=<>/]+/,function(){return"SYMBOL"}],[/^\{/,function(){return"LBRACE"}],[/^\}/,function(){return"RBRACE"}]],f={INITIAL:[0,1,2,3,4,5,6,7,8,9,10,11]},p={type:"$",value:""};h={initString(t){return this._string=t,this._cursor=0,this._states=["INITIAL"],this._tokensQueue=[],this._currentLine=1,this._currentColumn=0,this._currentLineBeginOffset=0,this._tokenStartOffset=0,this._tokenEndOffset=0,this._tokenStartLine=1,this._tokenEndLine=1,this._tokenStartColumn=0,this._tokenEndColumn=0,this},getStates(){return this._states},getCurrentState(){return this._states[this._states.length-1]},pushState(t){this._states.push(t)},begin(t){this.pushState(t)},popState(){return this._states.length>1?this._states.pop():this._states[0]},getNextToken(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(p);let t=this._string.slice(this._cursor),e=f[this.getCurrentState()];for(let n=0;n0&&this._tokensQueue.unshift(...e)}return this.onToken(this._toToken(t,r))}}if(this.isEOF())return this._cursor++,p;this.throwUnexpectedToken(t[0],this._currentLine,this._currentColumn)},throwUnexpectedToken(t,e,n){const r=this._string.split("\n")[e-1];let s="";if(r){s="\n\n"+r+"\n"+" ".repeat(n)+"^\n"}throw new SyntaxError(`${s}Unexpected token: "${t}" at ${e}:${n}.`)},getCursor(){return this._cursor},getCurrentLine(){return this._currentLine},getCurrentColumn(){return this._currentColumn},_captureLocation(t){const e=/\n/g;let n;for(this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;null!==(n=e.exec(t));)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+n.index+1;this._tokenEndOffset=this._cursor+t.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},_toToken(t,e=""){return{type:t,value:e,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},isEOF(){return this._cursor===this._string.length},hasMoreTokens(){return this._cursor<=this._string.length},_match(t,e){let n=t.match(e);return n?(this._captureLocation(n[0]),this._cursor+=n[0].length,n[0]):null},onToken:t=>t},i.lexer=h,i.tokenizer=h,i.options={captureLocations:!1};const _={setOptions(t){return i.options=t,this},getOptions:()=>i.options,parse(t,e){if(!h)throw new Error("Tokenizer instance wasn't specified.");h.initString(t);let n=i.options;e&&(i.options=Object.assign({},i.options,e)),a.length=0,a.push(0);let c=h.getNextToken(),f=null;do{c||(i.options=n,g());let t=a[a.length-1],e=l[c.type];u[t].hasOwnProperty(e)||(i.options=n,d(c));let p=u[t][e];if("s"===p[0]){let t=null;i.options.captureLocations&&(t={startOffset:c.startOffset,endOffset:c.endOffset,startLine:c.startLine,endLine:c.endLine,startColumn:c.startColumn,endColumn:c.endColumn}),f=this.onShift(c),a.push({symbol:l[f.type],semanticValue:f.value,loc:t},Number(p.slice(1))),c=h.getNextToken()}else if("r"===p[0]){let t=p.slice(1),e=o[t],n="function"==typeof e[2],l=n?[]:null;const h=n&&i.options.captureLocations?[]:null;if(0!==e[1]){let t=e[1];for(;t-- >0;){a.pop();let t=a.pop();n&&(l.unshift(t.semanticValue),h&&h.unshift(t.loc))}}const c={symbol:e[0]};if(n){r=f?f.value:null,f&&f.value.length;const t=null!==h?l.concat(h):l;e[2](...t),c.semanticValue=s,h&&(c.loc=undefined)}const _=a[a.length-1],d=e[0];a.push(c,u[_][d])}else if("acc"===p){a.pop();let t=a.pop();return(1!==a.length||0!==a[0]||h.hasMoreTokens())&&(i.options=n,d(c)),t.hasOwnProperty("semanticValue")?(i.options=n,_.onParseEnd(t.semanticValue),t.semanticValue):(i.options=n,!0)}}while(h.hasMoreTokens()||a.length>1)},setTokenizer:t=>(h=t,_),getTokenizer:()=>h,onParseBegin(t,e,n){},onParseEnd(t){},onShift:t=>t};function d(t){"$"===t.type&&g(),h.throwUnexpectedToken(t.value,t.startLine,t.startColumn)}function g(){!function(t){throw new SyntaxError(t)}("Unexpected end of input.")}var k=_;const m="HERE_IS_NO_EXPECTED, WHY?";var v=class{constructor(t){this.nighta=t}parse(t){return k.parse(t)}parseTest(e,n=m){const r=this.parse(e);n===m?t.doesNotThrow((()=>this.nighta.eval(r))):t.strictEqual(this.nighta.eval(r),n)}};const w=new class{constructor(t=new e,r=null){this.global=t,this.parent=r,this.transformer=new n,this.parser=new v(this)}parse(t){return this.parser.parse(`{${t}}`)}eval(t,n=this.global){if(this._isNumber(t))return t;if(this._isString(t))return t.slice(1,-1);if(!this._isUndefined(t)){if("block"===t[0]){const r=new e({},n);return this._evalBlock(t,r)}if("var"===t[0]){const[e,r,s]=t;return n.define(r,this.eval(s,n))}if("if"===t[0]){const[e,r,s,i]=t;return this.eval(r,n)?this.eval(s,n):this.eval(i,n)}if("switch"===t[0]){const e=this.transformer.transformSwitch(t);return this.eval(e,n)}if("while"===t[0]){const[e,r,s]=t;let i;for(;this.eval(r,n);)i=this.eval(s,n);return i}if("fun"===t[0]){if(4===t.length){const[e,r,s,i]=t;return n.define(r,{params:s,body:i,env:n})}{const[e,r,s]=t;return{params:r,body:s,env:n}}}if("class"===t[0]){const[r,s,i,o]=t,l=this.eval(i,n),u=new e({_className:s},l||n);return l&&Object.keys(l.record).forEach((t=>{const e=l.record[t],n=u.record[t];let r;if("constructor"===t){const s=["block",[...e?.body?.[1]??[],...n.body?.[1]??[]]];r={params:[...e.params,...n?.params??[]],body:s,env:l},u.define(t,r)}else r=n??e;u.define(t,r)})),this._evalFunctionBody(o,u),n.define(s,u)}if("new"===t[0]){const[r,s,...i]=t,o=this.eval(s,n),l=new e({},o);l.define("self",l);const u={...o.parent?.record,...o.record};Object.keys(u).forEach((t=>{const e=u[t];let n;e instanceof Object?(n={...e},n.env&&(n.env=l)):n=e,l.define(t,n)}));const a=l.lookUp("constructor"),h=i.map((t=>this.eval(t,n)));return this._callUserDefinedFunction(a,h,l),l}if("prop"===t[0]){const[e,r,s]=t,i=this.eval(r,n);let o;return o=this._isString(s)?s.slice(1,-1):this.eval(s,n),i.lookUp(o)}if("super"===t[0]){const[e,r]=t;return this.eval(r,n).parent}if(this._isVariableName(t))return n.lookUp(t);if(Array.isArray(t)){let e,r;if("="===t[1]){const[e,r,s]=t,i=this.eval(s,n);if("prop"===e[0]){const[t,r,s]=e,o=this.eval(r,n);let l;return l=this._isString(s)?s.slice(1,-1):this.eval(s,n),o.define(l,i)}return n.assign(e,i)}if(["+","-","*","/","%","&&","||","&","|",">",">=","==","<=","<"].includes(t[1])){const[n,s,i]=t;e=s,r=[n,i]}else[e,...r]=t;const s=this.eval(e,n),i=r.map((t=>this.eval(t,n)));if("function"==typeof s)return s(...i);if(s.body&&s.env)return this._callUserDefinedFunction(s,i,s.env)}throw`Invalid Syntax: ${JSON.stringify(t)}\n\n${JSON.stringify(n)}`}}_callUserDefinedFunction(t,n,r){const s={};t.params?.forEach(((t,e)=>{s[t]=n[e]}));const i=new e(s,r);return this._evalFunctionBody(t.body,i)}_evalFunctionBody(t,e){return"block"===t[0]?this._evalBlock(t,e):this.eval(t,e)}_evalBlock(t,e){let n;const[r,...s]=t;return s.forEach((t=>{n=this.eval(t,e)})),n}_isNumber(t){return"number"==typeof t}_isString(t){return"string"==typeof t&&'"'===t[0]&&'"'===t.slice(-1)}_isUndefined(t){return void 0===t}_isVariableName(t){return"string"==typeof t&&/^[+\-*/<>=a-zA-Z0-9_]*$/.test(t)}}(new e({null:null,true:!0,false:!1,undefined:void 0,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"==":(t,e)=>t===e,"<=":(t,e)=>t<=e,"<":(t,e)=>tt&&e,"||":(t,e)=>t||e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,integer:t=>parseInt(t),say:(...t)=>{let e;return t.length>1?(e=t.reduce(((t,e)=>t+e),""),console.log(e)):(e=t?.[0],console.dir(e,{depth:3})),e}})),y=w.eval(w.parse('\n (class List null {\n (fun constructor (len) {\n (self["len"] = len)\n (var i 0)\n (while (i < len) {\n (self[i] = 0)\n (i = (i + 1))\n })\n })\n\n (fun push (item) {\n (self[self["len"]] = item)\n (self["len"] = (self["len"] + 1))\n })\n\n (fun pop () {\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun shift () {\n (var i 0)\n (while (i < (self["len"] - 1)) {\n (self[i] = self[(i + 1)])\n (i = (i + 1))\n })\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun unshift (item) {\n (self["len"] = (self["len"] + 1))\n (var i self["len"])\n (while (i > 0) {\n (self[i] = self[(i - 1)])\n (i = (i - 1))\n })\n (self[0] = item)\n })\n\n (fun map (callback) {\n (var _mapCounter 0)\n (while (_mapCounter < self["len"]) {\n (callback self[_mapCounter] _mapCounter)\n (_mapCounter = (1 + _mapCounter))\n })\n })\n })\n'),w.global);w.global.define("List",y);var S=w;export{S as default};"undefined"!=typeof window&&(window.MUD_VERSION="0.0.1"); 2 | -------------------------------------------------------------------------------- /lib/umd/index.umd.js: -------------------------------------------------------------------------------- 1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("assert")):"function"==typeof define&&define.amd?define(["assert"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Mud=e(t.assert)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(t);var r=class{constructor(t={},e=null){this.record=t,this.parent=e}define(t,e){return this.record[t]=e,e}lookUp(t){return this.resolve(t).record[t]}resolve(t){if(this.record.hasOwnProperty(t))return this;if(null===this.parent)throw new ReferenceError(`Variable ${t} is not defined.`);return this.parent.resolve(t)}assign(t,e){return this.resolve(t).record[t]=e,e}};var s=class{transformSwitch(t){const[e,...n]=t,r=["if",null,null,null];let s=r;for(let t=0;t{o=t}],[0,1,t=>{o=t}],[0,1,t=>{o=t}],[0,1,t=>{o=t}],[0,1,t=>{o=t}],[1,1,t=>{o=Number(t)}],[1,1,t=>{o=t}],[1,1,t=>{o=t}],[2,3,(t,e,n)=>{o=e}],[3,2,(t,e)=>{t.push(e),o=t}],[3,0,()=>{o=[]}],[4,3,(t,e,n)=>{e.unshift("block"),o=e}],[5,2,(t,e)=>{t.push(e),o=t}],[5,0,()=>{o=[]}],[6,4,(t,e,n,r)=>{o=["prop",t,n]}]],a={NUMBER:"7",STRING:"8",SYMBOL:"9","'('":"10","')'":"11","'{'":"12","'}'":"13","'['":"14","']'":"15",$:"16"},h=[{0:1,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{16:"acc"},{7:"r1",8:"r1",9:"r1",10:"r1",11:"r1",12:"r1",13:"r1",14:"s11",15:"r1",16:"r1"},{7:"r2",8:"r2",9:"r2",10:"r2",11:"r2",12:"r2",13:"r2",15:"r2",16:"r2"},{7:"r3",8:"r3",9:"r3",10:"r3",11:"r3",12:"r3",13:"r3",15:"r3",16:"r3"},{7:"r4",8:"r4",9:"r4",10:"r4",11:"r4",12:"r4",13:"r4",15:"r4",16:"r4"},{7:"r5",8:"r5",9:"r5",10:"r5",11:"r5",12:"r5",13:"r5",14:"r5",15:"r5",16:"r5"},{7:"r6",8:"r6",9:"r6",10:"r6",11:"r6",12:"r6",13:"r6",14:"r6",15:"r6",16:"r6"},{7:"r7",8:"r7",9:"r7",10:"r7",11:"r7",12:"r7",13:"r7",14:"r7",15:"r7",16:"r7"},{3:14,7:"r10",8:"r10",9:"r10",10:"r10",11:"r10",12:"r10"},{5:17,7:"r13",8:"r13",9:"r13",10:"r13",12:"r13",13:"r13"},{0:12,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10"},{15:"s13"},{7:"r14",8:"r14",9:"r14",10:"r14",11:"r14",12:"r14",13:"r14",15:"r14",16:"r14"},{0:16,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",11:"s15",12:"s10"},{7:"r8",8:"r8",9:"r8",10:"r8",11:"r8",12:"r8",13:"r8",15:"r8",16:"r8"},{7:"r9",8:"r9",9:"r9",10:"r9",11:"r9",12:"r9"},{0:19,1:2,2:3,4:4,6:5,7:"s6",8:"s7",9:"s8",10:"s9",12:"s10",13:"s18"},{7:"r11",8:"r11",9:"r11",10:"r11",11:"r11",12:"r11",13:"r11",15:"r11",16:"r11"},{7:"r12",8:"r12",9:"r12",10:"r12",12:"r12",13:"r12"}],f=[];let c;const p=[[/^\(/,function(){return"'('"}],[/^\)/,function(){return"')'"}],[/^\{/,function(){return"'{'"}],[/^\}/,function(){return"'}'"}],[/^\[/,function(){return"'['"}],[/^\]/,function(){return"']'"}],[/^\s+/,function(){}],[/^"([^\"\\]*(\\.[^\"\\]*)*)"/,function(){return"STRING"}],[/^\d+/,function(){return"NUMBER"}],[/^[\w\-+*=<>/]+/,function(){return"SYMBOL"}],[/^\{/,function(){return"LBRACE"}],[/^\}/,function(){return"RBRACE"}]],d={INITIAL:[0,1,2,3,4,5,6,7,8,9,10,11]},_={type:"$",value:""};c={initString(t){return this._string=t,this._cursor=0,this._states=["INITIAL"],this._tokensQueue=[],this._currentLine=1,this._currentColumn=0,this._currentLineBeginOffset=0,this._tokenStartOffset=0,this._tokenEndOffset=0,this._tokenStartLine=1,this._tokenEndLine=1,this._tokenStartColumn=0,this._tokenEndColumn=0,this},getStates(){return this._states},getCurrentState(){return this._states[this._states.length-1]},pushState(t){this._states.push(t)},begin(t){this.pushState(t)},popState(){return this._states.length>1?this._states.pop():this._states[0]},getNextToken(){if(this._tokensQueue.length>0)return this.onToken(this._toToken(this._tokensQueue.shift()));if(!this.hasMoreTokens())return this.onToken(_);let t=this._string.slice(this._cursor),e=d[this.getCurrentState()];for(let n=0;n0&&this._tokensQueue.unshift(...e)}return this.onToken(this._toToken(t,i))}}if(this.isEOF())return this._cursor++,_;this.throwUnexpectedToken(t[0],this._currentLine,this._currentColumn)},throwUnexpectedToken(t,e,n){const r=this._string.split("\n")[e-1];let s="";if(r){s="\n\n"+r+"\n"+" ".repeat(n)+"^\n"}throw new SyntaxError(`${s}Unexpected token: "${t}" at ${e}:${n}.`)},getCursor(){return this._cursor},getCurrentLine(){return this._currentLine},getCurrentColumn(){return this._currentColumn},_captureLocation(t){const e=/\n/g;let n;for(this._tokenStartOffset=this._cursor,this._tokenStartLine=this._currentLine,this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;null!==(n=e.exec(t));)this._currentLine++,this._currentLineBeginOffset=this._tokenStartOffset+n.index+1;this._tokenEndOffset=this._cursor+t.length,this._tokenEndLine=this._currentLine,this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},_toToken(t,e=""){return{type:t,value:e,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},isEOF(){return this._cursor===this._string.length},hasMoreTokens(){return this._cursor<=this._string.length},_match(t,e){let n=t.match(e);return n?(this._captureLocation(n[0]),this._cursor+=n[0].length,n[0]):null},onToken:t=>t},l.lexer=c,l.tokenizer=c,l.options={captureLocations:!1};const g={setOptions(t){return l.options=t,this},getOptions:()=>l.options,parse(t,e){if(!c)throw new Error("Tokenizer instance wasn't specified.");c.initString(t);let n=l.options;e&&(l.options=Object.assign({},l.options,e)),f.length=0,f.push(0);let r=c.getNextToken(),s=null;do{r||(l.options=n,m());let t=f[f.length-1],e=a[r.type];h[t].hasOwnProperty(e)||(l.options=n,k(r));let p=h[t][e];if("s"===p[0]){let t=null;l.options.captureLocations&&(t={startOffset:r.startOffset,endOffset:r.endOffset,startLine:r.startLine,endLine:r.endLine,startColumn:r.startColumn,endColumn:r.endColumn}),s=this.onShift(r),f.push({symbol:a[s.type],semanticValue:s.value,loc:t},Number(p.slice(1))),r=c.getNextToken()}else if("r"===p[0]){let t=p.slice(1),e=u[t],n="function"==typeof e[2],r=n?[]:null;const a=n&&l.options.captureLocations?[]:null;if(0!==e[1]){let t=e[1];for(;t-- >0;){f.pop();let t=f.pop();n&&(r.unshift(t.semanticValue),a&&a.unshift(t.loc))}}const c={symbol:e[0]};if(n){i=s?s.value:null,s&&s.value.length;const t=null!==a?r.concat(a):r;e[2](...t),c.semanticValue=o,a&&(c.loc=undefined)}const d=f[f.length-1],_=e[0];f.push(c,h[d][_])}else if("acc"===p){f.pop();let t=f.pop();return(1!==f.length||0!==f[0]||c.hasMoreTokens())&&(l.options=n,k(r)),t.hasOwnProperty("semanticValue")?(l.options=n,g.onParseEnd(t.semanticValue),t.semanticValue):(l.options=n,!0)}}while(c.hasMoreTokens()||f.length>1)},setTokenizer:t=>(c=t,g),getTokenizer:()=>c,onParseBegin(t,e,n){},onParseEnd(t){},onShift:t=>t};function k(t){"$"===t.type&&m(),c.throwUnexpectedToken(t.value,t.startLine,t.startColumn)}function m(){!function(t){throw new SyntaxError(t)}("Unexpected end of input.")}var v=g;const y="HERE_IS_NO_EXPECTED, WHY?";var w=class{constructor(t){this.nighta=t}parse(t){return v.parse(t)}parseTest(t,e=y){const r=this.parse(t);e===y?n.default.doesNotThrow((()=>this.nighta.eval(r))):n.default.strictEqual(this.nighta.eval(r),e)}};const S=new class{constructor(t=new r,e=null){this.global=t,this.parent=e,this.transformer=new s,this.parser=new w(this)}parse(t){return this.parser.parse(`{${t}}`)}eval(t,e=this.global){if(this._isNumber(t))return t;if(this._isString(t))return t.slice(1,-1);if(!this._isUndefined(t)){if("block"===t[0]){const n=new r({},e);return this._evalBlock(t,n)}if("var"===t[0]){const[n,r,s]=t;return e.define(r,this.eval(s,e))}if("if"===t[0]){const[n,r,s,i]=t;return this.eval(r,e)?this.eval(s,e):this.eval(i,e)}if("switch"===t[0]){const n=this.transformer.transformSwitch(t);return this.eval(n,e)}if("while"===t[0]){const[n,r,s]=t;let i;for(;this.eval(r,e);)i=this.eval(s,e);return i}if("fun"===t[0]){if(4===t.length){const[n,r,s,i]=t;return e.define(r,{params:s,body:i,env:e})}{const[n,r,s]=t;return{params:r,body:s,env:e}}}if("class"===t[0]){const[n,s,i,o]=t,l=this.eval(i,e),u=new r({_className:s},l||e);return l&&Object.keys(l.record).forEach((t=>{const e=l.record[t],n=u.record[t];let r;if("constructor"===t){const s=["block",[...e?.body?.[1]??[],...n.body?.[1]??[]]];r={params:[...e.params,...n?.params??[]],body:s,env:l},u.define(t,r)}else r=n??e;u.define(t,r)})),this._evalFunctionBody(o,u),e.define(s,u)}if("new"===t[0]){const[n,s,...i]=t,o=this.eval(s,e),l=new r({},o);l.define("self",l);const u={...o.parent?.record,...o.record};Object.keys(u).forEach((t=>{const e=u[t];let n;e instanceof Object?(n={...e},n.env&&(n.env=l)):n=e,l.define(t,n)}));const a=l.lookUp("constructor"),h=i.map((t=>this.eval(t,e)));return this._callUserDefinedFunction(a,h,l),l}if("prop"===t[0]){const[n,r,s]=t,i=this.eval(r,e);let o;return o=this._isString(s)?s.slice(1,-1):this.eval(s,e),i.lookUp(o)}if("super"===t[0]){const[n,r]=t;return this.eval(r,e).parent}if(this._isVariableName(t))return e.lookUp(t);if(Array.isArray(t)){let n,r;if("="===t[1]){const[n,r,s]=t,i=this.eval(s,e);if("prop"===n[0]){const[t,r,s]=n,o=this.eval(r,e);let l;return l=this._isString(s)?s.slice(1,-1):this.eval(s,e),o.define(l,i)}return e.assign(n,i)}if(["+","-","*","/","%","&&","||","&","|",">",">=","==","<=","<"].includes(t[1])){const[e,s,i]=t;n=s,r=[e,i]}else[n,...r]=t;const s=this.eval(n,e),i=r.map((t=>this.eval(t,e)));if("function"==typeof s)return s(...i);if(s.body&&s.env)return this._callUserDefinedFunction(s,i,s.env)}throw`Invalid Syntax: ${JSON.stringify(t)}\n\n${JSON.stringify(e)}`}}_callUserDefinedFunction(t,e,n){const s={};t.params?.forEach(((t,n)=>{s[t]=e[n]}));const i=new r(s,n);return this._evalFunctionBody(t.body,i)}_evalFunctionBody(t,e){return"block"===t[0]?this._evalBlock(t,e):this.eval(t,e)}_evalBlock(t,e){let n;const[r,...s]=t;return s.forEach((t=>{n=this.eval(t,e)})),n}_isNumber(t){return"number"==typeof t}_isString(t){return"string"==typeof t&&'"'===t[0]&&'"'===t.slice(-1)}_isUndefined(t){return void 0===t}_isVariableName(t){return"string"==typeof t&&/^[+\-*/<>=a-zA-Z0-9_]*$/.test(t)}}(new r({null:null,true:!0,false:!1,undefined:void 0,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"==":(t,e)=>t===e,"<=":(t,e)=>t<=e,"<":(t,e)=>tt&&e,"||":(t,e)=>t||e,"&":(t,e)=>t&e,"|":(t,e)=>t|e,integer:t=>parseInt(t),say:(...t)=>{let e;return t.length>1?(e=t.reduce(((t,e)=>t+e),""),console.log(e)):(e=t?.[0],console.dir(e,{depth:3})),e}})),b=S.eval(S.parse('\n (class List null {\n (fun constructor (len) {\n (self["len"] = len)\n (var i 0)\n (while (i < len) {\n (self[i] = 0)\n (i = (i + 1))\n })\n })\n\n (fun push (item) {\n (self[self["len"]] = item)\n (self["len"] = (self["len"] + 1))\n })\n\n (fun pop () {\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun shift () {\n (var i 0)\n (while (i < (self["len"] - 1)) {\n (self[i] = self[(i + 1)])\n (i = (i + 1))\n })\n (self[self["len"]] = undefined)\n (self["len"] = (self["len"] - 1))\n })\n\n (fun unshift (item) {\n (self["len"] = (self["len"] + 1))\n (var i self["len"])\n (while (i > 0) {\n (self[i] = self[(i - 1)])\n (i = (i - 1))\n })\n (self[0] = item)\n })\n\n (fun map (callback) {\n (var _mapCounter 0)\n (while (_mapCounter < self["len"]) {\n (callback self[_mapCounter] _mapCounter)\n (_mapCounter = (1 + _mapCounter))\n })\n })\n })\n'),S.global);return S.global.define("List",b),S})),"undefined"!=typeof window&&(window.MUD_VERSION="0.0.1"); 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nighta", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "lib/cjs/index.cjs.js", 6 | "module": "lib/esm/index.esm.js", 7 | "browser": "lib/umd/index.umd.js", 8 | "scripts": { 9 | "test": "node src/test/index.js", 10 | "doc": "cd doc && npm run dev", 11 | "gen": "cd src/parser && powershell -ExecutionPolicy Bypass -File gen.ps1", 12 | "build": "rollup -c && copy lib\\esm\\index.esm.js doc\\src\\util\\interpreter.js", 13 | "build:all": "npm run gen && npm run test && npm run build", 14 | "preview": "cd doc && npm run build && npm run preview", 15 | "publish:doc": "git subtree push --prefix dist origin gh-pages" 16 | }, 17 | "keywords": [], 18 | "author": "", 19 | "license": "ISC", 20 | "dependencies": {}, 21 | "devDependencies": { 22 | "@rollup/plugin-babel": "^6.0.3", 23 | "@rollup/plugin-commonjs": "^18.0.0", 24 | "rollup": "^2.45.1", 25 | "rollup-plugin-filesize": "^10.0.0", 26 | "rollup-plugin-node-resolve": "^5.2.0", 27 | "rollup-plugin-terser": "^7.0.2" 28 | }, 29 | "files": [ 30 | "lib", 31 | "README.md" 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import pkg from './package.json'; 2 | import resolve from 'rollup-plugin-node-resolve'; 3 | import commonjs from '@rollup/plugin-commonjs'; 4 | import { terser } from 'rollup-plugin-terser'; 5 | import { babel } from '@rollup/plugin-babel'; 6 | 7 | const footer = ` 8 | if(typeof window !== 'undefined') { 9 | window.MUD_VERSION = '${pkg.version}' 10 | }`; 11 | 12 | export default { 13 | input: './src/Nighta.js', 14 | output: [ 15 | { 16 | file: pkg.module, 17 | format: 'esm', 18 | footer, 19 | }, 20 | // { 21 | // file: pkg.main, 22 | // format: 'cjs', 23 | // exports: "auto", 24 | // footer, 25 | // }, 26 | { 27 | file: pkg.browser, 28 | format: 'umd', 29 | name: 'Mud', 30 | exports: "auto", 31 | footer, 32 | }, 33 | ], 34 | watch: { 35 | exclude: 'node_modules/**' 36 | }, 37 | plugins: [ 38 | commonjs(), 39 | resolve(), 40 | terser(), 41 | babel({ exclude: "node_modules/**" }), 42 | // filesize() 43 | ] 44 | }; -------------------------------------------------------------------------------- /src/Nighta.js: -------------------------------------------------------------------------------- 1 | const Environment = require("./environment/Environment"); 2 | const Transformer = require("./transformer/Transformer"); 3 | const Parser = require('./parser/Parser'); 4 | 5 | class Nighta { 6 | constructor(global = new Environment(), parent = null) { 7 | this.global = global; 8 | this.parent = parent; 9 | this.transformer = new Transformer(); 10 | this.parser = new Parser(this); 11 | } 12 | 13 | parse(code) { 14 | return this.parser.parse(`{${code}}`); 15 | } 16 | 17 | eval(exp, env = this.global) { 18 | // console.log('======================================'); 19 | // console.log(exp); 20 | // console.log('____'); 21 | // console.log(env); 22 | // console.log('======================================'); 23 | if (this._isNumber(exp)) { 24 | if (+exp < 0) { 25 | console.log('???', +exp === -1); 26 | return +exp; 27 | } 28 | return exp; 29 | } else if (this._isString(exp)) { 30 | return exp.slice(1, -1); 31 | } else if (this._isUndefined(exp)) { 32 | return undefined; 33 | } 34 | 35 | if (exp[0] === 'block') { 36 | const blockEnv = new Environment({}, env); 37 | return this._evalBlock(exp, blockEnv); 38 | } 39 | 40 | 41 | if (exp[0] === 'var') { 42 | const [_tag, name, value] = exp; 43 | return env.define(name, this.eval(value, env)); 44 | } 45 | 46 | // if (exp[1] === '=' && exp !== '==') { 47 | // const [_tag, target, originalValue] = exp; 48 | // const value = this.eval(originalValue, env); 49 | // // If the target is a class 50 | // if (target[0] === 'prop') { 51 | // const [_tag, instanceName, propertyName] = target; 52 | // const instanceEnv = this.eval(instanceName, env); 53 | // // Why not `assign`? --- `assign` is used to change the variable in self and parent scope. 54 | // // In a class, we use keyword `set` to create a variable so we use define here. 55 | // return instanceEnv.define(propertyName, value); 56 | // } 57 | // return env.assign(target, value); 58 | // } 59 | 60 | if (exp[0] === 'if') { 61 | const [_tag, condition, consequent, alternate] = exp; 62 | if (this.eval(condition, env)) { 63 | return this.eval(consequent, env); 64 | } 65 | return this.eval(alternate, env); 66 | } 67 | 68 | if (exp[0] === 'switch') { 69 | const ifExp = this.transformer.transformSwitch(exp); 70 | return this.eval(ifExp, env); 71 | } 72 | 73 | if (exp[0] === 'while') { 74 | const [_tag, condition, body] = exp; 75 | let result; 76 | while (this.eval(condition, env)) { 77 | result = this.eval(body, env); 78 | } 79 | return result; 80 | } 81 | 82 | if (exp[0] === 'fun') { 83 | if (exp.length === 4) { // normal function 84 | const [_tag, name, params, body] = exp; 85 | return env.define(name, { 86 | params, 87 | body, 88 | env 89 | }); 90 | } else { // lambda function 91 | const [_tag, params, body] = exp; 92 | return { 93 | params, 94 | body, 95 | env 96 | }; 97 | } 98 | } 99 | 100 | if (exp[0] === 'class') { 101 | const [_tag, className, parent, body] = exp; 102 | const parentClassEnv = this.eval(parent, env); // maybe null 103 | // Class is a kind of environment, which has a individual scope 104 | // And its parent would be replaced with global environment if it is null 105 | const classEnv = new Environment({ _className: className }, parentClassEnv || env); 106 | if (parentClassEnv) { 107 | Object.keys(parentClassEnv.record).forEach((key) => { 108 | const parentRecordValue = parentClassEnv.record[key]; 109 | const recordValue = classEnv.record[key]; 110 | let value; 111 | if (key === 'constructor') { 112 | const mixedBody = ['block', [...(parentRecordValue?.body?.[1] ?? []), ...(recordValue.body?.[1] ?? [])]]; 113 | value = { 114 | params: [...parentRecordValue.params, ...(recordValue?.params ?? [])], 115 | body: mixedBody, 116 | env: parentClassEnv 117 | }; 118 | classEnv.define(key, value); 119 | } else { 120 | value = recordValue ?? parentRecordValue; 121 | } 122 | classEnv.define(key, value); 123 | }); 124 | } 125 | 126 | this._evalFunctionBody(body, classEnv); 127 | return env.define(className, classEnv); 128 | } 129 | 130 | if (exp[0] === 'new') { 131 | const [_tag, className, ...originalArgs] = exp; 132 | const classEnv = this.eval(className, env); 133 | // As the same, instance of a class is also a kind of environment, and its parent is the class 134 | const instanceEnv = new Environment({}, classEnv); 135 | instanceEnv.define('self', instanceEnv); 136 | const instanceRecord = { ...classEnv.parent?.record, ...classEnv.record }; 137 | Object.keys(instanceRecord).forEach((key) => { 138 | const originalValue = instanceRecord[key]; 139 | let value; 140 | // In our AST, function is processed to a kind of object 141 | if (originalValue instanceof Object) { 142 | value = { ...originalValue }; 143 | if (value.env) { 144 | value.env = instanceEnv; 145 | } 146 | } else { 147 | value = originalValue; 148 | } 149 | 150 | instanceEnv.define(key, value); 151 | }); 152 | 153 | const constructor = instanceEnv.lookUp('constructor'); 154 | const args = originalArgs.map((arg) => this.eval(arg, env)); 155 | // TODO: there would be a overwrite if variable name is `self` 156 | this._callUserDefinedFunction(constructor, args, instanceEnv); 157 | return instanceEnv; 158 | } 159 | 160 | if (exp[0] === 'prop') { 161 | const [_tag, instanceName, originPropertyName] = exp; 162 | const instanceEnv = this.eval(instanceName, env); 163 | let propertyName; 164 | if (this._isString(originPropertyName)) { 165 | propertyName = originPropertyName.slice(1, -1); 166 | } else { 167 | propertyName = this.eval(originPropertyName, env); 168 | } 169 | return instanceEnv.lookUp(propertyName); 170 | } 171 | 172 | if (exp[0] === 'super') { 173 | const [_tag, className] = exp; 174 | const classEnv = this.eval(className, env); 175 | return classEnv.parent; 176 | } 177 | 178 | if (this._isVariableName(exp)) { 179 | return env.lookUp(exp); 180 | } 181 | 182 | // Function Call: 183 | if (Array.isArray(exp)) { 184 | let name, originalArgs; 185 | if (exp[1] === '=') { 186 | const [target, _tag, originalValue] = exp; 187 | const value = this.eval(originalValue, env); 188 | // If the target is a class 189 | if (target[0] === 'prop') { 190 | const [_tag, instanceName, originalPropertyName] = target; 191 | const instanceEnv = this.eval(instanceName, env); 192 | // Why not `assign`? --- `assign` is used to change the variable in self and parent scope. 193 | // In a class, we use keyword `set` to create a variable so we use define here. 194 | let propertyName; 195 | if (this._isString(originalPropertyName)) { 196 | propertyName = originalPropertyName.slice(1, -1); 197 | } else { 198 | propertyName = this.eval(originalPropertyName, env); 199 | } 200 | return instanceEnv.define(propertyName, value); 201 | } 202 | return env.assign(target, value); 203 | } 204 | 205 | if (['+', '-', '*', '/', '%', '&&', '||', '&', '|', '>', '>=', '==', '<=', '<'].includes(exp[1])) { 206 | const [leftValue, operator, rightValue] = exp; 207 | name = operator; 208 | originalArgs = [leftValue, rightValue]; 209 | } else { 210 | [name, ...originalArgs] = exp; 211 | } 212 | 213 | const fn = this.eval(name, env); 214 | const args = originalArgs.map((arg) => this.eval(arg, env)); 215 | 216 | if (typeof fn === 'function') { // build-in functions 217 | return fn(...args); 218 | } else if (fn.body && fn.env) { // user-defined functions 219 | return this._callUserDefinedFunction(fn, args, fn.env); 220 | } 221 | } 222 | 223 | throw `Invalid Syntax: ${JSON.stringify(exp)}\n\n${JSON.stringify(env)}`; 224 | } 225 | 226 | _callUserDefinedFunction(fn, args, env) { 227 | // copy the prams 228 | const activationRecord = {}; 229 | fn.params?.forEach((param, index) => { 230 | activationRecord[param] = args[index]; 231 | }); 232 | 233 | const activationEnvironment = new Environment( 234 | activationRecord, 235 | env 236 | ); 237 | 238 | return this._evalFunctionBody(fn.body, activationEnvironment); 239 | } 240 | 241 | _evalFunctionBody(body, env) { 242 | // avoid handling the blocks in a function incorrectly 243 | if (body[0] === 'block') { 244 | return this._evalBlock(body, env); 245 | } 246 | return this.eval(body, env); 247 | } 248 | 249 | _evalBlock(block, env) { 250 | let result; 251 | const [_tag, ...expressions] = block; 252 | expressions.forEach((exp) => { 253 | result = this.eval(exp, env); 254 | }); 255 | 256 | return result; 257 | } 258 | 259 | _isNumber(exp) { 260 | if (typeof exp === 'string') { 261 | return /^-\d+$/.test(exp); 262 | } 263 | return typeof exp === 'number'; 264 | } 265 | 266 | _isString(exp) { 267 | return typeof exp === 'string' && exp[0] === '"' && exp.slice(-1) === '"'; 268 | } 269 | 270 | _isUndefined(exp) { 271 | return exp === undefined; 272 | } 273 | 274 | _isVariableName(exp) { 275 | return typeof exp === 'string' && (/^[+\-*/<>=a-zA-Z0-9_]*$/.test(exp)); 276 | } 277 | } 278 | 279 | const nighta = new Nighta(new Environment({ 280 | null: null, 281 | true: true, 282 | false: false, 283 | undefined: undefined, 284 | '+': (v1, v2) => v1 + v2, 285 | '-': (v1, v2) => v1 - v2, 286 | '*': (v1, v2) => v1 * v2, 287 | '/': (v1, v2) => v1 / v2, 288 | '%': (v1, v2) => v1 % v2, 289 | '>': (v1, v2) => v1 > v2, 290 | '>=': (v1, v2) => v1 >= v2, 291 | '==': (v1, v2) => v1 === v2, 292 | '<=': (v1, v2) => v1 <= v2, 293 | '<': (v1, v2) => v1 < v2, 294 | '&&': (v1, v2) => v1 && v2, 295 | '||': (v1, v2) => v1 || v2, 296 | '&': (v1, v2) => v1 & v2, 297 | '|': (v1, v2) => v1 | v2, 298 | integer: (num) => Math.floor(num), 299 | say: (...args) => { 300 | let res; 301 | if (args.length > 1) { 302 | res = args.reduce((prev, cur) => prev + cur, ''); 303 | console.log(res); 304 | } else { 305 | // if (args[0].record) { 306 | // res = args[0].record; 307 | // } else { 308 | res = args?.[0]; 309 | // } 310 | console.dir(res, { depth: 3 }); 311 | } 312 | return res; 313 | }, 314 | })); 315 | 316 | const List = nighta.eval(nighta.parse(`(class List null { 317 | (fun constructor (len) { 318 | (self["len"] = len) 319 | (var i 0) 320 | (while (i < len) { 321 | (self[i] = 0) 322 | (i = (i + 1)) 323 | }) 324 | }) 325 | 326 | (fun push (item) { 327 | (self[self["len"]] = item) 328 | (self["len"] = (self["len"] + 1)) 329 | }) 330 | 331 | (fun pop () { 332 | (self[self["len"]] = undefined) 333 | (self["len"] = (self["len"] - 1)) 334 | }) 335 | 336 | (fun shift () { 337 | (var i 0) 338 | (while (i < (self["len"] - 1)) { 339 | (self[i] = self[(i + 1)]) 340 | (i = (i + 1)) 341 | }) 342 | (self[self["len"]] = undefined) 343 | (self["len"] = (self["len"] - 1)) 344 | }) 345 | 346 | (fun unshift (item) { 347 | (self["len"] = (self["len"] + 1)) 348 | (var i self["len"]) 349 | (while (i > 0) { 350 | (self[i] = self[(i - 1)]) 351 | (i = (i - 1)) 352 | }) 353 | (self[0] = item) 354 | }) 355 | 356 | (fun map (callback) { 357 | (var _mapCounter 0) 358 | (while (_mapCounter < self["len"]) { 359 | (callback self[_mapCounter] _mapCounter) 360 | (_mapCounter = (1 + _mapCounter)) 361 | }) 362 | }) 363 | }) 364 | `), nighta.global); 365 | 366 | nighta.global.define("List", List); 367 | 368 | 369 | module.exports = nighta; -------------------------------------------------------------------------------- /src/environment/Environment.js: -------------------------------------------------------------------------------- 1 | class Environment { 2 | constructor(record = {}, parent = null) { 3 | this.record = record; 4 | this.parent = parent; 5 | } 6 | 7 | define(name, value) { 8 | this.record[name] = value; 9 | return value; 10 | } 11 | 12 | lookUp(name) { 13 | return this.resolve(name).record[name]; 14 | } 15 | 16 | resolve(name) { 17 | if (this.record.hasOwnProperty(name)) { 18 | return this; 19 | } 20 | if (this.parent === null) { 21 | throw new ReferenceError(`Variable or property ${name} is not defined.`); 22 | } 23 | 24 | return this.parent.resolve(name); 25 | } 26 | 27 | assign(name, value) { 28 | this.resolve(name).record[name] = value; 29 | return value; 30 | } 31 | } 32 | 33 | module.exports = Environment; -------------------------------------------------------------------------------- /src/parser/Parser.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const grammar = require('./grammar'); 3 | 4 | const EMPTY_EXPECTED = 'HERE_IS_NO_EXPECTED, WHY?'; 5 | 6 | class Parser { 7 | constructor(nighta,) { 8 | this.nighta = nighta; 9 | } 10 | 11 | parse(code) { 12 | const exp = grammar.parse(code); 13 | return exp; 14 | } 15 | 16 | parseTest(code, expected = EMPTY_EXPECTED) { 17 | const exp = this.parse(code); 18 | if (expected === EMPTY_EXPECTED) { 19 | assert.doesNotThrow(() => this.nighta.eval(exp)); 20 | } else { 21 | assert.strictEqual(this.nighta.eval(exp), expected); 22 | } 23 | } 24 | } 25 | 26 | module.exports = Parser; -------------------------------------------------------------------------------- /src/parser/gen.ps1: -------------------------------------------------------------------------------- 1 | syntax-cli --grammar grammar.bnf --mode LALR1 --output grammar.js -------------------------------------------------------------------------------- /src/parser/grammar.bnf: -------------------------------------------------------------------------------- 1 | // lexical grammer —————— tokenizor 2 | %lex 3 | %% 4 | 5 | \s+ /* 忽略空白字符 */ 6 | 7 | \"([^\"\\]*(\\.[^\"\\]*)*)\" return 'STRING' /* 匹配以双引号包围的字符串,允许内部的转义字符 */ 8 | 9 | \d+ return 'NUMBER' /* 数字串 */ 10 | 11 | [\w\-+*=<>/]+ return 'SYMBOL' /* 符号 */ 12 | 13 | \{ return 'LBRACE' 14 | \} return 'RBRACE' 15 | 16 | /lex 17 | 18 | 19 | 20 | 21 | // syntactic grammer —————— BNF 22 | %% 23 | Exp 24 | : Atom 25 | | List 26 | | Block 27 | | PropertyInvoke 28 | ; 29 | 30 | Atom 31 | : NUMBER { $$ = Number($1) } 32 | | STRING 33 | | SYMBOL 34 | ; 35 | 36 | List 37 | : '(' ListEntries ')' { $$ = $2 } 38 | ; 39 | 40 | ListEntries 41 | : ListEntries Exp { $1.push($2); $$ = $1 } 42 | | /* empty */ { $$ = [] } 43 | ; 44 | 45 | Block 46 | : '{' BlockEntries '}' { $2.unshift("block"); $$ = $2 } 47 | ; 48 | 49 | BlockEntries 50 | : BlockEntries Exp { $1.push($2); $$ = $1 } 51 | | /* empty */ { $$ = [] } 52 | ; 53 | 54 | PropertyInvoke 55 | : Atom '[' Exp ']' { $$ = ["prop", $1, $3] } 56 | ; 57 | -------------------------------------------------------------------------------- /src/parser/grammar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * LR parser generated by the Syntax tool. 3 | * 4 | * https://www.npmjs.com/package/syntax-cli 5 | * 6 | * npm install -g syntax-cli 7 | * 8 | * syntax-cli --help 9 | * 10 | * To regenerate run: 11 | * 12 | * syntax-cli \ 13 | * --grammar ~/path-to-grammar-file \ 14 | * --mode \ 15 | * --output ~/path-to-output-parser-file.js 16 | */ 17 | 18 | 'use strict'; 19 | 20 | /** 21 | * Matched token text. 22 | */ 23 | let yytext; 24 | 25 | /** 26 | * Length of the matched token text. 27 | */ 28 | let yyleng; 29 | 30 | /** 31 | * Storage object. 32 | */ 33 | let yy = {}; 34 | 35 | /** 36 | * Result of semantic action. 37 | */ 38 | let __; 39 | 40 | /** 41 | * Result location object. 42 | */ 43 | let __loc; 44 | 45 | function yyloc(start, end) { 46 | if (!yy.options.captureLocations) { 47 | return null; 48 | } 49 | 50 | // Epsilon doesn't produce location. 51 | if (!start || !end) { 52 | return start || end; 53 | } 54 | 55 | return { 56 | startOffset: start.startOffset, 57 | endOffset: end.endOffset, 58 | startLine: start.startLine, 59 | endLine: end.endLine, 60 | startColumn: start.startColumn, 61 | endColumn: end.endColumn, 62 | }; 63 | } 64 | 65 | const EOF = '$'; 66 | 67 | /** 68 | * List of productions (generated by Syntax tool). 69 | */ 70 | const productions = [[-1,1,(_1) => { __ = _1 }], 71 | [0,1,(_1) => { __ = _1 }], 72 | [0,1,(_1) => { __ = _1 }], 73 | [0,1,(_1) => { __ = _1 }], 74 | [0,1,(_1) => { __ = _1 }], 75 | [1,1,(_1) => { __ = Number(_1) }], 76 | [1,1,(_1) => { __ = _1 }], 77 | [1,1,(_1) => { __ = _1 }], 78 | [2,3,(_1,_2,_3) => { __ = _2 }], 79 | [3,2,(_1,_2) => { _1.push(_2); __ = _1 }], 80 | [3,0,() => { __ = [] }], 81 | [4,3,(_1,_2,_3) => { _2.unshift("block"); __ = _2 }], 82 | [5,2,(_1,_2) => { _1.push(_2); __ = _1 }], 83 | [5,0,() => { __ = [] }], 84 | [6,4,(_1,_2,_3,_4) => { __ = ["prop", _1, _3] }]]; 85 | 86 | /** 87 | * Encoded tokens map. 88 | */ 89 | const tokens = {"NUMBER":"7","STRING":"8","SYMBOL":"9","'('":"10","')'":"11","'{'":"12","'}'":"13","'['":"14","']'":"15","$":"16"}; 90 | 91 | /** 92 | * Parsing table (generated by Syntax tool). 93 | */ 94 | const table = [{"0":1,"1":2,"2":3,"4":4,"6":5,"7":"s6","8":"s7","9":"s8","10":"s9","12":"s10"},{"16":"acc"},{"7":"r1","8":"r1","9":"r1","10":"r1","11":"r1","12":"r1","13":"r1","14":"s11","15":"r1","16":"r1"},{"7":"r2","8":"r2","9":"r2","10":"r2","11":"r2","12":"r2","13":"r2","15":"r2","16":"r2"},{"7":"r3","8":"r3","9":"r3","10":"r3","11":"r3","12":"r3","13":"r3","15":"r3","16":"r3"},{"7":"r4","8":"r4","9":"r4","10":"r4","11":"r4","12":"r4","13":"r4","15":"r4","16":"r4"},{"7":"r5","8":"r5","9":"r5","10":"r5","11":"r5","12":"r5","13":"r5","14":"r5","15":"r5","16":"r5"},{"7":"r6","8":"r6","9":"r6","10":"r6","11":"r6","12":"r6","13":"r6","14":"r6","15":"r6","16":"r6"},{"7":"r7","8":"r7","9":"r7","10":"r7","11":"r7","12":"r7","13":"r7","14":"r7","15":"r7","16":"r7"},{"3":14,"7":"r10","8":"r10","9":"r10","10":"r10","11":"r10","12":"r10"},{"5":17,"7":"r13","8":"r13","9":"r13","10":"r13","12":"r13","13":"r13"},{"0":12,"1":2,"2":3,"4":4,"6":5,"7":"s6","8":"s7","9":"s8","10":"s9","12":"s10"},{"15":"s13"},{"7":"r14","8":"r14","9":"r14","10":"r14","11":"r14","12":"r14","13":"r14","15":"r14","16":"r14"},{"0":16,"1":2,"2":3,"4":4,"6":5,"7":"s6","8":"s7","9":"s8","10":"s9","11":"s15","12":"s10"},{"7":"r8","8":"r8","9":"r8","10":"r8","11":"r8","12":"r8","13":"r8","15":"r8","16":"r8"},{"7":"r9","8":"r9","9":"r9","10":"r9","11":"r9","12":"r9"},{"0":19,"1":2,"2":3,"4":4,"6":5,"7":"s6","8":"s7","9":"s8","10":"s9","12":"s10","13":"s18"},{"7":"r11","8":"r11","9":"r11","10":"r11","11":"r11","12":"r11","13":"r11","15":"r11","16":"r11"},{"7":"r12","8":"r12","9":"r12","10":"r12","12":"r12","13":"r12"}]; 95 | 96 | /** 97 | * Parsing stack. 98 | */ 99 | const stack = []; 100 | 101 | /** 102 | * Tokenizer instance. 103 | */ 104 | let tokenizer; 105 | /** 106 | * Generic tokenizer used by the parser in the Syntax tool. 107 | * 108 | * https://www.npmjs.com/package/syntax-cli 109 | * 110 | * See `--custom-tokinzer` to skip this generation, and use a custom one. 111 | */ 112 | 113 | const lexRules = [[/^\(/, function() { return "'('"; }], 114 | [/^\)/, function() { return "')'"; }], 115 | [/^\{/, function() { return "'{'"; }], 116 | [/^\}/, function() { return "'}'"; }], 117 | [/^\[/, function() { return "'['"; }], 118 | [/^\]/, function() { return "']'"; }], 119 | [/^\s+/, function() { /* 忽略空白字符 */ }], 120 | [/^"([^\"\\]*(\\.[^\"\\]*)*)"/, function() { return 'STRING' /* 匹配以双引号包围的字符串,允许内部的转义字符 */ }], 121 | [/^\d+/, function() { return 'NUMBER' /* 数字串 */ }], 122 | [/^[\w\-+*=<>/]+/, function() { return 'SYMBOL' /* 符号 */ }], 123 | [/^\{/, function() { return 'LBRACE' }], 124 | [/^\}/, function() { return 'RBRACE' }]]; 125 | const lexRulesByConditions = {"INITIAL":[0,1,2,3,4,5,6,7,8,9,10,11]}; 126 | 127 | const EOF_TOKEN = { 128 | type: EOF, 129 | value: '', 130 | }; 131 | 132 | tokenizer = { 133 | initString(string) { 134 | this._string = string; 135 | this._cursor = 0; 136 | 137 | this._states = ['INITIAL']; 138 | this._tokensQueue = []; 139 | 140 | this._currentLine = 1; 141 | this._currentColumn = 0; 142 | this._currentLineBeginOffset = 0; 143 | 144 | /** 145 | * Matched token location data. 146 | */ 147 | this._tokenStartOffset = 0; 148 | this._tokenEndOffset = 0; 149 | this._tokenStartLine = 1; 150 | this._tokenEndLine = 1; 151 | this._tokenStartColumn = 0; 152 | this._tokenEndColumn = 0; 153 | 154 | return this; 155 | }, 156 | 157 | /** 158 | * Returns tokenizer states. 159 | */ 160 | getStates() { 161 | return this._states; 162 | }, 163 | 164 | getCurrentState() { 165 | return this._states[this._states.length - 1]; 166 | }, 167 | 168 | pushState(state) { 169 | this._states.push(state); 170 | }, 171 | 172 | begin(state) { 173 | this.pushState(state); 174 | }, 175 | 176 | popState() { 177 | if (this._states.length > 1) { 178 | return this._states.pop(); 179 | } 180 | return this._states[0]; 181 | }, 182 | 183 | getNextToken() { 184 | // Something was queued, return it. 185 | if (this._tokensQueue.length > 0) { 186 | return this.onToken(this._toToken(this._tokensQueue.shift())); 187 | } 188 | 189 | if (!this.hasMoreTokens()) { 190 | return this.onToken(EOF_TOKEN); 191 | } 192 | 193 | let string = this._string.slice(this._cursor); 194 | let lexRulesForState = lexRulesByConditions[this.getCurrentState()]; 195 | 196 | for (let i = 0; i < lexRulesForState.length; i++) { 197 | let lexRuleIndex = lexRulesForState[i]; 198 | let lexRule = lexRules[lexRuleIndex]; 199 | 200 | let matched = this._match(string, lexRule[0]); 201 | 202 | // Manual handling of EOF token (the end of string). Return it 203 | // as `EOF` symbol. 204 | if (string === '' && matched === '') { 205 | this._cursor++; 206 | } 207 | 208 | if (matched !== null) { 209 | yytext = matched; 210 | yyleng = yytext.length; 211 | let token = lexRule[1].call(this); 212 | 213 | if (!token) { 214 | return this.getNextToken(); 215 | } 216 | 217 | // If multiple tokens are returned, save them to return 218 | // on next `getNextToken` call. 219 | 220 | if (Array.isArray(token)) { 221 | const tokensToQueue = token.slice(1); 222 | token = token[0]; 223 | if (tokensToQueue.length > 0) { 224 | this._tokensQueue.unshift(...tokensToQueue); 225 | } 226 | } 227 | 228 | return this.onToken(this._toToken(token, yytext)); 229 | } 230 | } 231 | 232 | if (this.isEOF()) { 233 | this._cursor++; 234 | return EOF_TOKEN; 235 | } 236 | 237 | this.throwUnexpectedToken( 238 | string[0], 239 | this._currentLine, 240 | this._currentColumn 241 | ); 242 | }, 243 | 244 | /** 245 | * Throws default "Unexpected token" exception, showing the actual 246 | * line from the source, pointing with the ^ marker to the bad token. 247 | * In addition, shows `line:column` location. 248 | */ 249 | throwUnexpectedToken(symbol, line, column) { 250 | const lineSource = this._string.split('\n')[line - 1]; 251 | let lineData = ''; 252 | 253 | if (lineSource) { 254 | const pad = ' '.repeat(column); 255 | lineData = '\n\n' + lineSource + '\n' + pad + '^\n'; 256 | } 257 | 258 | throw new SyntaxError( 259 | `${lineData}Unexpected token: "${symbol}" ` + 260 | `at ${line}:${column}.` 261 | ); 262 | }, 263 | 264 | getCursor() { 265 | return this._cursor; 266 | }, 267 | 268 | getCurrentLine() { 269 | return this._currentLine; 270 | }, 271 | 272 | getCurrentColumn() { 273 | return this._currentColumn; 274 | }, 275 | 276 | _captureLocation(matched) { 277 | const nlRe = /\n/g; 278 | 279 | // Absolute offsets. 280 | this._tokenStartOffset = this._cursor; 281 | 282 | // Line-based locations, start. 283 | this._tokenStartLine = this._currentLine; 284 | this._tokenStartColumn = 285 | this._tokenStartOffset - this._currentLineBeginOffset; 286 | 287 | // Extract `\n` in the matched token. 288 | let nlMatch; 289 | while ((nlMatch = nlRe.exec(matched)) !== null) { 290 | this._currentLine++; 291 | this._currentLineBeginOffset = this._tokenStartOffset + nlMatch.index + 1; 292 | } 293 | 294 | this._tokenEndOffset = this._cursor + matched.length; 295 | 296 | // Line-based locations, end. 297 | this._tokenEndLine = this._currentLine; 298 | this._tokenEndColumn = this._currentColumn = 299 | (this._tokenEndOffset - this._currentLineBeginOffset); 300 | }, 301 | 302 | _toToken(tokenType, yytext = '') { 303 | return { 304 | // Basic data. 305 | type: tokenType, 306 | value: yytext, 307 | 308 | // Location data. 309 | startOffset: this._tokenStartOffset, 310 | endOffset: this._tokenEndOffset, 311 | startLine: this._tokenStartLine, 312 | endLine: this._tokenEndLine, 313 | startColumn: this._tokenStartColumn, 314 | endColumn: this._tokenEndColumn, 315 | }; 316 | }, 317 | 318 | isEOF() { 319 | return this._cursor === this._string.length; 320 | }, 321 | 322 | hasMoreTokens() { 323 | return this._cursor <= this._string.length; 324 | }, 325 | 326 | _match(string, regexp) { 327 | let matched = string.match(regexp); 328 | if (matched) { 329 | // Handle `\n` in the matched token to track line numbers. 330 | this._captureLocation(matched[0]); 331 | this._cursor += matched[0].length; 332 | return matched[0]; 333 | } 334 | return null; 335 | }, 336 | 337 | /** 338 | * Allows analyzing, and transforming token. Default implementation 339 | * just passes the token through. 340 | */ 341 | onToken(token) { 342 | return token; 343 | }, 344 | }; 345 | 346 | /** 347 | * Expose tokenizer so it can be accessed in semantic actions. 348 | */ 349 | yy.lexer = tokenizer; 350 | yy.tokenizer = tokenizer; 351 | 352 | /** 353 | * Global parsing options. Some options can be shadowed per 354 | * each `parse` call, if the optations are passed. 355 | * 356 | * Initalized to the `captureLocations` which is passed 357 | * from the generator. Other options can be added at runtime. 358 | */ 359 | yy.options = { 360 | captureLocations: false, 361 | }; 362 | 363 | /** 364 | * Parsing module. 365 | */ 366 | const yyparse = { 367 | /** 368 | * Sets global parsing options. 369 | */ 370 | setOptions(options) { 371 | yy.options = options; 372 | return this; 373 | }, 374 | 375 | /** 376 | * Returns parsing options. 377 | */ 378 | getOptions() { 379 | return yy.options; 380 | }, 381 | 382 | /** 383 | * Parses a string. 384 | */ 385 | parse(string, parseOptions) { 386 | if (!tokenizer) { 387 | throw new Error(`Tokenizer instance wasn't specified.`); 388 | } 389 | 390 | tokenizer.initString(string); 391 | 392 | /** 393 | * If parse options are passed, override global parse options for 394 | * this call, and later restore global options. 395 | */ 396 | let globalOptions = yy.options; 397 | if (parseOptions) { 398 | yy.options = Object.assign({}, yy.options, parseOptions); 399 | } 400 | 401 | /** 402 | * Allow callers to do setup work based on the 403 | * parsing string, and passed options. 404 | */ 405 | yyparse.onParseBegin(string, tokenizer, yy.options); 406 | 407 | stack.length = 0; 408 | stack.push(0); 409 | 410 | let token = tokenizer.getNextToken(); 411 | let shiftedToken = null; 412 | 413 | do { 414 | if (!token) { 415 | // Restore options. 416 | yy.options = globalOptions; 417 | unexpectedEndOfInput(); 418 | } 419 | 420 | let state = stack[stack.length - 1]; 421 | let column = tokens[token.type]; 422 | 423 | if (!table[state].hasOwnProperty(column)) { 424 | yy.options = globalOptions; 425 | unexpectedToken(token); 426 | } 427 | 428 | let entry = table[state][column]; 429 | 430 | // Shift action. 431 | if (entry[0] === 's') { 432 | let loc = null; 433 | 434 | if (yy.options.captureLocations) { 435 | loc = { 436 | startOffset: token.startOffset, 437 | endOffset: token.endOffset, 438 | startLine: token.startLine, 439 | endLine: token.endLine, 440 | startColumn: token.startColumn, 441 | endColumn: token.endColumn, 442 | }; 443 | } 444 | 445 | shiftedToken = this.onShift(token); 446 | 447 | stack.push( 448 | {symbol: tokens[shiftedToken.type], semanticValue: shiftedToken.value, loc}, 449 | Number(entry.slice(1)) 450 | ); 451 | 452 | token = tokenizer.getNextToken(); 453 | } 454 | 455 | // Reduce action. 456 | else if (entry[0] === 'r') { 457 | let productionNumber = entry.slice(1); 458 | let production = productions[productionNumber]; 459 | let hasSemanticAction = typeof production[2] === 'function'; 460 | let semanticValueArgs = hasSemanticAction ? [] : null; 461 | 462 | const locationArgs = ( 463 | hasSemanticAction && yy.options.captureLocations 464 | ? [] 465 | : null 466 | ); 467 | 468 | if (production[1] !== 0) { 469 | let rhsLength = production[1]; 470 | while (rhsLength-- > 0) { 471 | stack.pop(); 472 | let stackEntry = stack.pop(); 473 | 474 | if (hasSemanticAction) { 475 | semanticValueArgs.unshift(stackEntry.semanticValue); 476 | 477 | if (locationArgs) { 478 | locationArgs.unshift(stackEntry.loc); 479 | } 480 | } 481 | } 482 | } 483 | 484 | const reduceStackEntry = {symbol: production[0]}; 485 | 486 | if (hasSemanticAction) { 487 | yytext = shiftedToken ? shiftedToken.value : null; 488 | yyleng = shiftedToken ? shiftedToken.value.length : null; 489 | 490 | const semanticActionArgs = ( 491 | locationArgs !== null 492 | ? semanticValueArgs.concat(locationArgs) 493 | : semanticValueArgs 494 | ); 495 | 496 | production[2](...semanticActionArgs); 497 | 498 | reduceStackEntry.semanticValue = __; 499 | 500 | if (locationArgs) { 501 | reduceStackEntry.loc = __loc; 502 | } 503 | } 504 | 505 | const nextState = stack[stack.length - 1]; 506 | const symbolToReduceWith = production[0]; 507 | 508 | stack.push( 509 | reduceStackEntry, 510 | table[nextState][symbolToReduceWith] 511 | ); 512 | } 513 | 514 | // Accept. 515 | else if (entry === 'acc') { 516 | stack.pop(); 517 | let parsed = stack.pop(); 518 | 519 | if (stack.length !== 1 || 520 | stack[0] !== 0 || 521 | tokenizer.hasMoreTokens()) { 522 | // Restore options. 523 | yy.options = globalOptions; 524 | unexpectedToken(token); 525 | } 526 | 527 | if (parsed.hasOwnProperty('semanticValue')) { 528 | yy.options = globalOptions; 529 | yyparse.onParseEnd(parsed.semanticValue); 530 | return parsed.semanticValue; 531 | } 532 | 533 | yyparse.onParseEnd(); 534 | 535 | // Restore options. 536 | yy.options = globalOptions; 537 | return true; 538 | } 539 | 540 | } while (tokenizer.hasMoreTokens() || stack.length > 1); 541 | }, 542 | 543 | setTokenizer(customTokenizer) { 544 | tokenizer = customTokenizer; 545 | return yyparse; 546 | }, 547 | 548 | getTokenizer() { 549 | return tokenizer; 550 | }, 551 | 552 | onParseBegin(string, tokenizer, options) {}, 553 | onParseEnd(parsed) {}, 554 | 555 | /** 556 | * Allows analyzing, and transforming shifted token. Default implementation 557 | * just passes the token through. 558 | */ 559 | onShift(token) { 560 | return token; 561 | }, 562 | }; 563 | 564 | 565 | 566 | function unexpectedToken(token) { 567 | if (token.type === EOF) { 568 | unexpectedEndOfInput(); 569 | } 570 | 571 | tokenizer.throwUnexpectedToken( 572 | token.value, 573 | token.startLine, 574 | token.startColumn 575 | ); 576 | } 577 | 578 | function unexpectedEndOfInput() { 579 | parseError(`Unexpected end of input.`); 580 | } 581 | 582 | function parseError(message) { 583 | throw new SyntaxError(message); 584 | } 585 | 586 | module.exports = yyparse; 587 | -------------------------------------------------------------------------------- /src/test/block-test.js: -------------------------------------------------------------------------------- 1 | const assert = require("assert"); 2 | const Parser = require('../parser/Parser'); 3 | 4 | module.exports = (nighta) => { 5 | const parser = new Parser(nighta); 6 | assert.strictEqual(nighta.eval( 7 | ['block', 8 | ['var', 'x', 10], 9 | ['var', 'y', 20], 10 | ['+', ['*', 'x', 'y'], 30], 11 | ], 12 | ), 230); 13 | assert.strictEqual(nighta.eval( 14 | ['block', 15 | ['var', 'x', 10], 16 | ['block', 17 | ['var', 'x', 20], 18 | 'x' 19 | ], 20 | 'x' 21 | ], 22 | ), 10); 23 | assert.strictEqual(nighta.eval( 24 | ['block', 25 | ['var', 'x', 10], 26 | ['var', 'sum', 27 | ['block', 28 | ['var', 'y', ['+', 'x', 20]], 29 | 'y' 30 | ], 31 | ], 32 | 'sum' 33 | ], 34 | ), 30); 35 | assert.strictEqual(nighta.eval( 36 | ['block', 37 | ['var', 'x', 10], 38 | ['block', 39 | ['x', '=', ['+', 100, 900]], 40 | ], 41 | 'x' 42 | ], 43 | ), 1000); 44 | parser.parseTest( 45 | ` 46 | { 47 | (var x 10) 48 | (var y "86") 49 | ((x * 10) + y) 50 | } 51 | `, 52 | "10086" 53 | ); 54 | parser.parseTest( 55 | ` 56 | { 57 | (var x 1) 58 | (var y "24") 59 | ((x * 10) + y) 60 | } 61 | `, 62 | "1024" 63 | ); 64 | }; -------------------------------------------------------------------------------- /src/test/build-in-function-test.js: -------------------------------------------------------------------------------- 1 | const Parser = require('../parser/Parser'); 2 | 3 | module.exports = (nighta) => { 4 | new Parser(nighta).parseTest( 5 | ` 6 | { 7 | (var msg1 "Hello,") 8 | (var msg2 "World!") 9 | (say (msg1 + msg2)) 10 | } 11 | `, 12 | ); 13 | }; -------------------------------------------------------------------------------- /src/test/class-test.js: -------------------------------------------------------------------------------- 1 | const Parser = require('../parser/Parser'); 2 | 3 | module.exports = (nighta) => { 4 | const parser = new Parser(nighta); 5 | parser.parseTest( 6 | ` 7 | (block 8 | (class Person null { 9 | (fun constructor (x y) { 10 | (say "constructor!") 11 | (self["x"] = x) 12 | (self["y"] = y) 13 | (self["sum"] = sum) 14 | } 15 | ) 16 | 17 | (fun sum () { 18 | (var res (x + y) ) 19 | (var msg "The res is ") 20 | (say msg res) 21 | }) 22 | } 23 | ) 24 | 25 | (var person (new Person 10 20)) 26 | (person["sum"]) 27 | ) 28 | ` 29 | ); 30 | 31 | parser.parseTest( 32 | ` 33 | (block 34 | (class Person null 35 | (block 36 | (fun constructor (x) 37 | (self["x"] = x) 38 | ) 39 | ) 40 | ) 41 | 42 | (var person1 (new Person 1)) 43 | (var person2 (new Person 2)) 44 | (say person1["x"]) 45 | (say person2["x"]) 46 | (say person1["x"]) 47 | (person1["x"] = 3) 48 | (say person1["x"]) 49 | (say person2["x"]) 50 | ) 51 | ` 52 | ); 53 | 54 | // Individual instance and its property 55 | parser.parseTest( 56 | ` 57 | { 58 | (class Person null { 59 | (fun constructor (x) 60 | (self["x"] = x) 61 | ) 62 | 63 | (fun info () { 64 | (say x) 65 | }) 66 | }) 67 | (say "-----") 68 | (var person1 (new Person 1)) 69 | (var person2 (new Person 2)) 70 | (person1["info"]) 71 | (person2["info"]) 72 | } 73 | ` 74 | ); 75 | 76 | parser.parseTest( 77 | ` 78 | { 79 | (class Person null { 80 | (fun constructor (num) { 81 | }) 82 | (fun info () { 83 | (say "This is OOP: " self["num"]) 84 | }) 85 | }) 86 | 87 | (class Worker Person { 88 | (fun constructor (num) { 89 | (self["num"] = num) 90 | }) 91 | }) 92 | 93 | (var worker (new Worker 12345)) 94 | (worker["info"]) 95 | } 96 | ` 97 | ); 98 | 99 | 100 | parser.parseTest( 101 | ` 102 | { 103 | (class Person null { 104 | (fun constructor () {}) 105 | 106 | (fun get () { 107 | (say "This is OOP: " self[key]) 108 | }) 109 | 110 | (fun set (key value) { 111 | (self[key] = value) 112 | (say "property name: " self[key]) 113 | }) 114 | }) 115 | 116 | (class Worker Person { 117 | (fun constructor () {}) 118 | }) 119 | 120 | (var worker (new Worker)) 121 | (worker["set"] "name" "good boy") 122 | } 123 | ` 124 | ); 125 | 126 | parser.parseTest( 127 | ` 128 | { 129 | (var arr (new List 10)) 130 | 131 | (fun iterator () { 132 | (arr["map"] 133 | (fun (item index) { 134 | (say "arr[" index "] -----> " arr[index]) 135 | }) 136 | ) 137 | }) 138 | 139 | (arr["push"] "one") 140 | (arr["push"] "two") 141 | (arr["pop"]) 142 | (arr["unshift"] "one") 143 | (arr["unshift"] "two") 144 | (arr["shift"]) 145 | 146 | (iterator) 147 | } 148 | ` 149 | ); 150 | 151 | parser.parseTest(` 152 | { 153 | (var list (new List 100)) 154 | } 155 | `); 156 | }; -------------------------------------------------------------------------------- /src/test/eval-test.js: -------------------------------------------------------------------------------- 1 | const assert = require("assert"); 2 | 3 | module.exports = (nighta) => { 4 | assert.strictEqual(nighta.eval(1), 1); 5 | assert.strictEqual(nighta.eval('"Hello"'), 'Hello'); 6 | }; -------------------------------------------------------------------------------- /src/test/if-test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const Parser = require('../parser/Parser'); 3 | 4 | module.exports = (nighta) => { 5 | const parser = new Parser(nighta); 6 | 7 | parser.parseTest( 8 | ` 9 | { 10 | (var x 100) 11 | (if (> x 100) 12 | (say "x is bigger than 100") 13 | (if (< x 100) 14 | (say "x is smaller than 100") 15 | (say "x is equal to 100") 16 | ) 17 | ) 18 | } 19 | `, 20 | ); 21 | 22 | parser.parseTest( 23 | ` 24 | { 25 | (var x 100) 26 | (if (> x 100) { 27 | (say "bigger") 28 | } { 29 | (say "smaller") 30 | }) 31 | } 32 | `, 33 | ); 34 | }; -------------------------------------------------------------------------------- /src/test/index.js: -------------------------------------------------------------------------------- 1 | const nighta = require('../Nighta'); 2 | 3 | const tests = [ 4 | require('./eval-test'), 5 | require('./math-test'), 6 | require('./variable-test'), 7 | require('./block-test'), 8 | require('./while-test'), 9 | require('./build-in-function-test'), 10 | require('./if-test'), 11 | require('./user-defined-function-test'), 12 | require('./lambda-function-test'), 13 | require('./switch-test'), 14 | require('./class-test') 15 | ]; 16 | 17 | tests.forEach((test) => { 18 | test(nighta); 19 | }); 20 | 21 | console.log('\n'); 22 | console.log('='.repeat(28)); 23 | console.log('✨ All Assertions Passed ✨'); 24 | console.log('='.repeat(28)); 25 | -------------------------------------------------------------------------------- /src/test/lambda-function-test.js: -------------------------------------------------------------------------------- 1 | const Parser = require('../parser/Parser'); 2 | 3 | module.exports = (nighta) => { 4 | const parser = new Parser(nighta); 5 | parser.parseTest( 6 | ` 7 | (block 8 | (fun onClick (callback) (block 9 | (block 10 | (callback) 11 | ) 12 | )) 13 | (onClick (fun () (say "Lambda function syntax is ok~"))) 14 | ) 15 | `, 16 | ); 17 | 18 | // IILE 19 | parser.parseTest( 20 | ` 21 | (block 22 | ( 23 | (fun (msg) (say msg)) 24 | "Lambda IIFE syntax is ok~" 25 | ) 26 | ) 27 | `, 28 | ); 29 | 30 | parser.parseTest( 31 | ` 32 | (block 33 | (var sayHi (fun (msg) (say msg))) 34 | (sayHi "Lambda function can also be used as variable~") 35 | ) 36 | `, 37 | ); 38 | }; -------------------------------------------------------------------------------- /src/test/math-test.js: -------------------------------------------------------------------------------- 1 | const assert = require("assert"); 2 | const Parser = require('../parser/Parser'); 3 | 4 | module.exports = (nighta) => { 5 | const parser = new Parser(nighta); 6 | // assert.strictEqual(nighta.eval(['+', 1, 2]), 3); 7 | // assert.strictEqual(nighta.eval(['+', ['+', 2, 2], ['+', 3, 3]]), 10); 8 | // assert.strictEqual(nighta.eval(['*', 4, 10]), 40); 9 | // assert.strictEqual(nighta.eval(['*', ['*', 2, 10], 10]), 200); 10 | // assert.strictEqual(nighta.eval(['-', 4, 10]), -6); 11 | // assert.strictEqual(nighta.eval(['-', ['-', 10, -1], 10]), 1); 12 | // assert.strictEqual(nighta.eval(['/', 4, 10]), 0.4); 13 | // assert.strictEqual(nighta.eval(['/', ['/', 10, 2], 10]), 0.5); 14 | parser.parseTest( 15 | ` 16 | { 17 | (var i -1) 18 | (say i) 19 | } 20 | `, 21 | ); 22 | parser.parseTest( 23 | ` 24 | (block 25 | (1 + (1 + 2)) 26 | ) 27 | `, 28 | 4 29 | ); 30 | parser.parseTest( 31 | ` 32 | (block 33 | (1 + (1 * 2)) 34 | ) 35 | `, 36 | 3 37 | ); 38 | parser.parseTest( 39 | ` 40 | { 41 | (var + ( 42 | fun (v1 v2) { 43 | (say v1 " say: [Hello] to " v2) 44 | }) 45 | ) 46 | ("You" + "World") 47 | } 48 | ` 49 | ); 50 | }; -------------------------------------------------------------------------------- /src/test/switch-test.js: -------------------------------------------------------------------------------- 1 | const Parser = require('../parser/Parser'); 2 | 3 | module.exports = (nighta) => { 4 | const parser = new Parser(nighta); 5 | parser.parseTest( 6 | ` 7 | (block 8 | (var x 100) 9 | (switch 10 | ((> x 100) "bigger") 11 | ((< x 100) "smaller") 12 | (default "equal") 13 | ) 14 | ) 15 | `, 16 | "equal" 17 | ); 18 | 19 | parser.parseTest( 20 | ` 21 | (block 22 | (var x 10) 23 | (switch 24 | ((> x 100) "bigger") 25 | ((< x 100) "smaller") 26 | (default "equal") 27 | ) 28 | ) 29 | `, 30 | "smaller" 31 | ); 32 | 33 | parser.parseTest( 34 | ` 35 | (block 36 | (var x 1000) 37 | (switch 38 | ((> x 100) "bigger") 39 | ((< x 100) "smaller") 40 | (default "equal") 41 | ) 42 | ) 43 | `, 44 | "bigger" 45 | ); 46 | }; -------------------------------------------------------------------------------- /src/test/user-defined-function-test.js: -------------------------------------------------------------------------------- 1 | const Parser = require('../parser/Parser'); 2 | 3 | module.exports = (nighta) => { 4 | const parser = new Parser(nighta); 5 | // parser.parseTest( 6 | // ` 7 | // (block 8 | // (fun square (x) 9 | // (* x x) 10 | // ) 11 | // (var y (square 2)) 12 | // (say y) 13 | // ) 14 | // `, 15 | // ); 16 | // parser.parseTest( 17 | // ` 18 | // (block 19 | // (fun square (x y) 20 | // (block 21 | // (var z 30) 22 | // (* (+ x y) z) 23 | // ) 24 | // ) 25 | // (square 10 2) 26 | // ) 27 | // `, 28 | // 360 29 | // ); 30 | // parser.parseTest( 31 | // ` 32 | // (block 33 | // (fun calc (x y) 34 | // (block 35 | // (fun sum (a b) (+ a b)) 36 | // (sum x y) 37 | // ) 38 | // ) 39 | // (calc 10 2) 40 | // ) 41 | // `, 42 | // 12 43 | // ); 44 | // parser.parseTest( 45 | // ` 46 | // (block 47 | // (fun sum (a b) (+ a b)) 48 | 49 | // (fun calc (callback x y) 50 | // (callback x y) 51 | // ) 52 | 53 | // (calc sum 10 2) 54 | // ) 55 | // `, 56 | // 12 57 | // ); 58 | // parser.parseTest( 59 | // ` 60 | // (block 61 | // (fun sayMsg (msg) 62 | // (block 63 | // (var str "Hi, ") 64 | // (say (+ str msg)) 65 | // ) 66 | // ) 67 | // (sayMsg "Nightaaaa") 68 | // ) 69 | // `, 70 | // ); 71 | // recursive 72 | parser.parseTest( 73 | ` 74 | (block 75 | (fun sum (x) 76 | (if (x == 10) 77 | (say "recursive " x) 78 | (sum (x + 1)) 79 | ) 80 | ) 81 | 82 | (sum 1) 83 | ) 84 | `, 85 | ); 86 | 87 | // parser.parseTest(` 88 | // { 89 | // (var list (new List 10)) 90 | 91 | // (list["map"] (fun (item index) { 92 | // (list[index] = (10 - index)) 93 | // })) 94 | 95 | // (fun iterator (arr) { 96 | // (var i 0) 97 | // (while (i < arr["len"]) { 98 | // (say "[" i "] ===>" arr[i]) 99 | // (i = (i + 1)) 100 | // }) 101 | // }) 102 | 103 | // (say "===original list===") 104 | // (iterator list) 105 | 106 | // (fun quickSort (arr) { 107 | // (if (arr["len"] > 1) { 108 | // (var left (new List 0)) 109 | // (var right (new List 0)) 110 | // (var mid arr[0]) 111 | 112 | // (var i 1) 113 | // (while (i < arr["len"]) { 114 | // (if (arr[i] < mid) { 115 | // (left["push"] arr[i]) 116 | // } { 117 | // (right["push"] arr[i]) 118 | // }) 119 | // (i = (i + 1)) 120 | // }) 121 | 122 | // (quickSort left) 123 | // (quickSort right) 124 | 125 | // (var orderedList (new List 0)) 126 | // (left["map"] (fun (item) { (orderedList["push"] item )})) 127 | // (orderedList["push"] mid) 128 | // (right["map"] (fun (item) { (orderedList["push"] item )})) 129 | 130 | // (say "===ordered list===") 131 | // (iterator orderedList) 132 | // } { 133 | // }) 134 | // }) 135 | 136 | // (var res (quickSort list)) 137 | // (say "res " res) 138 | // } 139 | // `); 140 | }; -------------------------------------------------------------------------------- /src/test/variable-test.js: -------------------------------------------------------------------------------- 1 | const assert = require("assert"); 2 | 3 | module.exports = (nighta) => { 4 | // assert.strictEqual(nighta.eval(['var', 'x', 10]), 10); 5 | // assert.strictEqual(nighta.eval('x'), 10); 6 | 7 | // assert.strictEqual(nighta.eval(['var', 'y', '"aaa"']), 'aaa'); 8 | // assert.strictEqual(nighta.eval('y'), 'aaa'); 9 | 10 | // assert.strictEqual(nighta.eval(['var', 'z', 'true']), true); 11 | // assert.strictEqual(nighta.eval('z'), true); 12 | 13 | // assert.strictEqual(nighta.eval(['var', 'a', ['+', 1, 3]]), 4); 14 | // assert.strictEqual(nighta.eval('a'), 4); 15 | }; -------------------------------------------------------------------------------- /src/test/while-test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const Parser = require('../parser/Parser'); 3 | 4 | module.exports = (nighta) => { 5 | const parser = new Parser(nighta); 6 | 7 | assert.strictEqual(nighta.eval([ 8 | 'block', 9 | ['var', 'counter', 0], 10 | ['var', 'result', 0], 11 | ['while', 12 | ['<=', 'counter', 10], 13 | ['block', 14 | ['result', '=', ['+', 'result', 'counter']], 15 | ['counter', '=', ['+', 'counter', 1]] 16 | ] 17 | ], 18 | 'result' 19 | ]), 20 | 55 21 | ); 22 | 23 | parser.parse(` 24 | { 25 | (var i 0) 26 | (while (i < 10) { 27 | (i = (i + 1)) 28 | }) 29 | } 30 | `); 31 | }; -------------------------------------------------------------------------------- /src/transformer/Transformer.js: -------------------------------------------------------------------------------- 1 | class Transformer { 2 | transformSwitch(exp) { 3 | const [_tag, ...cases] = exp; 4 | /* 5 | the AST structure of if: 6 | [ 7 | 'if', 8 | ['>=', 'x', 1], 9 | ['set', 'y', 1], 10 | ['set', 'y', 2], 11 | ], 12 | */ 13 | const ifAST = ['if', null, null, null]; 14 | let current = ifAST; 15 | for (let i = 0; i < cases.length - 1; i++) { 16 | const [currentCondition, currentBlock] = cases[i]; 17 | const [nextCondition, nextBlock] = cases[i + 1]; 18 | 19 | current[1] = currentCondition; 20 | current[2] = currentBlock; 21 | if (nextCondition === 'default') { 22 | current[3] = nextBlock; 23 | } else { 24 | current[3] = ['if', null, null, null]; 25 | } 26 | 27 | current = current[3]; 28 | } 29 | return ifAST; 30 | } 31 | } 32 | 33 | module.exports = Transformer; --------------------------------------------------------------------------------