@ykdz/template 0.0.42 → 0.1.0-experimental.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1250) hide show
  1. package/dist/application.d.ts +38 -4
  2. package/dist/application.js +199 -138
  3. package/dist/cli.js +0 -5
  4. package/dist/input-schemas.d.ts +14 -0
  5. package/dist/input-schemas.js +27 -8
  6. package/dist/input-validation.d.ts +43 -0
  7. package/dist/input-validation.js +129 -0
  8. package/dist/main.js +157 -6
  9. package/dist/preset-catalog.d.ts +36 -0
  10. package/dist/preset-catalog.js +41 -0
  11. package/dist/result-schemas.d.ts +63 -34
  12. package/dist/result-schemas.js +5 -4
  13. package/dist/standard-schema.d.ts +1 -1
  14. package/dist/standard-schema.js +1 -9
  15. package/node_modules/@types/node/README.md +1 -1
  16. package/node_modules/@types/node/package.json +2 -2
  17. package/node_modules/@types/node/util.d.ts +7 -4
  18. package/node_modules/@typescript/typescript-linux-x64/LICENSE +55 -0
  19. package/node_modules/@typescript/typescript-linux-x64/NOTICE.txt +436 -0
  20. package/node_modules/@typescript/typescript-linux-x64/README.md +3 -0
  21. package/node_modules/@typescript/typescript-linux-x64/lib/lib.d.ts +20 -0
  22. package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.d.ts +382 -0
  23. package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.legacy.d.ts +20 -0
  24. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.asynciterable.d.ts +18 -0
  25. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.d.ts +45125 -0
  26. package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.iterable.d.ts +18 -0
  27. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.collection.d.ts +159 -0
  28. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.core.d.ts +595 -0
  29. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.d.ts +26 -0
  30. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.generator.d.ts +75 -0
  31. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.iterable.d.ts +603 -0
  32. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.promise.d.ts +79 -0
  33. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.proxy.d.ts +126 -0
  34. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.reflect.d.ts +142 -0
  35. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.d.ts +44 -0
  36. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
  37. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.array.include.d.ts +114 -0
  38. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.d.ts +19 -0
  39. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.full.d.ts +21 -0
  40. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.intl.d.ts +29 -0
  41. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.arraybuffer.d.ts +19 -0
  42. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.d.ts +24 -0
  43. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.date.d.ts +29 -0
  44. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.full.d.ts +21 -0
  45. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.intl.d.ts +42 -0
  46. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.object.d.ts +47 -0
  47. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.sharedmemory.d.ts +133 -0
  48. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.string.d.ts +47 -0
  49. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.typedarrays.d.ts +51 -0
  50. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asyncgenerator.d.ts +75 -0
  51. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asynciterable.d.ts +51 -0
  52. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.d.ts +22 -0
  53. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.full.d.ts +22 -0
  54. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.intl.d.ts +81 -0
  55. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.promise.d.ts +28 -0
  56. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.regexp.d.ts +35 -0
  57. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.array.d.ts +77 -0
  58. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.d.ts +22 -0
  59. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.full.d.ts +22 -0
  60. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.intl.d.ts +21 -0
  61. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.object.d.ts +31 -0
  62. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.string.d.ts +35 -0
  63. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.symbol.d.ts +22 -0
  64. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.bigint.d.ts +763 -0
  65. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.d.ts +25 -0
  66. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.date.d.ts +40 -0
  67. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.full.d.ts +22 -0
  68. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.intl.d.ts +472 -0
  69. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.number.d.ts +26 -0
  70. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.promise.d.ts +45 -0
  71. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.sharedmemory.d.ts +97 -0
  72. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.string.d.ts +42 -0
  73. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
  74. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.d.ts +21 -0
  75. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.full.d.ts +22 -0
  76. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.intl.d.ts +164 -0
  77. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.promise.d.ts +46 -0
  78. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.string.d.ts +31 -0
  79. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.weakref.d.ts +76 -0
  80. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.array.d.ts +119 -0
  81. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.d.ts +23 -0
  82. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.error.d.ts +73 -0
  83. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.full.d.ts +22 -0
  84. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.intl.d.ts +143 -0
  85. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.object.d.ts +24 -0
  86. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.regexp.d.ts +37 -0
  87. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.string.d.ts +23 -0
  88. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.array.d.ts +922 -0
  89. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.collection.d.ts +19 -0
  90. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.d.ts +20 -0
  91. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.full.d.ts +22 -0
  92. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.intl.d.ts +62 -0
  93. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.arraybuffer.d.ts +63 -0
  94. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.collection.d.ts +27 -0
  95. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.d.ts +24 -0
  96. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.full.d.ts +22 -0
  97. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.object.d.ts +27 -0
  98. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.promise.d.ts +33 -0
  99. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.regexp.d.ts +23 -0
  100. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.sharedmemory.d.ts +66 -0
  101. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.string.d.ts +27 -0
  102. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.collection.d.ts +94 -0
  103. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.d.ts +23 -0
  104. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.float16.d.ts +443 -0
  105. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.full.d.ts +22 -0
  106. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.intl.d.ts +200 -0
  107. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.iterator.d.ts +146 -0
  108. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.promise.d.ts +32 -0
  109. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.regexp.d.ts +30 -0
  110. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es5.d.ts +4599 -0
  111. package/node_modules/@typescript/typescript-linux-x64/lib/lib.es6.d.ts +21 -0
  112. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.array.d.ts +33 -0
  113. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.collection.d.ts +47 -0
  114. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.d.ts +27 -0
  115. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.date.d.ts +21 -0
  116. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.decorators.d.ts +26 -0
  117. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.disposable.d.ts +191 -0
  118. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.error.d.ts +22 -0
  119. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.full.d.ts +22 -0
  120. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.intl.d.ts +107 -0
  121. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.sharedmemory.d.ts +23 -0
  122. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.temporal.d.ts +485 -0
  123. package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.typedarrays.d.ts +90 -0
  124. package/node_modules/@typescript/typescript-linux-x64/lib/lib.scripthost.d.ts +320 -0
  125. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.asynciterable.d.ts +18 -0
  126. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.d.ts +15606 -0
  127. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.importscripts.d.ts +21 -0
  128. package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.iterable.d.ts +18 -0
  129. package/node_modules/@typescript/typescript-linux-x64/lib/tsc +0 -0
  130. package/node_modules/@typescript/typescript-linux-x64/lib/tsc.sig +11 -0
  131. package/node_modules/@typescript/typescript-linux-x64/package.json +45 -0
  132. package/node_modules/@ykdz/cli-contract/dist/cli-contract.d.ts +689 -184
  133. package/node_modules/@ykdz/cli-contract/dist/cli-contract.js +816 -243
  134. package/node_modules/@ykdz/cli-contract/dist/cli-execution.d.ts +11 -7
  135. package/node_modules/@ykdz/cli-contract/dist/cli-execution.js +69 -22
  136. package/node_modules/@ykdz/cli-contract/dist/cli-invocation.d.ts +80 -31
  137. package/node_modules/@ykdz/cli-contract/dist/cli-invocation.js +84 -26
  138. package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.d.ts +40 -7
  139. package/node_modules/@ykdz/cli-contract/dist/contract-definition-error.js +28 -6
  140. package/node_modules/@ykdz/cli-contract/dist/contract-schema-compiler.js +17 -3
  141. package/node_modules/@ykdz/cli-contract/dist/contract-schema.d.ts +4 -0
  142. package/node_modules/@ykdz/cli-contract/dist/field-identity.d.ts +2 -0
  143. package/node_modules/@ykdz/cli-contract/dist/field-identity.js +16 -0
  144. package/node_modules/@ykdz/cli-contract/dist/index.d.ts +4 -3
  145. package/node_modules/@ykdz/cli-contract/dist/index.js +2 -2
  146. package/node_modules/@ykdz/cli-contract/dist/node.d.ts +1 -1
  147. package/node_modules/@ykdz/cli-contract/dist/node.js +1 -1
  148. package/node_modules/@ykdz/cli-contract/dist/outcome-fact.d.ts +42 -9
  149. package/node_modules/@ykdz/cli-contract/dist/outcome-fact.js +98 -24
  150. package/node_modules/@ykdz/cli-contract/dist/outcome-wire.d.ts +5 -5
  151. package/node_modules/@ykdz/cli-contract/dist/outcome-wire.js +75 -15
  152. package/node_modules/@ykdz/cli-contract/package.json +6 -5
  153. package/node_modules/@ykdz/preset-rust-bin/native/package.json +46 -0
  154. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts +43 -0
  155. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts.map +1 -0
  156. package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.js +21 -0
  157. package/node_modules/@ykdz/preset-rust-bin/package.json +20 -0
  158. package/node_modules/@ykdz/preset-ts-cli/native/package.json +48 -0
  159. package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts +23 -0
  160. package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts.map +1 -0
  161. package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.js +23 -0
  162. package/node_modules/@ykdz/preset-ts-cli/package.json +20 -0
  163. package/node_modules/@ykdz/preset-ts-lib/native/package.json +45 -0
  164. package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts +23 -0
  165. package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts.map +1 -0
  166. package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.js +21 -0
  167. package/node_modules/@ykdz/preset-ts-lib/package.json +20 -0
  168. package/node_modules/@ykdz/preset-vike-app/native/package.json +55 -0
  169. package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/Dockerfile +76 -0
  170. package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/container.dockerignore +11 -0
  171. package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → preset-vike-app/native/resources/deployment}/scripts/container-entrypoint.sh +0 -0
  172. package/node_modules/@ykdz/preset-vike-app/native/resources/deployment/setup-buildx-step.yml +3 -0
  173. package/node_modules/@ykdz/preset-vike-app/native/scripts/check-standalone-deployment.ts +570 -0
  174. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts +35 -0
  175. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts.map +1 -0
  176. package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.js +61 -0
  177. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts +20 -0
  178. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts.map +1 -0
  179. package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.js +277 -0
  180. package/node_modules/@ykdz/preset-vike-app/package.json +24 -0
  181. package/node_modules/@ykdz/preset-vue-app/native/package.json +44 -0
  182. package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts +23 -0
  183. package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts.map +1 -0
  184. package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.js +21 -0
  185. package/node_modules/@ykdz/preset-vue-app/package.json +20 -0
  186. package/node_modules/@ykdz/preset-vue-hono-app/native/package.json +50 -0
  187. package/node_modules/@ykdz/preset-vue-hono-app/native/resources/joint-e2e/playwright.config.ts +35 -0
  188. package/node_modules/@ykdz/preset-vue-hono-app/native/resources/joint-e2e/test/e2e/app.spec.ts +10 -0
  189. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts +33 -0
  190. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts.map +1 -0
  191. package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.js +129 -0
  192. package/node_modules/@ykdz/preset-vue-hono-app/package.json +21 -0
  193. package/node_modules/@ykdz/reference-hono-api/native/package.json +55 -0
  194. package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.d.ts +1 -0
  195. package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.js +33 -0
  196. package/node_modules/@ykdz/reference-hono-api/native/tsconfig.build.json +11 -0
  197. package/node_modules/@ykdz/reference-hono-api/native/tsconfig.json +15 -0
  198. package/node_modules/@ykdz/reference-hono-api/native/turbo.json +67 -0
  199. package/node_modules/@ykdz/reference-hono-api/package.json +19 -0
  200. package/node_modules/@ykdz/reference-npm-publication/native/.changeset/config.json +4 -0
  201. package/node_modules/@ykdz/reference-npm-publication/native/README.md +11 -0
  202. package/node_modules/@ykdz/reference-npm-publication/native/package.json +38 -0
  203. package/node_modules/@ykdz/reference-npm-publication/native/resources/gitignore +1 -0
  204. package/node_modules/@ykdz/reference-npm-publication/native/resources/release.yml +70 -0
  205. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts +5 -0
  206. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts.map +1 -0
  207. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.js +39 -0
  208. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts +13 -0
  209. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts.map +1 -0
  210. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.js +30 -0
  211. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts +11 -0
  212. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts.map +1 -0
  213. package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.js +51 -0
  214. package/node_modules/@ykdz/reference-npm-publication/package.json +19 -0
  215. package/node_modules/@ykdz/reference-rust-bin/native/Cargo.lock +16 -0
  216. package/node_modules/@ykdz/reference-rust-bin/native/Cargo.toml +27 -0
  217. package/node_modules/@ykdz/reference-rust-bin/native/package.json +38 -0
  218. package/node_modules/@ykdz/reference-rust-bin/native/template/rust-toolchain.toml +3 -0
  219. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts +15 -0
  220. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts.map +1 -0
  221. package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.js +145 -0
  222. package/node_modules/@ykdz/reference-rust-bin/native/tsconfig.json +8 -0
  223. package/node_modules/@ykdz/reference-rust-bin/native/turbo.json +63 -0
  224. package/node_modules/@ykdz/reference-rust-bin/package.json +20 -0
  225. package/node_modules/@ykdz/reference-tooling-config/native/node.json +13 -0
  226. package/node_modules/@ykdz/reference-tooling-config/native/oxlint.config.ts +8 -0
  227. package/node_modules/@ykdz/reference-tooling-config/native/package.json +37 -0
  228. package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.d.ts +27 -0
  229. package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.js +27 -0
  230. package/node_modules/@ykdz/reference-tooling-config/native/tsconfig.json +9 -0
  231. package/node_modules/@ykdz/reference-tooling-config/native/turbo.json +51 -0
  232. package/node_modules/@ykdz/reference-tooling-config/package.json +16 -0
  233. package/node_modules/@ykdz/reference-ts-cli/native/package.json +56 -0
  234. package/node_modules/@ykdz/reference-ts-cli/native/src/cli.ts +17 -0
  235. package/node_modules/@ykdz/reference-ts-cli/native/src/main.ts +162 -0
  236. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts +8 -0
  237. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts.map +1 -0
  238. package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.js +80 -0
  239. package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journey.ts +31 -0
  240. package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journeys/lookup.journey.ts +76 -0
  241. package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/run-journeys.ts +240 -0
  242. package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/source-journeys.test.ts +9 -0
  243. package/node_modules/@ykdz/reference-ts-cli/native/test/integration/command.test.ts +147 -0
  244. package/node_modules/@ykdz/reference-ts-cli/native/test/unit/cli-command-identity.test.ts +76 -0
  245. package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.build.json +12 -0
  246. package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.json +8 -0
  247. package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.node.json +7 -0
  248. package/node_modules/@ykdz/reference-ts-cli/native/turbo.json +75 -0
  249. package/node_modules/@ykdz/reference-ts-cli/package.json +20 -0
  250. package/node_modules/@ykdz/reference-ts-lib/native/package.json +57 -0
  251. package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.d.ts +1 -0
  252. package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.js +43 -0
  253. package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.build.json +9 -0
  254. package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.json +8 -0
  255. package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.node.json +8 -0
  256. package/node_modules/@ykdz/reference-ts-lib/native/turbo.json +63 -0
  257. package/node_modules/@ykdz/reference-ts-lib/package.json +20 -0
  258. package/node_modules/@ykdz/reference-vike-db/native/package.json +83 -0
  259. package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.d.ts +1 -0
  260. package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.js +39 -0
  261. package/node_modules/@ykdz/reference-vike-db/native/tsconfig.build.json +12 -0
  262. package/node_modules/@ykdz/reference-vike-db/native/tsconfig.json +11 -0
  263. package/node_modules/@ykdz/reference-vike-db/native/tsconfig.node.json +19 -0
  264. package/node_modules/@ykdz/reference-vike-db/native/tsconfig.scripts.json +13 -0
  265. package/node_modules/@ykdz/reference-vike-db/native/turbo.json +67 -0
  266. package/node_modules/@ykdz/reference-vike-db/package.json +19 -0
  267. package/node_modules/@ykdz/reference-vike-migrations/native/drizzle.config.ts +22 -0
  268. package/node_modules/@ykdz/reference-vike-migrations/native/package.json +51 -0
  269. package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.d.ts +1 -0
  270. package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.js +39 -0
  271. package/node_modules/@ykdz/reference-vike-migrations/native/tsconfig.json +15 -0
  272. package/node_modules/@ykdz/reference-vike-migrations/native/turbo.json +76 -0
  273. package/node_modules/@ykdz/reference-vike-migrations/package.json +19 -0
  274. package/node_modules/@ykdz/reference-vike-web/native/package.json +84 -0
  275. package/node_modules/@ykdz/reference-vike-web/native/pages/index/+Page.telefunc.ts +12 -0
  276. package/node_modules/@ykdz/reference-vike-web/native/pages/index/+Page.vue +89 -0
  277. package/node_modules/@ykdz/reference-vike-web/native/server/app.ts +36 -0
  278. package/node_modules/@ykdz/reference-vike-web/native/server/database.ts +2 -0
  279. package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.d.ts +1 -0
  280. package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.js +59 -0
  281. package/node_modules/@ykdz/reference-vike-web/native/test/e2e/app.spec.ts +16 -0
  282. package/node_modules/@ykdz/reference-vike-web/native/test/todos.browser.test.ts +37 -0
  283. package/node_modules/@ykdz/reference-vike-web/native/tooling/vite.ts +5 -0
  284. package/node_modules/@ykdz/reference-vike-web/native/tsconfig.app.json +27 -0
  285. package/node_modules/@ykdz/reference-vike-web/native/tsconfig.json +11 -0
  286. package/node_modules/@ykdz/reference-vike-web/native/tsconfig.node.json +33 -0
  287. package/node_modules/@ykdz/reference-vike-web/native/turbo.json +92 -0
  288. package/node_modules/@ykdz/reference-vike-web/native/types/global.d.ts +9 -0
  289. package/node_modules/@ykdz/reference-vike-web/native/vite.config.ts +16 -0
  290. package/node_modules/@ykdz/reference-vike-web/native/vitest.config.ts +37 -0
  291. package/node_modules/@ykdz/reference-vike-web/package.json +20 -0
  292. package/node_modules/@ykdz/reference-vue-app/native/TESTING.md +7 -0
  293. package/node_modules/@ykdz/reference-vue-app/native/package.json +70 -0
  294. package/node_modules/@ykdz/reference-vue-app/native/src/components/CounterButton.vue +18 -0
  295. package/node_modules/@ykdz/reference-vue-app/native/src/style.css +2 -0
  296. package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.d.ts +1 -0
  297. package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.js +53 -0
  298. package/node_modules/@ykdz/reference-vue-app/native/test/app.browser.test.ts +13 -0
  299. package/node_modules/@ykdz/reference-vue-app/native/test/counter.node.test.ts +15 -0
  300. package/node_modules/@ykdz/reference-vue-app/native/test/e2e/app.spec.ts +15 -0
  301. package/node_modules/@ykdz/reference-vue-app/native/tsconfig.app.json +18 -0
  302. package/node_modules/@ykdz/reference-vue-app/native/tsconfig.json +11 -0
  303. package/node_modules/@ykdz/reference-vue-app/native/tsconfig.node.json +25 -0
  304. package/node_modules/@ykdz/reference-vue-app/native/turbo.json +84 -0
  305. package/node_modules/@ykdz/reference-vue-app/native/vite.config.ts +8 -0
  306. package/node_modules/@ykdz/reference-vue-app/native/vitest.config.ts +37 -0
  307. package/node_modules/@ykdz/reference-vue-app/package.json +20 -0
  308. package/node_modules/@ykdz/reference-vue-hono-web/native/TESTING.md +7 -0
  309. package/node_modules/@ykdz/reference-vue-hono-web/native/package.json +66 -0
  310. package/node_modules/@ykdz/reference-vue-hono-web/native/src/App.vue +49 -0
  311. package/node_modules/@ykdz/reference-vue-hono-web/native/src/main.ts +7 -0
  312. package/node_modules/@ykdz/reference-vue-hono-web/native/src/style.css +2 -0
  313. package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.d.ts +1 -0
  314. package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.js +49 -0
  315. package/node_modules/@ykdz/reference-vue-hono-web/native/test/app.browser.test.ts +13 -0
  316. package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.app.json +18 -0
  317. package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.json +11 -0
  318. package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.node.json +25 -0
  319. package/node_modules/@ykdz/reference-vue-hono-web/native/turbo.json +74 -0
  320. package/node_modules/@ykdz/reference-vue-hono-web/native/vite.config.ts +28 -0
  321. package/node_modules/@ykdz/reference-vue-hono-web/native/vitest.config.ts +37 -0
  322. package/node_modules/@ykdz/reference-vue-hono-web/package.json +20 -0
  323. package/node_modules/@ykdz/template-content/dist/index.d.ts +14 -0
  324. package/node_modules/@ykdz/template-content/dist/index.js +9 -0
  325. package/node_modules/@ykdz/template-content/dist/template-members.d.ts +9 -0
  326. package/node_modules/@ykdz/template-content/dist/template-members.js +16 -0
  327. package/node_modules/@ykdz/template-content/package.json +18 -0
  328. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.d.ts +45 -0
  329. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.js +30 -0
  330. package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/package.json +35 -0
  331. package/node_modules/@ykdz/template-core/dist/content-identity.d.ts +42 -0
  332. package/node_modules/@ykdz/template-core/dist/content-identity.js +117 -0
  333. package/node_modules/@ykdz/template-core/dist/generation-record.d.ts +28 -0
  334. package/node_modules/@ykdz/template-core/dist/generation-record.js +45 -0
  335. package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +3 -81
  336. package/node_modules/@ykdz/template-core/dist/package-contribution.js +19 -64
  337. package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +73 -97
  338. package/node_modules/@ykdz/template-core/dist/preset-definition.js +107 -15
  339. package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +3 -11
  340. package/node_modules/@ykdz/template-core/dist/project-blueprint.js +23 -71
  341. package/node_modules/@ykdz/template-core/dist/project-projection.js +4 -17
  342. package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.d.ts +1 -0
  343. package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.js +2 -0
  344. package/node_modules/@ykdz/template-core/dist/renderer.d.ts +7 -25
  345. package/node_modules/@ykdz/template-core/dist/renderer.js +14 -252
  346. package/node_modules/@ykdz/template-core/dist/toml.d.ts +6 -0
  347. package/node_modules/@ykdz/template-core/dist/toml.js +31 -0
  348. package/node_modules/@ykdz/template-core/dist/workspace-strategy.d.ts +188 -0
  349. package/node_modules/@ykdz/template-core/dist/workspace-strategy.js +1 -0
  350. package/node_modules/@ykdz/template-core/package.json +24 -20
  351. package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.d.ts +65 -0
  352. package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.js +414 -0
  353. package/node_modules/@ykdz/template-environment/package.json +36 -0
  354. package/node_modules/@ykdz/template-generator/dist/content-source.d.ts +13 -0
  355. package/node_modules/@ykdz/template-generator/dist/content-source.js +181 -0
  356. package/node_modules/@ykdz/template-generator/dist/index.d.ts +82 -0
  357. package/node_modules/@ykdz/template-generator/dist/index.js +1147 -0
  358. package/node_modules/@ykdz/template-generator/package.json +41 -0
  359. package/node_modules/@ykdz/template-workspace/assets/environment/devcontainer/workspace-template.json +16 -0
  360. package/node_modules/@ykdz/template-workspace/assets/github/check.yml +83 -0
  361. package/node_modules/@ykdz/template-workspace/assets/github/dependabot.yml +49 -0
  362. package/node_modules/@ykdz/template-workspace/assets/next-steps.md +3 -0
  363. package/node_modules/@ykdz/template-workspace/assets/tsconfig.config.json +6 -0
  364. package/node_modules/@ykdz/template-workspace/assets/turbo.json +64 -0
  365. package/node_modules/@ykdz/template-workspace/dist/application-requirements.d.ts +14 -0
  366. package/node_modules/@ykdz/template-workspace/dist/application-requirements.js +42 -0
  367. package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.d.ts +17 -0
  368. package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.js +74 -0
  369. package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.d.ts +5 -0
  370. package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.js +8 -0
  371. package/node_modules/@ykdz/template-workspace/dist/default-environment.d.ts +9 -0
  372. package/node_modules/@ykdz/template-workspace/dist/default-environment.js +5 -0
  373. package/node_modules/@ykdz/template-workspace/dist/default-package-identity.d.ts +19 -0
  374. package/node_modules/@ykdz/template-workspace/dist/default-package-identity.js +128 -0
  375. package/node_modules/@ykdz/template-workspace/dist/default-package-role.d.ts +4 -0
  376. package/node_modules/@ykdz/template-workspace/dist/default-package-role.js +9 -0
  377. package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.d.ts +89 -0
  378. package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.js +967 -0
  379. package/node_modules/@ykdz/template-workspace/dist/dependency-catalog.d.ts +25 -0
  380. package/node_modules/@ykdz/template-workspace/dist/dependency-catalog.js +159 -0
  381. package/node_modules/@ykdz/template-workspace/dist/development-container.d.ts +3 -0
  382. package/node_modules/@ykdz/template-workspace/dist/development-container.js +36 -0
  383. package/node_modules/@ykdz/template-workspace/dist/development-environment.d.ts +36 -0
  384. package/node_modules/@ykdz/template-workspace/dist/development-environment.js +241 -0
  385. package/node_modules/@ykdz/template-workspace/dist/editor-customization.d.ts +18 -0
  386. package/node_modules/@ykdz/template-workspace/dist/editor-customization.js +83 -0
  387. package/node_modules/@ykdz/template-workspace/dist/environment-needs.d.ts +51 -0
  388. package/node_modules/@ykdz/template-workspace/dist/environment-needs.js +167 -0
  389. package/node_modules/@ykdz/template-workspace/dist/generation-context.d.ts +14 -0
  390. package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.d.ts +21 -0
  391. package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.js +90 -0
  392. package/node_modules/@ykdz/template-workspace/dist/package-contribution.d.ts +64 -0
  393. package/node_modules/@ykdz/template-workspace/dist/package-contribution.js +65 -0
  394. package/node_modules/@ykdz/template-workspace/dist/project-github.d.ts +24 -0
  395. package/node_modules/@ykdz/template-workspace/dist/project-github.js +98 -0
  396. package/node_modules/@ykdz/template-workspace/dist/project-linking.d.ts +48 -0
  397. package/node_modules/@ykdz/template-workspace/dist/project-linking.js +218 -0
  398. package/node_modules/@ykdz/template-workspace/dist/project-requirements.d.ts +17 -0
  399. package/node_modules/@ykdz/template-workspace/dist/reference-package.d.ts +146 -0
  400. package/node_modules/@ykdz/template-workspace/dist/reference-package.js +521 -0
  401. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +6 -0
  402. package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +6 -0
  403. package/node_modules/@ykdz/template-workspace/dist/root-projection.d.ts +29 -0
  404. package/node_modules/@ykdz/template-workspace/dist/root-projection.js +144 -0
  405. package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.d.ts +35 -0
  406. package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.js +74 -0
  407. package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.d.ts +22 -0
  408. package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.js +64 -0
  409. package/node_modules/@ykdz/template-workspace/dist/shared-root-files.d.ts +99 -0
  410. package/node_modules/@ykdz/template-workspace/dist/shared-root-files.js +159 -0
  411. package/node_modules/@ykdz/template-workspace/dist/vue-policy.d.ts +5 -0
  412. package/node_modules/@ykdz/template-workspace/dist/vue-policy.js +5 -0
  413. package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.d.ts +20 -0
  414. package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +86 -0
  415. package/node_modules/@ykdz/template-workspace/dist/workspace-resources.d.ts +23 -0
  416. package/node_modules/@ykdz/template-workspace/dist/workspace-resources.js +83 -0
  417. package/node_modules/@ykdz/template-workspace/package.json +135 -0
  418. package/node_modules/@ykdz/template-workspace/resources/oxfmt.config.ts +1 -0
  419. package/node_modules/@ykdz/template-workspace/resources/oxlint.config.ts +4 -0
  420. package/node_modules/@ykdz/template-workspace/scripts/sync-snapshot.ts +27 -0
  421. package/node_modules/@ykdz/template-workspace/scripts/task-gates.ts +631 -0
  422. package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.d.ts +57 -0
  423. package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.js +168 -0
  424. package/node_modules/@ykdz/template-workspace-authoring/dist/package-name-projection.d.ts +2 -0
  425. package/node_modules/@ykdz/template-workspace-authoring/dist/package-name-projection.js +22 -0
  426. package/node_modules/@ykdz/template-workspace-authoring/dist/resource-ignore-snapshot.d.ts +1 -0
  427. package/node_modules/@ykdz/template-workspace-authoring/dist/resource-ignore-snapshot.js +2 -0
  428. package/node_modules/@ykdz/template-workspace-authoring/dist/typescript-module-specifiers.d.ts +2 -0
  429. package/node_modules/@ykdz/template-workspace-authoring/dist/typescript-module-specifiers.js +36 -0
  430. package/node_modules/@ykdz/template-workspace-authoring/package.json +55 -0
  431. package/node_modules/eslint-visitor-keys/LICENSE +201 -0
  432. package/node_modules/eslint-visitor-keys/README.md +123 -0
  433. package/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.cjs +187 -0
  434. package/node_modules/eslint-visitor-keys/dist/eslint-visitor-keys.d.cts +28 -0
  435. package/node_modules/eslint-visitor-keys/dist/index.d.ts +16 -0
  436. package/node_modules/eslint-visitor-keys/dist/visitor-keys.d.ts +12 -0
  437. package/node_modules/eslint-visitor-keys/lib/index.js +67 -0
  438. package/node_modules/eslint-visitor-keys/lib/visitor-keys.js +118 -0
  439. package/node_modules/eslint-visitor-keys/package.json +57 -0
  440. package/node_modules/ignore/LICENSE-MIT +21 -0
  441. package/node_modules/ignore/README.md +501 -0
  442. package/node_modules/ignore/index.d.ts +81 -0
  443. package/node_modules/ignore/index.js +1566 -0
  444. package/node_modules/ignore/legacy.js +1346 -0
  445. package/node_modules/ignore/package.json +93 -0
  446. package/node_modules/smol-toml/dist/extract.js +5 -1
  447. package/node_modules/smol-toml/dist/index.cjs +2 -1
  448. package/node_modules/smol-toml/package.json +6 -6
  449. package/node_modules/toml-eslint-parser/LICENSE +21 -0
  450. package/node_modules/toml-eslint-parser/README.md +192 -0
  451. package/node_modules/toml-eslint-parser/lib/chunk-15K8U1wQ.mjs +18 -0
  452. package/node_modules/toml-eslint-parser/lib/index.d.mts +284 -0
  453. package/node_modules/toml-eslint-parser/lib/index.mjs +2219 -0
  454. package/node_modules/toml-eslint-parser/package.json +102 -0
  455. package/node_modules/typescript-7/LICENSE +55 -0
  456. package/node_modules/typescript-7/NOTICE.txt +436 -0
  457. package/node_modules/typescript-7/README.md +49 -0
  458. package/node_modules/typescript-7/bin/tsc +2 -0
  459. package/node_modules/typescript-7/dist/api/async/api.d.ts +529 -0
  460. package/node_modules/typescript-7/dist/api/async/api.d.ts.map +1 -0
  461. package/node_modules/typescript-7/dist/api/async/api.js +1657 -0
  462. package/node_modules/typescript-7/dist/api/async/api.js.map +1 -0
  463. package/node_modules/typescript-7/dist/api/async/client.d.ts +39 -0
  464. package/node_modules/typescript-7/dist/api/async/client.d.ts.map +1 -0
  465. package/node_modules/typescript-7/dist/api/async/client.js +211 -0
  466. package/node_modules/typescript-7/dist/api/async/client.js.map +1 -0
  467. package/node_modules/typescript-7/dist/api/async/types.d.ts +310 -0
  468. package/node_modules/typescript-7/dist/api/async/types.d.ts.map +1 -0
  469. package/node_modules/typescript-7/dist/api/async/types.js +2 -0
  470. package/node_modules/typescript-7/dist/api/async/types.js.map +1 -0
  471. package/node_modules/typescript-7/dist/api/compilerOptions.d.ts +109 -0
  472. package/node_modules/typescript-7/dist/api/compilerOptions.d.ts.map +1 -0
  473. package/node_modules/typescript-7/dist/api/compilerOptions.js +2 -0
  474. package/node_modules/typescript-7/dist/api/compilerOptions.js.map +1 -0
  475. package/node_modules/typescript-7/dist/api/fs.d.ts +23 -0
  476. package/node_modules/typescript-7/dist/api/fs.d.ts.map +1 -0
  477. package/node_modules/typescript-7/dist/api/fs.js +109 -0
  478. package/node_modules/typescript-7/dist/api/fs.js.map +1 -0
  479. package/node_modules/typescript-7/dist/api/node/encoder.d.ts +15 -0
  480. package/node_modules/typescript-7/dist/api/node/encoder.d.ts.map +1 -0
  481. package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts +5 -0
  482. package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts.map +1 -0
  483. package/node_modules/typescript-7/dist/api/node/encoder.generated.js +74 -0
  484. package/node_modules/typescript-7/dist/api/node/encoder.generated.js.map +1 -0
  485. package/node_modules/typescript-7/dist/api/node/encoder.js +287 -0
  486. package/node_modules/typescript-7/dist/api/node/encoder.js.map +1 -0
  487. package/node_modules/typescript-7/dist/api/node/msgpack.d.ts +32 -0
  488. package/node_modules/typescript-7/dist/api/node/msgpack.d.ts.map +1 -0
  489. package/node_modules/typescript-7/dist/api/node/msgpack.js +213 -0
  490. package/node_modules/typescript-7/dist/api/node/msgpack.js.map +1 -0
  491. package/node_modules/typescript-7/dist/api/node/node.d.ts +76 -0
  492. package/node_modules/typescript-7/dist/api/node/node.d.ts.map +1 -0
  493. package/node_modules/typescript-7/dist/api/node/node.generated.d.ts +182 -0
  494. package/node_modules/typescript-7/dist/api/node/node.generated.d.ts.map +1 -0
  495. package/node_modules/typescript-7/dist/api/node/node.generated.js +835 -0
  496. package/node_modules/typescript-7/dist/api/node/node.generated.js.map +1 -0
  497. package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts +62 -0
  498. package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts.map +1 -0
  499. package/node_modules/typescript-7/dist/api/node/node.infrastructure.js +122 -0
  500. package/node_modules/typescript-7/dist/api/node/node.infrastructure.js.map +1 -0
  501. package/node_modules/typescript-7/dist/api/node/node.js +298 -0
  502. package/node_modules/typescript-7/dist/api/node/node.js.map +1 -0
  503. package/node_modules/typescript-7/dist/api/node/protocol.d.ts +29 -0
  504. package/node_modules/typescript-7/dist/api/node/protocol.d.ts.map +1 -0
  505. package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts +4 -0
  506. package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts.map +1 -0
  507. package/node_modules/typescript-7/dist/api/node/protocol.generated.js +241 -0
  508. package/node_modules/typescript-7/dist/api/node/protocol.generated.js.map +1 -0
  509. package/node_modules/typescript-7/dist/api/node/protocol.js +30 -0
  510. package/node_modules/typescript-7/dist/api/node/protocol.js.map +1 -0
  511. package/node_modules/typescript-7/dist/api/node/wtf8.d.ts +6 -0
  512. package/node_modules/typescript-7/dist/api/node/wtf8.d.ts.map +1 -0
  513. package/node_modules/typescript-7/dist/api/node/wtf8.js +61 -0
  514. package/node_modules/typescript-7/dist/api/node/wtf8.js.map +1 -0
  515. package/node_modules/typescript-7/dist/api/options.d.ts +32 -0
  516. package/node_modules/typescript-7/dist/api/options.d.ts.map +1 -0
  517. package/node_modules/typescript-7/dist/api/options.js +11 -0
  518. package/node_modules/typescript-7/dist/api/options.js.map +1 -0
  519. package/node_modules/typescript-7/dist/api/path.d.ts +110 -0
  520. package/node_modules/typescript-7/dist/api/path.d.ts.map +1 -0
  521. package/node_modules/typescript-7/dist/api/path.js +508 -0
  522. package/node_modules/typescript-7/dist/api/path.js.map +1 -0
  523. package/node_modules/typescript-7/dist/api/proto.d.ts +239 -0
  524. package/node_modules/typescript-7/dist/api/proto.d.ts.map +1 -0
  525. package/node_modules/typescript-7/dist/api/proto.js +37 -0
  526. package/node_modules/typescript-7/dist/api/proto.js.map +1 -0
  527. package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts +79 -0
  528. package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts.map +1 -0
  529. package/node_modules/typescript-7/dist/api/sourceFileCache.js +169 -0
  530. package/node_modules/typescript-7/dist/api/sourceFileCache.js.map +1 -0
  531. package/node_modules/typescript-7/dist/api/sync/api.d.ts +529 -0
  532. package/node_modules/typescript-7/dist/api/sync/api.d.ts.map +1 -0
  533. package/node_modules/typescript-7/dist/api/sync/api.js +1665 -0
  534. package/node_modules/typescript-7/dist/api/sync/api.js.map +1 -0
  535. package/node_modules/typescript-7/dist/api/sync/client.d.ts +30 -0
  536. package/node_modules/typescript-7/dist/api/sync/client.d.ts.map +1 -0
  537. package/node_modules/typescript-7/dist/api/sync/client.js +124 -0
  538. package/node_modules/typescript-7/dist/api/sync/client.js.map +1 -0
  539. package/node_modules/typescript-7/dist/api/sync/types.d.ts +310 -0
  540. package/node_modules/typescript-7/dist/api/sync/types.d.ts.map +1 -0
  541. package/node_modules/typescript-7/dist/api/sync/types.js +2 -0
  542. package/node_modules/typescript-7/dist/api/sync/types.js.map +1 -0
  543. package/node_modules/typescript-7/dist/api/syncChannel.d.ts +114 -0
  544. package/node_modules/typescript-7/dist/api/syncChannel.d.ts.map +1 -0
  545. package/node_modules/typescript-7/dist/api/syncChannel.js +508 -0
  546. package/node_modules/typescript-7/dist/api/syncChannel.js.map +1 -0
  547. package/node_modules/typescript-7/dist/api/timing.d.ts +175 -0
  548. package/node_modules/typescript-7/dist/api/timing.d.ts.map +1 -0
  549. package/node_modules/typescript-7/dist/api/timing.js +149 -0
  550. package/node_modules/typescript-7/dist/api/timing.js.map +1 -0
  551. package/node_modules/typescript-7/dist/ast/ast.d.ts +100 -0
  552. package/node_modules/typescript-7/dist/ast/ast.d.ts.map +1 -0
  553. package/node_modules/typescript-7/dist/ast/ast.generated.d.ts +1161 -0
  554. package/node_modules/typescript-7/dist/ast/ast.generated.d.ts.map +1 -0
  555. package/node_modules/typescript-7/dist/ast/ast.generated.js +4 -0
  556. package/node_modules/typescript-7/dist/ast/ast.generated.js.map +1 -0
  557. package/node_modules/typescript-7/dist/ast/ast.js +7 -0
  558. package/node_modules/typescript-7/dist/ast/ast.js.map +1 -0
  559. package/node_modules/typescript-7/dist/ast/astnav.d.ts +19 -0
  560. package/node_modules/typescript-7/dist/ast/astnav.d.ts.map +1 -0
  561. package/node_modules/typescript-7/dist/ast/astnav.js +596 -0
  562. package/node_modules/typescript-7/dist/ast/astnav.js.map +1 -0
  563. package/node_modules/typescript-7/dist/ast/clone.d.ts +16 -0
  564. package/node_modules/typescript-7/dist/ast/clone.d.ts.map +1 -0
  565. package/node_modules/typescript-7/dist/ast/clone.js +104 -0
  566. package/node_modules/typescript-7/dist/ast/clone.js.map +1 -0
  567. package/node_modules/typescript-7/dist/ast/factory.generated.d.ts +520 -0
  568. package/node_modules/typescript-7/dist/ast/factory.generated.d.ts.map +1 -0
  569. package/node_modules/typescript-7/dist/ast/factory.generated.js +3057 -0
  570. package/node_modules/typescript-7/dist/ast/factory.generated.js.map +1 -0
  571. package/node_modules/typescript-7/dist/ast/index.d.ts +20 -0
  572. package/node_modules/typescript-7/dist/ast/index.d.ts.map +1 -0
  573. package/node_modules/typescript-7/dist/ast/index.js +20 -0
  574. package/node_modules/typescript-7/dist/ast/index.js.map +1 -0
  575. package/node_modules/typescript-7/dist/ast/is.d.ts +35 -0
  576. package/node_modules/typescript-7/dist/ast/is.d.ts.map +1 -0
  577. package/node_modules/typescript-7/dist/ast/is.generated.d.ts +329 -0
  578. package/node_modules/typescript-7/dist/ast/is.generated.d.ts.map +1 -0
  579. package/node_modules/typescript-7/dist/ast/is.generated.js +1103 -0
  580. package/node_modules/typescript-7/dist/ast/is.generated.js.map +1 -0
  581. package/node_modules/typescript-7/dist/ast/is.js +233 -0
  582. package/node_modules/typescript-7/dist/ast/is.js.map +1 -0
  583. package/node_modules/typescript-7/dist/ast/jsdoc.d.ts +11 -0
  584. package/node_modules/typescript-7/dist/ast/jsdoc.d.ts.map +1 -0
  585. package/node_modules/typescript-7/dist/ast/jsdoc.js +202 -0
  586. package/node_modules/typescript-7/dist/ast/jsdoc.js.map +1 -0
  587. package/node_modules/typescript-7/dist/ast/scanner.d.ts +97 -0
  588. package/node_modules/typescript-7/dist/ast/scanner.d.ts.map +1 -0
  589. package/node_modules/typescript-7/dist/ast/scanner.js +2230 -0
  590. package/node_modules/typescript-7/dist/ast/scanner.js.map +1 -0
  591. package/node_modules/typescript-7/dist/ast/utils.d.ts +17 -0
  592. package/node_modules/typescript-7/dist/ast/utils.d.ts.map +1 -0
  593. package/node_modules/typescript-7/dist/ast/utils.js +67 -0
  594. package/node_modules/typescript-7/dist/ast/utils.js.map +1 -0
  595. package/node_modules/typescript-7/dist/ast/visitor.d.ts +14 -0
  596. package/node_modules/typescript-7/dist/ast/visitor.d.ts.map +1 -0
  597. package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts +50 -0
  598. package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts.map +1 -0
  599. package/node_modules/typescript-7/dist/ast/visitor.generated.js +978 -0
  600. package/node_modules/typescript-7/dist/ast/visitor.generated.js.map +1 -0
  601. package/node_modules/typescript-7/dist/ast/visitor.js +47 -0
  602. package/node_modules/typescript-7/dist/ast/visitor.js.map +1 -0
  603. package/node_modules/typescript-7/dist/enums/characterCodes.d.ts +2 -0
  604. package/node_modules/typescript-7/dist/enums/characterCodes.d.ts.map +1 -0
  605. package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts +129 -0
  606. package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts.map +1 -0
  607. package/node_modules/typescript-7/dist/enums/characterCodes.enum.js +132 -0
  608. package/node_modules/typescript-7/dist/enums/characterCodes.enum.js.map +1 -0
  609. package/node_modules/typescript-7/dist/enums/characterCodes.js +130 -0
  610. package/node_modules/typescript-7/dist/enums/characterCodes.js.map +1 -0
  611. package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts +2 -0
  612. package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts.map +1 -0
  613. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts +5 -0
  614. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
  615. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js +6 -0
  616. package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js.map +1 -0
  617. package/node_modules/typescript-7/dist/enums/commentDirectiveType.js +6 -0
  618. package/node_modules/typescript-7/dist/enums/commentDirectiveType.js.map +1 -0
  619. package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts +2 -0
  620. package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts.map +1 -0
  621. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts +28 -0
  622. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts.map +1 -0
  623. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js +30 -0
  624. package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js.map +1 -0
  625. package/node_modules/typescript-7/dist/enums/completionItemKind.js +30 -0
  626. package/node_modules/typescript-7/dist/enums/completionItemKind.js.map +1 -0
  627. package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts +2 -0
  628. package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts.map +1 -0
  629. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts +7 -0
  630. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
  631. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js +9 -0
  632. package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js.map +1 -0
  633. package/node_modules/typescript-7/dist/enums/diagnosticCategory.js +9 -0
  634. package/node_modules/typescript-7/dist/enums/diagnosticCategory.js.map +1 -0
  635. package/node_modules/typescript-7/dist/enums/elementFlags.d.ts +2 -0
  636. package/node_modules/typescript-7/dist/enums/elementFlags.d.ts.map +1 -0
  637. package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts +12 -0
  638. package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts.map +1 -0
  639. package/node_modules/typescript-7/dist/enums/elementFlags.enum.js +14 -0
  640. package/node_modules/typescript-7/dist/enums/elementFlags.enum.js.map +1 -0
  641. package/node_modules/typescript-7/dist/enums/elementFlags.js +14 -0
  642. package/node_modules/typescript-7/dist/enums/elementFlags.js.map +1 -0
  643. package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts +2 -0
  644. package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts.map +1 -0
  645. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts +23 -0
  646. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
  647. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js +25 -0
  648. package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js.map +1 -0
  649. package/node_modules/typescript-7/dist/enums/internalSymbolName.js +25 -0
  650. package/node_modules/typescript-7/dist/enums/internalSymbolName.js.map +1 -0
  651. package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts +2 -0
  652. package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts.map +1 -0
  653. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts +9 -0
  654. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts.map +1 -0
  655. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js +11 -0
  656. package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js.map +1 -0
  657. package/node_modules/typescript-7/dist/enums/jsxEmit.js +11 -0
  658. package/node_modules/typescript-7/dist/enums/jsxEmit.js.map +1 -0
  659. package/node_modules/typescript-7/dist/enums/languageVariant.d.ts +2 -0
  660. package/node_modules/typescript-7/dist/enums/languageVariant.d.ts.map +1 -0
  661. package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts +5 -0
  662. package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts.map +1 -0
  663. package/node_modules/typescript-7/dist/enums/languageVariant.enum.js +6 -0
  664. package/node_modules/typescript-7/dist/enums/languageVariant.enum.js.map +1 -0
  665. package/node_modules/typescript-7/dist/enums/languageVariant.js +6 -0
  666. package/node_modules/typescript-7/dist/enums/languageVariant.js.map +1 -0
  667. package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts +2 -0
  668. package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts.map +1 -0
  669. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts +42 -0
  670. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts.map +1 -0
  671. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js +44 -0
  672. package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js.map +1 -0
  673. package/node_modules/typescript-7/dist/enums/modifierFlags.js +44 -0
  674. package/node_modules/typescript-7/dist/enums/modifierFlags.js.map +1 -0
  675. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts +2 -0
  676. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts.map +1 -0
  677. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
  678. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
  679. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js +9 -0
  680. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js.map +1 -0
  681. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js +9 -0
  682. package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js.map +1 -0
  683. package/node_modules/typescript-7/dist/enums/moduleKind.d.ts +2 -0
  684. package/node_modules/typescript-7/dist/enums/moduleKind.d.ts.map +1 -0
  685. package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts +17 -0
  686. package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts.map +1 -0
  687. package/node_modules/typescript-7/dist/enums/moduleKind.enum.js +19 -0
  688. package/node_modules/typescript-7/dist/enums/moduleKind.enum.js.map +1 -0
  689. package/node_modules/typescript-7/dist/enums/moduleKind.js +19 -0
  690. package/node_modules/typescript-7/dist/enums/moduleKind.js.map +1 -0
  691. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts +2 -0
  692. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts.map +1 -0
  693. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
  694. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
  695. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js +11 -0
  696. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js.map +1 -0
  697. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js +11 -0
  698. package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js.map +1 -0
  699. package/node_modules/typescript-7/dist/enums/newLineKind.d.ts +2 -0
  700. package/node_modules/typescript-7/dist/enums/newLineKind.d.ts.map +1 -0
  701. package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts +6 -0
  702. package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts.map +1 -0
  703. package/node_modules/typescript-7/dist/enums/newLineKind.enum.js +8 -0
  704. package/node_modules/typescript-7/dist/enums/newLineKind.enum.js.map +1 -0
  705. package/node_modules/typescript-7/dist/enums/newLineKind.js +8 -0
  706. package/node_modules/typescript-7/dist/enums/newLineKind.js.map +1 -0
  707. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts +2 -0
  708. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
  709. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
  710. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
  711. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js +38 -0
  712. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
  713. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js +38 -0
  714. package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js.map +1 -0
  715. package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts +2 -0
  716. package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts.map +1 -0
  717. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts +44 -0
  718. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts.map +1 -0
  719. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js +46 -0
  720. package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js.map +1 -0
  721. package/node_modules/typescript-7/dist/enums/nodeFlags.js +46 -0
  722. package/node_modules/typescript-7/dist/enums/nodeFlags.js.map +1 -0
  723. package/node_modules/typescript-7/dist/enums/objectFlags.d.ts +2 -0
  724. package/node_modules/typescript-7/dist/enums/objectFlags.d.ts.map +1 -0
  725. package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts +50 -0
  726. package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts.map +1 -0
  727. package/node_modules/typescript-7/dist/enums/objectFlags.enum.js +52 -0
  728. package/node_modules/typescript-7/dist/enums/objectFlags.enum.js.map +1 -0
  729. package/node_modules/typescript-7/dist/enums/objectFlags.js +52 -0
  730. package/node_modules/typescript-7/dist/enums/objectFlags.js.map +1 -0
  731. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts +2 -0
  732. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts.map +1 -0
  733. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
  734. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
  735. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js +18 -0
  736. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js.map +1 -0
  737. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js +18 -0
  738. package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js.map +1 -0
  739. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts +2 -0
  740. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts.map +1 -0
  741. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
  742. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
  743. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js +14 -0
  744. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js.map +1 -0
  745. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js +14 -0
  746. package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js.map +1 -0
  747. package/node_modules/typescript-7/dist/enums/scriptKind.d.ts +2 -0
  748. package/node_modules/typescript-7/dist/enums/scriptKind.d.ts.map +1 -0
  749. package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts +11 -0
  750. package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts.map +1 -0
  751. package/node_modules/typescript-7/dist/enums/scriptKind.enum.js +12 -0
  752. package/node_modules/typescript-7/dist/enums/scriptKind.enum.js.map +1 -0
  753. package/node_modules/typescript-7/dist/enums/scriptKind.js +12 -0
  754. package/node_modules/typescript-7/dist/enums/scriptKind.js.map +1 -0
  755. package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts +2 -0
  756. package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts.map +1 -0
  757. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts +17 -0
  758. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts.map +1 -0
  759. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js +18 -0
  760. package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js.map +1 -0
  761. package/node_modules/typescript-7/dist/enums/scriptTarget.js +18 -0
  762. package/node_modules/typescript-7/dist/enums/scriptTarget.js.map +1 -0
  763. package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts +2 -0
  764. package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts.map +1 -0
  765. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts +15 -0
  766. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts.map +1 -0
  767. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js +17 -0
  768. package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js.map +1 -0
  769. package/node_modules/typescript-7/dist/enums/signatureFlags.js +17 -0
  770. package/node_modules/typescript-7/dist/enums/signatureFlags.js.map +1 -0
  771. package/node_modules/typescript-7/dist/enums/signatureKind.d.ts +2 -0
  772. package/node_modules/typescript-7/dist/enums/signatureKind.d.ts.map +1 -0
  773. package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts +5 -0
  774. package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts.map +1 -0
  775. package/node_modules/typescript-7/dist/enums/signatureKind.enum.js +7 -0
  776. package/node_modules/typescript-7/dist/enums/signatureKind.enum.js.map +1 -0
  777. package/node_modules/typescript-7/dist/enums/signatureKind.js +7 -0
  778. package/node_modules/typescript-7/dist/enums/signatureKind.js.map +1 -0
  779. package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts +2 -0
  780. package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts.map +1 -0
  781. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts +71 -0
  782. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts.map +1 -0
  783. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js +73 -0
  784. package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js.map +1 -0
  785. package/node_modules/typescript-7/dist/enums/symbolFlags.js +73 -0
  786. package/node_modules/typescript-7/dist/enums/symbolFlags.js.map +1 -0
  787. package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts +2 -0
  788. package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts.map +1 -0
  789. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts +389 -0
  790. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts.map +1 -0
  791. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js +391 -0
  792. package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js.map +1 -0
  793. package/node_modules/typescript-7/dist/enums/syntaxKind.js +391 -0
  794. package/node_modules/typescript-7/dist/enums/syntaxKind.js.map +1 -0
  795. package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts +2 -0
  796. package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts.map +1 -0
  797. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts +30 -0
  798. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts.map +1 -0
  799. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js +32 -0
  800. package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js.map +1 -0
  801. package/node_modules/typescript-7/dist/enums/tokenFlags.js +32 -0
  802. package/node_modules/typescript-7/dist/enums/tokenFlags.js.map +1 -0
  803. package/node_modules/typescript-7/dist/enums/typeFlags.d.ts +2 -0
  804. package/node_modules/typescript-7/dist/enums/typeFlags.d.ts.map +1 -0
  805. package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts +76 -0
  806. package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts.map +1 -0
  807. package/node_modules/typescript-7/dist/enums/typeFlags.enum.js +78 -0
  808. package/node_modules/typescript-7/dist/enums/typeFlags.enum.js.map +1 -0
  809. package/node_modules/typescript-7/dist/enums/typeFlags.js +78 -0
  810. package/node_modules/typescript-7/dist/enums/typeFlags.js.map +1 -0
  811. package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts +2 -0
  812. package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts.map +1 -0
  813. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts +7 -0
  814. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
  815. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js +9 -0
  816. package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js.map +1 -0
  817. package/node_modules/typescript-7/dist/enums/typePredicateKind.js +9 -0
  818. package/node_modules/typescript-7/dist/enums/typePredicateKind.js.map +1 -0
  819. package/node_modules/typescript-7/dist/internal/utils.d.ts +23 -0
  820. package/node_modules/typescript-7/dist/internal/utils.d.ts.map +1 -0
  821. package/node_modules/typescript-7/dist/internal/utils.js +25 -0
  822. package/node_modules/typescript-7/dist/internal/utils.js.map +1 -0
  823. package/node_modules/typescript-7/lib/getExePath.d.ts +2 -0
  824. package/node_modules/typescript-7/lib/getExePath.js +70 -0
  825. package/node_modules/typescript-7/lib/tsc.js +28 -0
  826. package/node_modules/typescript-7/lib/version.cjs +3 -0
  827. package/node_modules/typescript-7/lib/version.d.cts +2 -0
  828. package/node_modules/typescript-7/package.json +87 -0
  829. package/node_modules/typescript-7/vendor/vscode-jsonrpc/License.txt +11 -0
  830. package/node_modules/typescript-7/vendor/vscode-jsonrpc/README.md +54 -0
  831. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
  832. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
  833. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
  834. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
  835. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
  836. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
  837. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
  838. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
  839. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
  840. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
  841. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
  842. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
  843. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
  844. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
  845. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
  846. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
  847. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
  848. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
  849. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
  850. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
  851. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
  852. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
  853. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
  854. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
  855. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
  856. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
  857. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
  858. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
  859. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
  860. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
  861. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
  862. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
  863. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
  864. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
  865. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
  866. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
  867. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
  868. package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
  869. package/node_modules/typescript-7/vendor/vscode-jsonrpc/package.json +54 -0
  870. package/node_modules/typescript-7/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
  871. package/package.json +110 -34
  872. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +0 -243
  873. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +0 -3567
  874. package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.d.ts +0 -58
  875. package/node_modules/@ykdz/template-builtin-presets/dist/src/generation-record.js +0 -178
  876. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +0 -4
  877. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +0 -3
  878. package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.d.ts +0 -31
  879. package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +0 -193
  880. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.d.ts +0 -3
  881. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/development-container.js +0 -52
  882. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.d.ts +0 -16
  883. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/typescript.js +0 -74
  884. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +0 -36
  885. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +0 -117
  886. package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.d.ts +0 -15
  887. package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.js +0 -27
  888. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.d.ts +0 -31
  889. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-cli/definition.js +0 -253
  890. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.d.ts +0 -31
  891. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +0 -155
  892. package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.d.ts +0 -48
  893. package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +0 -541
  894. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.d.ts +0 -26
  895. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +0 -113
  896. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.d.ts +0 -22
  897. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +0 -204
  898. package/node_modules/@ykdz/template-builtin-presets/package.json +0 -107
  899. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot-rust.yml +0 -41
  900. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.dynamic.template +0 -4
  901. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.yml +0 -33
  902. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment-diagnostics.yml +0 -82
  903. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-deployment.yml +0 -42
  904. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-diagnostics.yml +0 -80
  905. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +0 -40
  906. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.pnpmfile.mjs +0 -19
  907. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/TODO.md.template +0 -5
  908. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +0 -18
  909. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +0 -24
  910. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +0 -35
  911. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/check-toolchain-versions.ts +0 -556
  912. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/node-test-count-reporter.ts +0 -31
  913. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-rust-tests.ts +0 -100
  914. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-turbo-boundaries.ts +0 -74
  915. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/task-gates.ts +0 -589
  916. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.packing-hook.json +0 -7
  917. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-boundary-tags/app.json +0 -7
  918. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-boundary-tags/library.json +0 -7
  919. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/database-preparation.json +0 -17
  920. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/deployment.json +0 -13
  921. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/rust-toolchain.json +0 -5
  922. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo-projections/vue-hono-joint-e2e.json +0 -13
  923. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +0 -20
  924. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/typescript-config/turbo.json +0 -33
  925. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/dependabot.yml +0 -41
  926. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/extensions.json +0 -3
  927. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/settings.json +0 -5
  928. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +0 -16
  929. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +0 -27
  930. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/rust-toolchain.toml +0 -3
  931. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/tsconfig.scripts.json +0 -12
  932. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/turbo.json +0 -37
  933. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/node/oxlint.config.ts +0 -8
  934. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/tsconfig.config.json +0 -12
  935. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/src/components/CounterButton.vue +0 -18
  936. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/src/style.css +0 -1
  937. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/test/counter.browser.test.ts +0 -16
  938. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/test/counter.node.test.ts +0 -15
  939. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +0 -18
  940. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.json +0 -8
  941. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +0 -21
  942. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +0 -10
  943. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/typescript/run-vue-tsc.ts +0 -12
  944. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/vitest.config.ts +0 -50
  945. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/CHANGELOG.md.template +0 -17
  946. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/RELEASING.md +0 -17
  947. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/artifact.ts +0 -1340
  948. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/changelog.ts +0 -283
  949. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-artifact.ts +0 -110
  950. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/check-readiness.ts +0 -66
  951. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/cli-command-identity.ts +0 -4
  952. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/handoff.ts +0 -522
  953. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/publish.ts +0 -483
  954. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/readiness.ts +0 -1150
  955. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.ts +0 -819
  956. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/release.yml +0 -122
  957. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/root-tsconfig.json +0 -8
  958. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/tsconfig.json +0 -4
  959. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication/turbo.json +0 -9
  960. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/README.md +0 -48
  961. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/CHANGELOG.md.template +0 -17
  962. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-APACHE-2.0.txt +0 -202
  963. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/LICENSE-MIT.txt +0 -21
  964. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/assets/README.md.template +0 -5
  965. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/bridge.ts +0 -3336
  966. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/publication-setup/setup.sh +0 -221
  967. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/cli.ts +0 -17
  968. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/main.ts +0 -162
  969. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/src/standard-schema.ts +0 -37
  970. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journey.ts +0 -31
  971. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/journeys/lookup.journey.ts +0 -71
  972. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/run-journeys.test.ts +0 -11
  973. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/e2e/run-journeys.ts +0 -255
  974. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/integration/command.test.ts +0 -146
  975. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/test/unit/cli-command-identity.test.ts +0 -76
  976. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.build.json +0 -12
  977. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/tsconfig.json +0 -14
  978. package/node_modules/@ykdz/template-builtin-presets/templates/ts-cli/turbo.json +0 -64
  979. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/dependabot.yml +0 -33
  980. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.build.json +0 -9
  981. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +0 -14
  982. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/turbo.json +0 -47
  983. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/scripts/reset.ts +0 -3
  984. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.build.json +0 -12
  985. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +0 -18
  986. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/turbo.json +0 -46
  987. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +0 -21
  988. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +0 -14
  989. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +0 -53
  990. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile +0 -81
  991. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile.dockerignore +0 -14
  992. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/components/CounterButton.vue +0 -21
  993. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/pages/index/+Page.telefunc.ts +0 -12
  994. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/pages/index/+Page.vue +0 -93
  995. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/check-standalone-deployment.ts +0 -553
  996. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/server/app.ts +0 -36
  997. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/test/counter.browser.test.ts +0 -14
  998. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/test/e2e/app.spec.ts +0 -18
  999. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +0 -26
  1000. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +0 -8
  1001. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +0 -21
  1002. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +0 -15
  1003. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/turbo.json +0 -69
  1004. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/types/global.d.ts +0 -9
  1005. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vite.config.ts +0 -14
  1006. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/vitest.config.ts +0 -35
  1007. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/dependabot.yml +0 -33
  1008. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/test/e2e/app.spec.ts +0 -14
  1009. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/turbo.json +0 -71
  1010. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/vite.config.ts +0 -7
  1011. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.build.json +0 -10
  1012. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +0 -16
  1013. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/turbo.json +0 -54
  1014. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/playwright.config.ts +0 -34
  1015. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/test/e2e/app.spec.ts +0 -15
  1016. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/root/tsconfig.json +0 -3
  1017. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/src/App.vue +0 -51
  1018. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/turbo.json +0 -65
  1019. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/web/vite.config.ts +0 -27
  1020. package/node_modules/@ykdz/template-core/dist/Cargo.lock +0 -16
  1021. package/node_modules/@ykdz/template-core/dist/Cargo.toml +0 -12
  1022. package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.d.ts +0 -19
  1023. package/node_modules/@ykdz/template-core/dist/ci-diagnostic-artifact.js +0 -76
  1024. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +0 -33
  1025. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +0 -238
  1026. package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.d.ts +0 -56
  1027. package/node_modules/@ykdz/template-core/dist/development-container-tool-layer.js +0 -361
  1028. package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +0 -17
  1029. package/node_modules/@ykdz/template-core/dist/editor-customization.js +0 -73
  1030. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +0 -53
  1031. package/node_modules/@ykdz/template-core/dist/module-graph.js +0 -167
  1032. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +0 -75
  1033. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +0 -25
  1034. package/node_modules/@ykdz/template-core/dist/project-github.js +0 -88
  1035. package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +0 -31
  1036. package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +0 -143
  1037. package/node_modules/@ykdz/template-core/dist/release-toolchain-snapshot.d.ts +0 -10
  1038. package/node_modules/@ykdz/template-core/dist/release-toolchain-snapshot.js +0 -9
  1039. package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +0 -58
  1040. package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +0 -839
  1041. package/node_modules/@ykdz/template-core/node_modules/valibot/LICENSE.md +0 -9
  1042. package/node_modules/@ykdz/template-core/node_modules/valibot/README.md +0 -94
  1043. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.cjs +0 -7897
  1044. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.d.cts +0 -16579
  1045. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.d.mts +0 -16579
  1046. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.min.cjs +0 -2
  1047. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.min.mjs +0 -2
  1048. package/node_modules/@ykdz/template-core/node_modules/valibot/dist/index.mjs +0 -7577
  1049. package/node_modules/@ykdz/template-core/node_modules/valibot/package.json +0 -84
  1050. package/node_modules/npm-package-arg/node_modules/semver/LICENSE +0 -15
  1051. package/node_modules/npm-package-arg/node_modules/semver/README.md +0 -680
  1052. package/node_modules/npm-package-arg/node_modules/semver/bin/semver.js +0 -195
  1053. package/node_modules/npm-package-arg/node_modules/semver/classes/comparator.js +0 -143
  1054. package/node_modules/npm-package-arg/node_modules/semver/classes/index.js +0 -7
  1055. package/node_modules/npm-package-arg/node_modules/semver/classes/range.js +0 -577
  1056. package/node_modules/npm-package-arg/node_modules/semver/classes/semver.js +0 -350
  1057. package/node_modules/npm-package-arg/node_modules/semver/functions/clean.js +0 -8
  1058. package/node_modules/npm-package-arg/node_modules/semver/functions/cmp.js +0 -54
  1059. package/node_modules/npm-package-arg/node_modules/semver/functions/coerce.js +0 -62
  1060. package/node_modules/npm-package-arg/node_modules/semver/functions/compare-build.js +0 -9
  1061. package/node_modules/npm-package-arg/node_modules/semver/functions/compare-loose.js +0 -5
  1062. package/node_modules/npm-package-arg/node_modules/semver/functions/compare.js +0 -7
  1063. package/node_modules/npm-package-arg/node_modules/semver/functions/diff.js +0 -60
  1064. package/node_modules/npm-package-arg/node_modules/semver/functions/eq.js +0 -5
  1065. package/node_modules/npm-package-arg/node_modules/semver/functions/gt.js +0 -5
  1066. package/node_modules/npm-package-arg/node_modules/semver/functions/gte.js +0 -5
  1067. package/node_modules/npm-package-arg/node_modules/semver/functions/inc.js +0 -21
  1068. package/node_modules/npm-package-arg/node_modules/semver/functions/lt.js +0 -5
  1069. package/node_modules/npm-package-arg/node_modules/semver/functions/lte.js +0 -5
  1070. package/node_modules/npm-package-arg/node_modules/semver/functions/major.js +0 -5
  1071. package/node_modules/npm-package-arg/node_modules/semver/functions/minor.js +0 -5
  1072. package/node_modules/npm-package-arg/node_modules/semver/functions/neq.js +0 -5
  1073. package/node_modules/npm-package-arg/node_modules/semver/functions/parse.js +0 -18
  1074. package/node_modules/npm-package-arg/node_modules/semver/functions/patch.js +0 -5
  1075. package/node_modules/npm-package-arg/node_modules/semver/functions/prerelease.js +0 -8
  1076. package/node_modules/npm-package-arg/node_modules/semver/functions/rcompare.js +0 -5
  1077. package/node_modules/npm-package-arg/node_modules/semver/functions/rsort.js +0 -5
  1078. package/node_modules/npm-package-arg/node_modules/semver/functions/satisfies.js +0 -12
  1079. package/node_modules/npm-package-arg/node_modules/semver/functions/sort.js +0 -5
  1080. package/node_modules/npm-package-arg/node_modules/semver/functions/truncate.js +0 -48
  1081. package/node_modules/npm-package-arg/node_modules/semver/functions/valid.js +0 -8
  1082. package/node_modules/npm-package-arg/node_modules/semver/index.js +0 -93
  1083. package/node_modules/npm-package-arg/node_modules/semver/internal/constants.js +0 -37
  1084. package/node_modules/npm-package-arg/node_modules/semver/internal/debug.js +0 -11
  1085. package/node_modules/npm-package-arg/node_modules/semver/internal/identifiers.js +0 -29
  1086. package/node_modules/npm-package-arg/node_modules/semver/internal/lrucache.js +0 -42
  1087. package/node_modules/npm-package-arg/node_modules/semver/internal/parse-options.js +0 -17
  1088. package/node_modules/npm-package-arg/node_modules/semver/internal/re.js +0 -223
  1089. package/node_modules/npm-package-arg/node_modules/semver/package.json +0 -78
  1090. package/node_modules/npm-package-arg/node_modules/semver/preload.js +0 -4
  1091. package/node_modules/npm-package-arg/node_modules/semver/range.bnf +0 -17
  1092. package/node_modules/npm-package-arg/node_modules/semver/ranges/gtr.js +0 -6
  1093. package/node_modules/npm-package-arg/node_modules/semver/ranges/intersects.js +0 -9
  1094. package/node_modules/npm-package-arg/node_modules/semver/ranges/ltr.js +0 -6
  1095. package/node_modules/npm-package-arg/node_modules/semver/ranges/max-satisfying.js +0 -27
  1096. package/node_modules/npm-package-arg/node_modules/semver/ranges/min-satisfying.js +0 -26
  1097. package/node_modules/npm-package-arg/node_modules/semver/ranges/min-version.js +0 -63
  1098. package/node_modules/npm-package-arg/node_modules/semver/ranges/outside.js +0 -82
  1099. package/node_modules/npm-package-arg/node_modules/semver/ranges/simplify.js +0 -49
  1100. package/node_modules/npm-package-arg/node_modules/semver/ranges/subset.js +0 -249
  1101. package/node_modules/npm-package-arg/node_modules/semver/ranges/to-comparators.js +0 -10
  1102. package/node_modules/npm-package-arg/node_modules/semver/ranges/valid.js +0 -13
  1103. package/node_modules/unbash/LICENSE +0 -15
  1104. package/node_modules/unbash/README.md +0 -289
  1105. package/node_modules/unbash/dist/ansi-c.d.ts +0 -5
  1106. package/node_modules/unbash/dist/ansi-c.js +0 -130
  1107. package/node_modules/unbash/dist/arithmetic.d.ts +0 -11
  1108. package/node_modules/unbash/dist/arithmetic.js +0 -530
  1109. package/node_modules/unbash/dist/assignment.d.ts +0 -15
  1110. package/node_modules/unbash/dist/assignment.js +0 -118
  1111. package/node_modules/unbash/dist/chars.d.ts +0 -41
  1112. package/node_modules/unbash/dist/chars.js +0 -41
  1113. package/node_modules/unbash/dist/command.d.ts +0 -14
  1114. package/node_modules/unbash/dist/command.js +0 -41
  1115. package/node_modules/unbash/dist/heredoc.d.ts +0 -18
  1116. package/node_modules/unbash/dist/heredoc.js +0 -25
  1117. package/node_modules/unbash/dist/internal-types.d.ts +0 -87
  1118. package/node_modules/unbash/dist/lexer.d.ts +0 -202
  1119. package/node_modules/unbash/dist/lexer.js +0 -3930
  1120. package/node_modules/unbash/dist/parser.d.ts +0 -4
  1121. package/node_modules/unbash/dist/parser.js +0 -1295
  1122. package/node_modules/unbash/dist/parts.d.ts +0 -17
  1123. package/node_modules/unbash/dist/parts.js +0 -82
  1124. package/node_modules/unbash/dist/printer.d.ts +0 -2
  1125. package/node_modules/unbash/dist/printer.js +0 -536
  1126. package/node_modules/unbash/dist/types.d.ts +0 -494
  1127. package/node_modules/unbash/dist/word.d.ts +0 -22
  1128. package/node_modules/unbash/dist/word.js +0 -102
  1129. package/node_modules/unbash/package.json +0 -80
  1130. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/root → preset-vue-hono-app/native/resources/joint-e2e}/test/e2e/fixtures.ts +0 -0
  1131. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/index.ts +0 -0
  1132. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/runtime.ts +0 -0
  1133. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/src/server.ts +0 -0
  1134. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/api → reference-hono-api/native}/test/app.test.ts +0 -0
  1135. /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → reference-rust-bin/native}/rustfmt.toml +0 -0
  1136. /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → reference-rust-bin/native}/src/main.rs +0 -0
  1137. /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation/typescript-config → reference-tooling-config/native}/base.json +0 -0
  1138. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/oxc → reference-tooling-config/native}/oxfmt.config.ts +0 -0
  1139. /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-cli/src → reference-ts-cli/native/src/publication}/cli-command-identity.ts +0 -0
  1140. /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-lib → reference-ts-lib/native}/src/index.ts +0 -0
  1141. /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-lib → reference-ts-lib/native}/src/name-schema.ts +0 -0
  1142. /package/node_modules/@ykdz/{template-builtin-presets/templates/ts-lib → reference-ts-lib/native}/test/greet.test.ts +0 -0
  1143. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/scripts/seed-example.ts +0 -0
  1144. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/db.ts +0 -0
  1145. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/index.ts +0 -0
  1146. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/queries/todos.ts +0 -0
  1147. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/readiness.ts +0 -0
  1148. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/schema.ts +0 -0
  1149. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/seed/example.ts +0 -0
  1150. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/storage.ts +0 -0
  1151. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/src/types.ts +0 -0
  1152. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db → reference-vike-db/native}/test/todos.test.ts +0 -0
  1153. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/drizzle/migrations/20260709120325_old_captain_flint/migration.sql +0 -0
  1154. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/drizzle/migrations/20260709120325_old_captain_flint/snapshot.json +0 -0
  1155. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/db-migrations → reference-vike-migrations/native}/tsconfig.build.json +0 -0
  1156. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/+server.ts +0 -0
  1157. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/.env.example +0 -0
  1158. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/vue → reference-vike-web/native}/TESTING.md +0 -0
  1159. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/assets/logo.svg +0 -0
  1160. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/components/PageShell.vue +0 -0
  1161. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+Head.vue +0 -0
  1162. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+Layout.vue +0 -0
  1163. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/+config.ts +0 -0
  1164. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/pages/tailwind.css +0 -0
  1165. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/playwright.config.ts +0 -0
  1166. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/server/api.ts +0 -0
  1167. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/test/playwright-teardown.ts +0 -0
  1168. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app/web → reference-vike-web/native}/types/env.d.ts +0 -0
  1169. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/env.d.ts +0 -0
  1170. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/index.html +0 -0
  1171. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/playwright.config.ts +0 -0
  1172. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-app → reference-vue-app/native}/src/App.vue +0 -0
  1173. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/vue → reference-vue-app/native}/src/main.ts +0 -0
  1174. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared/vue → reference-vue-app/native}/src/stores/counter.ts +0 -0
  1175. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/env.d.ts +0 -0
  1176. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/index.html +0 -0
  1177. /package/node_modules/@ykdz/{template-builtin-presets/templates/vue-hono-app/web → reference-vue-hono-web/native}/src/api.ts +0 -0
  1178. /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation/AGENTS.md.template → template-workspace/assets/agent-instructions.md} +0 -0
  1179. /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation/devcontainer → template-workspace/assets/environment}/base.Dockerfile +0 -0
  1180. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/devcontainer/browser-test.Dockerfile +0 -0
  1181. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/devcontainer/github-cli.Dockerfile +0 -0
  1182. /package/node_modules/@ykdz/{template-builtin-presets/templates/rust-bin → template-workspace/assets/environment}/devcontainer/rust.Dockerfile +0 -0
  1183. /package/node_modules/@ykdz/{template-builtin-presets/templates/vike-app → template-workspace/assets/environment}/devcontainer/shellcheck.Dockerfile +0 -0
  1184. /package/node_modules/@ykdz/{template-builtin-presets/templates/shared → template-workspace/assets/environment}/editor-customization/capabilities.json +0 -0
  1185. /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation → template-workspace/assets}/gitignore +0 -0
  1186. /package/node_modules/@ykdz/{template-builtin-presets/templates/foundation → template-workspace/assets}/tsconfig.json +0 -0
  1187. /package/node_modules/{unbash/dist/internal-types.js → @ykdz/template-workspace/dist/generation-context.js} +0 -0
  1188. /package/node_modules/{unbash/dist/types.js → @ykdz/template-workspace/dist/project-requirements.js} +0 -0
  1189. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/LICENSE +0 -0
  1190. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/README.md +0 -0
  1191. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/bin/semver.js +0 -0
  1192. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/comparator.js +0 -0
  1193. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/index.js +0 -0
  1194. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/range.js +0 -0
  1195. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/classes/semver.js +0 -0
  1196. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/clean.js +0 -0
  1197. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/cmp.js +0 -0
  1198. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/coerce.js +0 -0
  1199. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare-build.js +0 -0
  1200. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare-loose.js +0 -0
  1201. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/compare.js +0 -0
  1202. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/diff.js +0 -0
  1203. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/eq.js +0 -0
  1204. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/gt.js +0 -0
  1205. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/gte.js +0 -0
  1206. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/inc.js +0 -0
  1207. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/lt.js +0 -0
  1208. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/lte.js +0 -0
  1209. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/major.js +0 -0
  1210. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/minor.js +0 -0
  1211. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/neq.js +0 -0
  1212. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/parse.js +0 -0
  1213. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/patch.js +0 -0
  1214. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/prerelease.js +0 -0
  1215. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/rcompare.js +0 -0
  1216. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/rsort.js +0 -0
  1217. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/satisfies.js +0 -0
  1218. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/sort.js +0 -0
  1219. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/truncate.js +0 -0
  1220. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/functions/valid.js +0 -0
  1221. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/index.js +0 -0
  1222. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/constants.js +0 -0
  1223. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/debug.js +0 -0
  1224. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/identifiers.js +0 -0
  1225. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/lrucache.js +0 -0
  1226. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/parse-options.js +0 -0
  1227. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/internal/re.js +0 -0
  1228. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/package.json +0 -0
  1229. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/preload.js +0 -0
  1230. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/range.bnf +0 -0
  1231. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/gtr.js +0 -0
  1232. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/intersects.js +0 -0
  1233. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/ltr.js +0 -0
  1234. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/max-satisfying.js +0 -0
  1235. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/min-satisfying.js +0 -0
  1236. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/min-version.js +0 -0
  1237. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/outside.js +0 -0
  1238. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/simplify.js +0 -0
  1239. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/subset.js +0 -0
  1240. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/to-comparators.js +0 -0
  1241. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/semver → semver}/ranges/valid.js +0 -0
  1242. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/LICENSE.md +0 -0
  1243. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/README.md +0 -0
  1244. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.cjs +0 -0
  1245. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.d.cts +0 -0
  1246. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.d.mts +0 -0
  1247. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.min.cjs +0 -0
  1248. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.min.mjs +0 -0
  1249. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/dist/index.mjs +0 -0
  1250. /package/node_modules/{@ykdz/template-builtin-presets/node_modules/valibot → valibot}/package.json +0 -0
@@ -1,3930 +0,0 @@
1
- import { decodeAnsiCQuoted } from "./ansi-c.js";
2
- import { parseArithmeticExpression } from "./arithmetic.js";
3
- import { WordImpl } from "./word.js";
4
- import { CH_TAB, CH_NL, CH_SPACE, CH_BANG, CH_DQUOTE, CH_HASH, CH_DOLLAR, CH_PERCENT, CH_AMP, CH_SQUOTE, CH_LPAREN, CH_RPAREN, CH_STAR, CH_PLUS, CH_COMMA, CH_DASH, CH_SLASH, CH_0, CH_9, CH_COLON, CH_SEMI, CH_LT, CH_EQ, CH_GT, CH_QUESTION, CH_AT, CH_A, CH_Z, CH_LBRACKET, CH_BACKSLASH, CH_RBRACKET, CH_CARET, CH_UNDERSCORE, CH_BACKTICK, CH_a, CH_z, CH_LBRACE, CH_PIPE, CH_RBRACE, } from "./chars.js";
5
- // Shared nesting budget for compound syntax and for structure materialized on demand
6
- // (sub-field words, nested substitution scripts). 256 nested levels stay lossless; past
7
- // that the lexer stops descending instead of overflowing the stack: deeper sub-fields
8
- // keep their raw text without parts, and substitution scripts stay unresolved past one
9
- // boundary script flagged with "maximum substitution nesting depth exceeded". The
10
- // iterative scanners additionally report the depth error where their counters can see
11
- // it (nested `${`, `$((`, and `$(`); cut-offs those counters cannot see (e.g. chains
12
- // interleaved with double quotes) degrade to plain text without an error.
13
- export const MAX_SYNTAX_NESTING = 256;
14
- export const Token = {
15
- Word: 0,
16
- Assignment: 1,
17
- Semi: 2,
18
- Newline: 3,
19
- Pipe: 4,
20
- And: 5,
21
- Or: 6,
22
- Amp: 7,
23
- LParen: 8,
24
- RParen: 9,
25
- LBrace: 10,
26
- RBrace: 11,
27
- Bang: 12,
28
- If: 13,
29
- Then: 14,
30
- Else: 15,
31
- Elif: 16,
32
- Fi: 17,
33
- Do: 18,
34
- Done: 19,
35
- For: 20,
36
- While: 21,
37
- Until: 22,
38
- In: 23,
39
- Case: 24,
40
- Esac: 25,
41
- Function: 26,
42
- DoubleSemi: 27,
43
- SemiAmp: 28,
44
- DoubleSemiAmp: 29,
45
- Select: 30,
46
- DblLBracket: 31,
47
- DblRBracket: 32,
48
- EOF: 33,
49
- ArithCmd: 34,
50
- Coproc: 35,
51
- Redirect: 36,
52
- };
53
- export class TokenValue {
54
- token = Token.EOF;
55
- // Materialized token value, or null for word tokens whose value has not been
56
- // requested yet (computed from [pos, end) on demand via the owning lexer).
57
- _value = "";
58
- _owner;
59
- pos = 0;
60
- end = 0;
61
- fileDescriptor = undefined;
62
- variableName = undefined;
63
- descriptorEnd = 0;
64
- delimiterQuoted = false;
65
- content = undefined;
66
- targetPos = 0;
67
- targetEnd = 0;
68
- assignmentOperatorPos = -1;
69
- // True when `value` is exactly the raw source span [pos, end) — lets consumers
70
- // reuse the string instead of slicing the source again.
71
- raw = false;
72
- // True when a word contains no quoting, escaped characters, or expansions.
73
- // Backslash-newline continuations preserve keyword eligibility.
74
- keywordEligible = false;
75
- constructor(owner = null) {
76
- this._owner = owner;
77
- }
78
- get value() {
79
- return (this._value ?? (this._value = this._owner === null ? "" : this._owner._tokenValue(this.pos, this.end, this.raw)));
80
- }
81
- set value(v) {
82
- this._value = v;
83
- }
84
- reset() {
85
- this.token = Token.EOF;
86
- this._value = "";
87
- this.pos = 0;
88
- this.end = 0;
89
- this.fileDescriptor = undefined;
90
- this.variableName = undefined;
91
- this.descriptorEnd = 0;
92
- this.delimiterQuoted = false;
93
- this.content = undefined;
94
- this.targetPos = 0;
95
- this.targetEnd = 0;
96
- this.assignmentOperatorPos = -1;
97
- this.raw = false;
98
- this.keywordEligible = false;
99
- }
100
- copyFrom(other) {
101
- this.token = other.token;
102
- this._value = other._value;
103
- this.pos = other.pos;
104
- this.end = other.end;
105
- this.fileDescriptor = other.fileDescriptor;
106
- this.variableName = other.variableName;
107
- this.descriptorEnd = other.descriptorEnd;
108
- this.delimiterQuoted = other.delimiterQuoted;
109
- this.content = other.content;
110
- this.targetPos = other.targetPos;
111
- this.targetEnd = other.targetEnd;
112
- this.assignmentOperatorPos = other.assignmentOperatorPos;
113
- this.raw = other.raw;
114
- this.keywordEligible = other.keywordEligible;
115
- }
116
- }
117
- const RESERVED_WORDS = new Map([
118
- ["if", Token.If],
119
- ["then", Token.Then],
120
- ["else", Token.Else],
121
- ["elif", Token.Elif],
122
- ["fi", Token.Fi],
123
- ["do", Token.Do],
124
- ["done", Token.Done],
125
- ["for", Token.For],
126
- ["while", Token.While],
127
- ["until", Token.Until],
128
- ["in", Token.In],
129
- ["case", Token.Case],
130
- ["esac", Token.Esac],
131
- ["function", Token.Function],
132
- ["select", Token.Select],
133
- ["coproc", Token.Coproc],
134
- ["!", Token.Bang],
135
- ["{", Token.LBrace],
136
- ["}", Token.RBrace],
137
- ]);
138
- // `name()` is a syntax error for these; `time`, `[[` and `]]` are matched positionally
139
- // rather than through RESERVED_WORDS, and a name spelled like an assignment reads as a prefix.
140
- export function requiresFunctionKeyword(name) {
141
- return RESERVED_WORDS.has(name) || name === "time" || name === "[[" || name === "]]" || name.includes("=");
142
- }
143
- // Combined character type table — bit 0: metachar, bit 1: word-special
144
- const charType = new Uint8Array(128);
145
- charType[CH_PIPE] = 1;
146
- charType[CH_AMP] = 1;
147
- charType[CH_SEMI] = 1;
148
- charType[CH_LPAREN] = 1;
149
- charType[CH_RPAREN] = 1;
150
- charType[CH_LT] = 1;
151
- charType[CH_GT] = 1;
152
- charType[CH_SPACE] = 1;
153
- charType[CH_TAB] = 1;
154
- charType[CH_NL] = 1;
155
- charType[CH_BACKSLASH] = 2;
156
- charType[CH_SQUOTE] = 2;
157
- charType[CH_DQUOTE] = 2;
158
- charType[CH_DOLLAR] = 2;
159
- charType[CH_BACKTICK] = 2;
160
- charType[CH_LBRACE] = 2;
161
- export function skipLineContinuations(source, pos, end) {
162
- while (pos + 1 < end && source.charCodeAt(pos) === CH_BACKSLASH && source.charCodeAt(pos + 1) === CH_NL)
163
- pos += 2;
164
- return pos;
165
- }
166
- const arithmeticWordDelimiter = new Uint8Array(128);
167
- for (const ch of [
168
- CH_TAB,
169
- CH_NL,
170
- CH_SPACE,
171
- CH_BANG,
172
- CH_PERCENT,
173
- CH_AMP,
174
- CH_LPAREN,
175
- CH_RPAREN,
176
- CH_STAR,
177
- CH_PLUS,
178
- CH_COMMA,
179
- CH_DASH,
180
- CH_SLASH,
181
- CH_COLON,
182
- CH_LT,
183
- CH_EQ,
184
- CH_GT,
185
- CH_QUESTION,
186
- CH_CARET,
187
- CH_PIPE,
188
- ]) {
189
- arithmeticWordDelimiter[ch] = 1;
190
- }
191
- export function hasEmbeddedWordStructure(source, start, end) {
192
- for (let pos = start; pos < end; pos++) {
193
- const ch = source.charCodeAt(pos);
194
- if (ch === CH_BACKSLASH ||
195
- ch === CH_SQUOTE ||
196
- ch === CH_DQUOTE ||
197
- ch === CH_DOLLAR ||
198
- ch === CH_BACKTICK ||
199
- ((ch === CH_LT || ch === CH_GT) && pos + 1 < end && source.charCodeAt(pos + 1) === CH_LPAREN)) {
200
- return true;
201
- }
202
- }
203
- return false;
204
- }
205
- function findUnnested(s, target, pairTernaries = false, findNestedEnd) {
206
- let depth = 0;
207
- let ternaryDepth = 0;
208
- for (let i = 0; i < s.length; i++) {
209
- const c = s.charCodeAt(i);
210
- if (c === CH_BACKSLASH) {
211
- i++;
212
- continue;
213
- }
214
- if (c === CH_LBRACE) {
215
- depth++;
216
- continue;
217
- }
218
- if (c === CH_RBRACE) {
219
- if (depth > 0)
220
- depth--;
221
- continue;
222
- }
223
- if (c === CH_SQUOTE) {
224
- i++;
225
- while (i < s.length && s.charCodeAt(i) !== CH_SQUOTE)
226
- i++;
227
- continue;
228
- }
229
- if (c === CH_DQUOTE) {
230
- i++;
231
- while (i < s.length) {
232
- const quoted = s.charCodeAt(i);
233
- if (quoted === CH_DQUOTE)
234
- break;
235
- if (quoted === CH_BACKSLASH) {
236
- i += 2;
237
- continue;
238
- }
239
- const nestedEnd = findNestedEnd?.(i, true) ?? i;
240
- if (nestedEnd > i) {
241
- i = nestedEnd;
242
- continue;
243
- }
244
- i++;
245
- }
246
- continue;
247
- }
248
- const nestedEnd = findNestedEnd?.(i, false) ?? i;
249
- if (nestedEnd > i) {
250
- i = nestedEnd - 1;
251
- continue;
252
- }
253
- if (pairTernaries && depth === 0) {
254
- if (c === CH_QUESTION) {
255
- ternaryDepth++;
256
- continue;
257
- }
258
- if (c === CH_COLON && ternaryDepth > 0) {
259
- ternaryDepth--;
260
- continue;
261
- }
262
- }
263
- if (c === target && depth === 0)
264
- return i;
265
- }
266
- return -1;
267
- }
268
- // Lookup: identifier chars (a-z, A-Z, 0-9, _) — bit 0: start, bit 1: continue
269
- const isIdChar = new Uint8Array(128);
270
- for (let i = CH_a; i <= CH_z; i++)
271
- isIdChar[i] = 3;
272
- for (let i = CH_A; i <= CH_Z; i++)
273
- isIdChar[i] = 3;
274
- for (let i = CH_0; i <= CH_9; i++)
275
- isIdChar[i] = 2;
276
- isIdChar[CH_UNDERSCORE] = 3;
277
- const extglobPrefix = new Uint8Array(128);
278
- extglobPrefix[CH_QUESTION] = 1;
279
- extglobPrefix[CH_AT] = 1;
280
- extglobPrefix[CH_STAR] = 1;
281
- extglobPrefix[CH_PLUS] = 1;
282
- extglobPrefix[CH_BANG] = 1;
283
- extglobPrefix[CH_EQ] = 1;
284
- const extglobOp = {
285
- [CH_QUESTION]: "?",
286
- [CH_AT]: "@",
287
- [CH_STAR]: "*",
288
- [CH_PLUS]: "+",
289
- [CH_BANG]: "!",
290
- };
291
- function isDQChild(p) {
292
- const t = p.type;
293
- return (t === "Literal" ||
294
- t === "SimpleExpansion" ||
295
- t === "ParameterExpansion" ||
296
- t === "CommandExpansion" ||
297
- t === "ArithmeticExpansion");
298
- }
299
- function isAllDigitsRange(src, start, end) {
300
- for (let i = start; i < end; i++) {
301
- const c = src.charCodeAt(i);
302
- if (c < CH_0 || c > CH_9)
303
- return false;
304
- }
305
- return end > start;
306
- }
307
- const ASSIGNMENT_INVALID = -1;
308
- const ASSIGNMENT_NAME_START = 0;
309
- const ASSIGNMENT_NAME = 1;
310
- const ASSIGNMENT_AFTER_INDEX = 2;
311
- const ASSIGNMENT_AFTER_PLUS = 3;
312
- const ASSIGNMENT_INDEX_BASE = 4;
313
- function isMatchedAssignment(state) {
314
- return state < ASSIGNMENT_INVALID;
315
- }
316
- function assignmentOperatorPos(state) {
317
- return -state - 2;
318
- }
319
- function scanAssignmentPrefix(src, start, end, initialState) {
320
- let state = initialState;
321
- for (let i = start; i < end && state >= 0; i++) {
322
- const c = src.charCodeAt(i);
323
- if (state >= ASSIGNMENT_INDEX_BASE) {
324
- if (c === CH_LBRACKET)
325
- state++;
326
- else if (c === CH_RBRACKET && --state === ASSIGNMENT_INDEX_BASE)
327
- state = ASSIGNMENT_AFTER_INDEX;
328
- }
329
- else if (state === ASSIGNMENT_NAME_START) {
330
- state = c < 128 && isIdChar[c] & 1 ? ASSIGNMENT_NAME : ASSIGNMENT_INVALID;
331
- }
332
- else if (state === ASSIGNMENT_NAME) {
333
- if (c < 128 && isIdChar[c] & 2)
334
- continue;
335
- if (c === CH_LBRACKET)
336
- state = ASSIGNMENT_INDEX_BASE + 1;
337
- else if (c === CH_PLUS)
338
- state = ASSIGNMENT_AFTER_PLUS;
339
- else
340
- state = c === CH_EQ ? -i - 2 : ASSIGNMENT_INVALID;
341
- }
342
- else if (state === ASSIGNMENT_AFTER_INDEX) {
343
- if (c === CH_PLUS)
344
- state = ASSIGNMENT_AFTER_PLUS;
345
- else
346
- state = c === CH_EQ ? -i - 2 : ASSIGNMENT_INVALID;
347
- }
348
- else {
349
- state = c === CH_EQ ? -i - 2 : ASSIGNMENT_INVALID;
350
- }
351
- }
352
- return state;
353
- }
354
- const NO_EXPANSIONS = [];
355
- function setToken(out, token, value, pos = 0, end = 0) {
356
- out.token = token;
357
- out._value = value;
358
- out.pos = pos;
359
- out.end = end;
360
- out.fileDescriptor = undefined;
361
- out.variableName = undefined;
362
- out.descriptorEnd = 0;
363
- out.delimiterQuoted = false;
364
- out.content = undefined;
365
- out.assignmentOperatorPos = -1;
366
- out.raw = false;
367
- out.keywordEligible = false;
368
- }
369
- // Word token over [pos, end) whose value materializes on first access.
370
- function setSpanToken(out, token, pos, end, raw) {
371
- out.token = token;
372
- out._value = null;
373
- out.pos = pos;
374
- out.end = end;
375
- out.fileDescriptor = undefined;
376
- out.variableName = undefined;
377
- out.descriptorEnd = 0;
378
- out.delimiterQuoted = false;
379
- out.content = undefined;
380
- out.assignmentOperatorPos = -1;
381
- out.raw = raw;
382
- out.keywordEligible = false;
383
- }
384
- // Positional reserved-word match over src[start, start+len) — no slice. Mirrors
385
- // RESERVED_WORDS; first-char dispatch plus length checks reject fast.
386
- function matchReservedWord(src, start, len) {
387
- switch (src.charCodeAt(start)) {
388
- case CH_BANG:
389
- return len === 1 ? Token.Bang : undefined;
390
- case CH_LBRACE:
391
- return len === 1 ? Token.LBrace : undefined;
392
- case CH_RBRACE:
393
- return len === 1 ? Token.RBrace : undefined;
394
- case 0x69 /* i */: {
395
- if (len !== 2)
396
- return undefined;
397
- const c = src.charCodeAt(start + 1);
398
- return c === 0x66 /* f */ ? Token.If : c === 0x6e /* n */ ? Token.In : undefined;
399
- }
400
- case 0x66 /* f */:
401
- if (len === 2)
402
- return src.charCodeAt(start + 1) === 0x69 /* i */ ? Token.Fi : undefined;
403
- if (len === 3)
404
- return src.startsWith("for", start) ? Token.For : undefined;
405
- if (len === 8)
406
- return src.startsWith("function", start) ? Token.Function : undefined;
407
- return undefined;
408
- case 0x74 /* t */:
409
- return len === 4 && src.startsWith("then", start) ? Token.Then : undefined;
410
- case 0x65 /* e */:
411
- if (len !== 4)
412
- return undefined;
413
- if (src.startsWith("else", start))
414
- return Token.Else;
415
- if (src.startsWith("elif", start))
416
- return Token.Elif;
417
- if (src.startsWith("esac", start))
418
- return Token.Esac;
419
- return undefined;
420
- case 0x64 /* d */:
421
- if (len === 2)
422
- return src.charCodeAt(start + 1) === 0x6f /* o */ ? Token.Do : undefined;
423
- if (len === 4)
424
- return src.startsWith("done", start) ? Token.Done : undefined;
425
- return undefined;
426
- case 0x63 /* c */:
427
- if (len === 4)
428
- return src.startsWith("case", start) ? Token.Case : undefined;
429
- if (len === 6)
430
- return src.startsWith("coproc", start) ? Token.Coproc : undefined;
431
- return undefined;
432
- case 0x77 /* w */:
433
- return len === 5 && src.startsWith("while", start) ? Token.While : undefined;
434
- case 0x75 /* u */:
435
- return len === 5 && src.startsWith("until", start) ? Token.Until : undefined;
436
- case 0x73 /* s */:
437
- return len === 6 && src.startsWith("select", start) ? Token.Select : undefined;
438
- default:
439
- return undefined;
440
- }
441
- }
442
- export const LexContext = {
443
- Normal: 0,
444
- CommandStart: 1,
445
- TestMode: 2,
446
- // After a prefix element: assignments still recognized, reserved words not.
447
- CommandPrefix: 3,
448
- // Assignment arguments retain ordinary word boundaries inside subscripts.
449
- Declaration: 4,
450
- ArrayElement: 5,
451
- };
452
- function scanBraceExpansion(src, pos, len) {
453
- const nextCh = pos + 1 < len ? src.charCodeAt(pos + 1) : 0;
454
- if (nextCh <= CH_SPACE || nextCh === CH_RBRACE)
455
- return -1;
456
- let depth = 1;
457
- let hasSep = false;
458
- let scanPos = pos + 1;
459
- while (scanPos < len && depth > 0) {
460
- const bc = src.charCodeAt(scanPos);
461
- if (bc === CH_LBRACE)
462
- depth++;
463
- else if (bc === CH_RBRACE) {
464
- if (--depth === 0)
465
- break;
466
- }
467
- else if (bc <= CH_SPACE || bc === CH_SEMI || bc === CH_PIPE || bc === CH_AMP)
468
- return -1;
469
- else if (depth === 1 &&
470
- (bc === 0x2c /* , */ || (bc === 0x2e /* . */ && scanPos + 1 < len && src.charCodeAt(scanPos + 1) === 0x2e)))
471
- hasSep = true;
472
- if (bc === CH_BACKSLASH)
473
- scanPos++;
474
- scanPos++;
475
- }
476
- if (depth === 0 && hasSep)
477
- return scanPos + 1;
478
- return -1;
479
- }
480
- export class Lexer {
481
- src;
482
- srcEnd;
483
- parenBoundary;
484
- pos;
485
- current;
486
- nextState;
487
- hasPeek;
488
- pendingHereDocs;
489
- collectedExpansions;
490
- _errors = null;
491
- _buildParts = false;
492
- // Build processed text while scanning. Off on the normal token path (values
493
- // materialize lazily); on for redirect targets, heredoc delimiters, arithmetic
494
- // command bodies, and bounded value re-lexes. _buildParts implies it.
495
- _buildValue = false;
496
- // Nesting depth of the window being lexed (enclosing sub-fields plus substitution
497
- // scripts), sharing the MAX_SYNTAX_NESTING budget across lazily created lexers.
498
- _nestingDepth = 0;
499
- // `start`/`end` bound the lexer to a window of `src` so substitution scripts can be
500
- // parsed in place against the original source — every position is then absolute, with
501
- // no slicing or re-basing. Defaults cover the whole string (the common top-level parse).
502
- constructor(src, start = 0, end = src.length, parenBoundary = false) {
503
- this.src = src;
504
- this.srcEnd = end;
505
- this.parenBoundary = parenBoundary;
506
- this.pos = start;
507
- this.current = new TokenValue(this);
508
- this.nextState = new TokenValue(this);
509
- this.hasPeek = false;
510
- this.pendingHereDocs = null;
511
- this.collectedExpansions = null;
512
- if (start === 0 && src.charCodeAt(0) === CH_HASH && src.charCodeAt(1) === CH_BANG) {
513
- const nl = src.indexOf("\n");
514
- this.pos = nl === -1 ? this.srcEnd : nl + 1;
515
- }
516
- }
517
- getSource() {
518
- return this.src;
519
- }
520
- get errors() {
521
- return this._errors ?? (this._errors = []);
522
- }
523
- getCollectedExpansions() {
524
- return this.collectedExpansions ?? NO_EXPANSIONS;
525
- }
526
- // Collected expansions resolve after the enclosing scan unwinds, so each records the
527
- // depth it was found at; resolveCollected charges that depth against the shared budget.
528
- collect(part, inner, innerStart, parenBoundary = false) {
529
- (this.collectedExpansions ?? (this.collectedExpansions = [])).push([
530
- part,
531
- this._nestingDepth,
532
- inner,
533
- innerStart,
534
- parenBoundary,
535
- ]);
536
- }
537
- getPos() {
538
- return this.pos;
539
- }
540
- /** Materialize a word token's value: raw spans slice directly, others re-lex the span. */
541
- _tokenValue(pos, end, raw) {
542
- return raw ? this.src.slice(pos, end) : this.wordValueOf(pos, end);
543
- }
544
- // Re-lex [start, end) in value mode to produce the processed word text. Bounded
545
- // to the span, so every expansion the original scan consumed closes within it.
546
- // Errors were already reported by the original scan; suppress duplicates.
547
- wordValueOf(start, end) {
548
- const savedPos = this.pos;
549
- const savedEnd = this.srcEnd;
550
- const savedBuildValue = this._buildValue;
551
- const savedUnbalanced = this._unbalanced;
552
- const errorCount = this._errors === null ? 0 : this._errors.length;
553
- this.pos = start;
554
- this.srcEnd = end;
555
- this._buildValue = true;
556
- this.readWordText();
557
- const value = this._wordText;
558
- this.pos = savedPos;
559
- this.srcEnd = savedEnd;
560
- this._buildValue = savedBuildValue;
561
- this._unbalanced = savedUnbalanced;
562
- if (this._errors !== null)
563
- this._errors.length = errorCount;
564
- return value;
565
- }
566
- /** Find the closing bracket for a shell subscript, ignoring brackets inside nested shell syntax. */
567
- findClosingBracket(start, end = this.srcEnd) {
568
- return this.findClosingShellDelimiter(start, end, CH_RBRACKET);
569
- }
570
- /** Find the closing bracket of `$[ … ]`, which unlike a subscript does not recurse into `${ }`. */
571
- findClosingArithmeticBracket(start, end = this.srcEnd) {
572
- return this.findClosingShellDelimiter(start, end, CH_RBRACKET, false, false);
573
- }
574
- /** Find the closing brace for a parameter expansion, ignoring braces inside nested shell syntax. */
575
- findClosingBrace(start, end = this.srcEnd) {
576
- return this.findClosingShellDelimiter(start, end, CH_RBRACE);
577
- }
578
- /** Find the closing parenthesis for a shell substitution using the command-aware scanner. */
579
- findClosingParenthesis(start, end = this.srcEnd) {
580
- const savedPos = this.pos;
581
- const savedEnd = this.srcEnd;
582
- const savedUnbalanced = this._unbalanced;
583
- this.pos = start;
584
- this.srcEnd = Math.min(end, this.srcEnd);
585
- this.extractBalanced();
586
- const close = this._unbalanced ? -1 : this.pos - 1;
587
- this.pos = savedPos;
588
- this.srcEnd = savedEnd;
589
- this._unbalanced = savedUnbalanced;
590
- return close;
591
- }
592
- /** Find the end of one arithmetic expansion using the canonical lexer scanner. */
593
- findArithmeticExpansionEnd(start, end = this.srcEnd) {
594
- const scanner = new Lexer(this.src, start, end);
595
- scanner.pos = start + 1;
596
- scanner.scanArithmeticBody();
597
- return scanner.pos;
598
- }
599
- /** Find the end of one shell-expanded arithmetic word using the canonical lexer scanners. */
600
- findArithmeticWordEnd(start, end = this.srcEnd) {
601
- const scanner = new Lexer(this.src, start, end);
602
- scanner.pos = start;
603
- return scanner.scanArithmeticWordEnd();
604
- }
605
- scanArithmeticWordEnd() {
606
- while (this.pos < this.srcEnd) {
607
- const ch = this.src.charCodeAt(this.pos);
608
- if (ch === CH_DOLLAR) {
609
- this.readDollar();
610
- continue;
611
- }
612
- if (ch === CH_BACKTICK) {
613
- this.readBacktickExpansion();
614
- continue;
615
- }
616
- if (ch === CH_SQUOTE) {
617
- this.pos++;
618
- this.skipSQ();
619
- continue;
620
- }
621
- if (ch === CH_DQUOTE) {
622
- this.pos++;
623
- this.skipDQ();
624
- continue;
625
- }
626
- if (ch === CH_BACKSLASH) {
627
- this.pos += 2;
628
- continue;
629
- }
630
- if (ch === CH_LBRACKET) {
631
- const close = this.findClosingBracket(this.pos + 1);
632
- if (close !== -1) {
633
- this.pos = close + 1;
634
- continue;
635
- }
636
- }
637
- if ((ch === CH_LT || ch === CH_GT) && this.src.charCodeAt(this.pos + 1) === CH_LPAREN) {
638
- this.pos += 2;
639
- this.extractBalanced();
640
- continue;
641
- }
642
- if (ch < 128 && arithmeticWordDelimiter[ch])
643
- break;
644
- this.pos++;
645
- }
646
- return this.pos;
647
- }
648
- // Only array assignment bodies take comments; extglob shares this scanner, and `#` is
649
- // pattern data there.
650
- findClosingShellDelimiter(start, end, closing, comments = false, braces = true) {
651
- const savedPos = this.pos;
652
- const savedEnd = this.srcEnd;
653
- const savedUnbalanced = this._unbalanced;
654
- this.srcEnd = Math.min(end, this.srcEnd);
655
- const delimiters = [closing];
656
- let pos = start;
657
- let wordStart = true;
658
- while (pos < this.srcEnd) {
659
- const ch = this.src.charCodeAt(pos);
660
- if (ch === CH_BACKSLASH) {
661
- if (pos + 1 < this.srcEnd && this.src.charCodeAt(pos + 1) !== CH_NL)
662
- wordStart = false;
663
- pos += 2;
664
- continue;
665
- }
666
- if (ch === CH_HASH && comments && delimiters.length === 1 && wordStart) {
667
- while (pos < this.srcEnd && this.src.charCodeAt(pos) !== CH_NL)
668
- pos++;
669
- continue;
670
- }
671
- if (ch === CH_SQUOTE) {
672
- this.pos = pos + 1;
673
- this.skipSQ();
674
- pos = this.pos;
675
- wordStart = false;
676
- continue;
677
- }
678
- if (ch === CH_DQUOTE) {
679
- this.pos = pos + 1;
680
- this.skipDQ();
681
- pos = this.pos;
682
- wordStart = false;
683
- continue;
684
- }
685
- if (ch === CH_BACKTICK) {
686
- pos++;
687
- while (pos < this.srcEnd && this.src.charCodeAt(pos) !== CH_BACKTICK) {
688
- if (this.src.charCodeAt(pos) === CH_BACKSLASH)
689
- pos++;
690
- pos++;
691
- }
692
- if (pos < this.srcEnd)
693
- pos++;
694
- wordStart = false;
695
- continue;
696
- }
697
- if ((ch === CH_DOLLAR && pos + 1 < this.srcEnd && this.src.charCodeAt(pos + 1) === CH_LPAREN) ||
698
- ((ch === CH_LT || ch === CH_GT) && pos + 1 < this.srcEnd && this.src.charCodeAt(pos + 1) === CH_LPAREN)) {
699
- this.pos = pos + 2;
700
- this.extractBalanced();
701
- pos = this.pos;
702
- wordStart = false;
703
- continue;
704
- }
705
- const expected = delimiters[delimiters.length - 1];
706
- if (ch === CH_DOLLAR && pos + 1 < this.srcEnd) {
707
- const after = this.src.charCodeAt(pos + 1);
708
- if (after === CH_DOLLAR) {
709
- pos += 2; // `$$` consumes its second `$`, so a `{` after it opens nothing
710
- wordStart = false;
711
- continue;
712
- }
713
- if (after === CH_LBRACE && braces) {
714
- delimiters.push(CH_RBRACE);
715
- pos += 2;
716
- wordStart = false;
717
- continue;
718
- }
719
- }
720
- if (expected === CH_RBRACKET && ch === CH_LBRACKET) {
721
- delimiters.push(CH_RBRACKET);
722
- }
723
- else if (expected === CH_RPAREN && ch === CH_LPAREN) {
724
- delimiters.push(CH_RPAREN);
725
- }
726
- else if (ch === expected) {
727
- delimiters.pop();
728
- if (delimiters.length === 0) {
729
- this.pos = savedPos;
730
- this.srcEnd = savedEnd;
731
- this._unbalanced = savedUnbalanced;
732
- return pos;
733
- }
734
- wordStart = false;
735
- pos++;
736
- continue;
737
- }
738
- wordStart = ch < 128 && (charType[ch] & 1) !== 0;
739
- pos++;
740
- }
741
- this.pos = savedPos;
742
- this.srcEnd = savedEnd;
743
- this._unbalanced = savedUnbalanced;
744
- return -1;
745
- }
746
- skipSubshellBody() {
747
- this.extractBalanced();
748
- return this._unbalanced ? -1 : this.pos;
749
- }
750
- skipCompoundBody(closeToken) {
751
- const frames = [
752
- { close: closeToken, phase: closeToken === Token.Esac ? "case-pattern" : "commands" },
753
- ];
754
- let commandStart = true;
755
- for (;;) {
756
- const value = this.next(commandStart ? LexContext.CommandStart : LexContext.Normal);
757
- const token = value.token;
758
- if (token === Token.EOF)
759
- return -1;
760
- const last = frames.length - 1;
761
- const frame = frames[last];
762
- if (frame.phase === "function-name") {
763
- if (token === Token.Newline)
764
- continue;
765
- frame.phase = "function-body";
766
- commandStart = true;
767
- continue;
768
- }
769
- else if (frame.phase === "function-body") {
770
- if (token === Token.Newline)
771
- continue;
772
- frame.phase = "commands";
773
- commandStart = true;
774
- if (token === Token.LParen && this.peek(LexContext.Normal).token === Token.RParen) {
775
- this.next(LexContext.Normal);
776
- frame.phase = "function-body";
777
- continue;
778
- }
779
- }
780
- else if (frame.phase === "coproc-command") {
781
- if (token === Token.Newline)
782
- continue;
783
- if (token === Token.Word) {
784
- frame.phase = "coproc-body";
785
- commandStart = true;
786
- continue;
787
- }
788
- frame.phase = "commands";
789
- commandStart = true;
790
- }
791
- else if (frame.phase === "coproc-body") {
792
- if (token === Token.Newline)
793
- continue;
794
- frame.phase =
795
- token === Token.Word && value.keywordEligible && value.value === "time" ? "time-command" : "commands";
796
- commandStart = true;
797
- if (frame.phase === "time-command")
798
- continue;
799
- }
800
- else if (frame.phase === "time-command") {
801
- if (token === Token.Word && value.keywordEligible && value.value === "-p") {
802
- frame.phase = "time-command-after-p";
803
- continue;
804
- }
805
- if (token === Token.Word && value.keywordEligible && value.value === "--") {
806
- frame.phase = "commands";
807
- continue;
808
- }
809
- frame.phase = "commands";
810
- commandStart = true;
811
- }
812
- else if (frame.phase === "time-command-after-p") {
813
- if (token === Token.Word && value.keywordEligible && value.value === "--") {
814
- frame.phase = "commands";
815
- continue;
816
- }
817
- frame.phase = "commands";
818
- commandStart = true;
819
- }
820
- else if (frame.phase === "for-header") {
821
- if (token === Token.ArithCmd || token === Token.Semi || token === Token.Newline) {
822
- commandStart = true;
823
- continue;
824
- }
825
- if (token === Token.Do || token === Token.LBrace) {
826
- frame.close = token === Token.Do ? Token.Done : Token.RBrace;
827
- frame.phase = "commands";
828
- commandStart = true;
829
- continue;
830
- }
831
- }
832
- else if (frame.phase === "case-word") {
833
- if (token === Token.Newline)
834
- continue;
835
- frame.phase = "case-in";
836
- commandStart = false;
837
- continue;
838
- }
839
- else if (frame.phase === "case-in") {
840
- if (token === Token.Newline) {
841
- commandStart = true;
842
- continue;
843
- }
844
- frame.phase = "case-pattern";
845
- commandStart = true;
846
- continue;
847
- }
848
- else if (frame.phase === "case-pattern") {
849
- if (token === Token.Esac && commandStart) {
850
- frames.pop();
851
- if (frames.length === 0)
852
- return value.end;
853
- commandStart = false;
854
- continue;
855
- }
856
- if (token === Token.RParen) {
857
- frame.phase = "commands";
858
- commandStart = true;
859
- }
860
- else {
861
- commandStart = token === Token.Newline;
862
- }
863
- continue;
864
- }
865
- if (token === frame.close) {
866
- frames.pop();
867
- if (frames.length === 0)
868
- return value.end;
869
- commandStart = false;
870
- continue;
871
- }
872
- if (commandStart) {
873
- switch (token) {
874
- case Token.LParen:
875
- frames.push({ close: Token.RParen, phase: "commands" });
876
- break;
877
- case Token.LBrace:
878
- frames.push({ close: Token.RBrace, phase: "commands" });
879
- break;
880
- case Token.If:
881
- frames.push({ close: Token.Fi, phase: "commands" });
882
- break;
883
- case Token.For:
884
- frames.push({ close: Token.Done, phase: "for-header" });
885
- break;
886
- case Token.While:
887
- case Token.Until:
888
- case Token.Select:
889
- frames.push({ close: Token.Done, phase: "commands" });
890
- break;
891
- case Token.Case:
892
- frames.push({ close: Token.Esac, phase: "case-word" });
893
- break;
894
- case Token.DblLBracket:
895
- if (!this.skipTestCommandBody())
896
- return -1;
897
- commandStart = false;
898
- continue;
899
- case Token.Assignment:
900
- case Token.Redirect:
901
- case Token.Bang:
902
- case Token.Then:
903
- case Token.Else:
904
- case Token.Elif:
905
- case Token.Do:
906
- case Token.In:
907
- break;
908
- case Token.Semi:
909
- case Token.Newline:
910
- case Token.Pipe:
911
- case Token.And:
912
- case Token.Or:
913
- case Token.Amp:
914
- case Token.DoubleSemi:
915
- case Token.SemiAmp:
916
- case Token.DoubleSemiAmp:
917
- break;
918
- case Token.Function:
919
- frame.phase = "function-name";
920
- break;
921
- case Token.Coproc:
922
- frame.phase = "coproc-command";
923
- break;
924
- default:
925
- if (token === Token.Word && value.keywordEligible && value.value === "time") {
926
- frame.phase = "time-command";
927
- commandStart = true;
928
- }
929
- else {
930
- commandStart = false;
931
- }
932
- continue;
933
- }
934
- }
935
- switch (token) {
936
- case Token.Semi:
937
- case Token.Newline:
938
- case Token.Pipe:
939
- case Token.And:
940
- case Token.Or:
941
- case Token.Amp:
942
- commandStart = true;
943
- break;
944
- case Token.DoubleSemi:
945
- case Token.SemiAmp:
946
- case Token.DoubleSemiAmp:
947
- if (frame.close === Token.Esac)
948
- frame.phase = "case-pattern";
949
- commandStart = true;
950
- break;
951
- case Token.RParen:
952
- commandStart = true;
953
- break;
954
- }
955
- }
956
- }
957
- skipTestGroup() {
958
- let depth = 1;
959
- for (;;) {
960
- const value = this.next(LexContext.TestMode);
961
- if (value.token === Token.EOF)
962
- return -1;
963
- if (value.token === Token.DblRBracket) {
964
- this.unshift(value);
965
- return -1;
966
- }
967
- if (value.token === Token.LParen)
968
- depth++;
969
- else if (value.token === Token.RParen && --depth === 0)
970
- return value.end;
971
- }
972
- }
973
- skipTestCommandBody() {
974
- for (;;) {
975
- const token = this.next(LexContext.TestMode).token;
976
- if (token === Token.DblRBracket)
977
- return true;
978
- if (token === Token.EOF)
979
- return false;
980
- }
981
- }
982
- /** Set position and scan a word, building parts. Used by computeWordParts. */
983
- buildWordParts(startPos) {
984
- this._buildParts = true;
985
- this.pos = startPos;
986
- // Handle process substitution words <(...) and >(...)
987
- const ch = this.src.charCodeAt(startPos);
988
- if ((ch === 0x3c /* < */ || ch === 0x3e) /* > */ &&
989
- startPos + 1 < this.srcEnd &&
990
- this.src.charCodeAt(startPos + 1) === 0x28 /* ( */) {
991
- this.pos = startPos + 2;
992
- const inner = this.extractBalanced();
993
- if (this._unbalanced)
994
- this.errors.push({ message: "unterminated process substitution", pos: startPos });
995
- const text = this.src.slice(startPos, this.pos);
996
- const part = {
997
- type: "ProcessSubstitution",
998
- pos: startPos,
999
- end: this.pos,
1000
- text,
1001
- operator: ch === 0x3c ? "<" : ">",
1002
- script: undefined,
1003
- };
1004
- this.collect(part, inner, startPos + 2, !this._unbalanced);
1005
- // Continue reading any trailing word text (e.g., suffix after proc sub)
1006
- if (this.pos < this.srcEnd) {
1007
- this.readWordText();
1008
- if (this._wordParts) {
1009
- this._wordParts.unshift(part);
1010
- }
1011
- else {
1012
- this._wordParts = [part];
1013
- }
1014
- }
1015
- else {
1016
- this._wordParts = [part];
1017
- }
1018
- }
1019
- else {
1020
- this.readWordText();
1021
- }
1022
- return this._wordParts;
1023
- }
1024
- /** Scan a bounded word-like span without treating shell operators or whitespace as terminators. */
1025
- buildEmbeddedWordParts(startPos) {
1026
- this._buildParts = true;
1027
- this.pos = startPos;
1028
- this.readInnerWordText();
1029
- return this._wordParts;
1030
- }
1031
- buildArrayElementParts(startPos) {
1032
- const close = this.findClosingBracket(startPos + 1);
1033
- if (close === -1)
1034
- return this.buildWordParts(startPos);
1035
- this._buildParts = true;
1036
- const prefix = hasEmbeddedWordStructure(this.src, startPos, close + 1)
1037
- ? this.parseSubFieldWord(startPos, close + 1)
1038
- : undefined;
1039
- this.pos = close + 1;
1040
- this.readWordText();
1041
- const parts = this._wordParts;
1042
- const prefixParts = prefix?.parts;
1043
- if (prefixParts) {
1044
- if (parts)
1045
- return prefixParts.concat(parts);
1046
- if (this.pos > close + 1) {
1047
- prefixParts.push({
1048
- type: "Literal",
1049
- pos: close + 1,
1050
- end: this.pos,
1051
- text: this.src.slice(close + 1, this.pos),
1052
- value: this._wordText,
1053
- });
1054
- }
1055
- return prefixParts;
1056
- }
1057
- if (parts) {
1058
- const text = this.src.slice(startPos, close + 1);
1059
- parts.unshift({ type: "Literal", pos: startPos, end: close + 1, text, value: prefix?.value ?? text });
1060
- }
1061
- return parts;
1062
- }
1063
- /** Scan a heredoc body for expansions, building parts. Spaces/newlines are literal. */
1064
- buildHereDocParts(bodyPos, bodyEnd) {
1065
- this._buildParts = true;
1066
- const src = this.src;
1067
- const parts = [];
1068
- let hasExpansion = false;
1069
- let litBuf = "";
1070
- let litStart = bodyPos;
1071
- let i = bodyPos;
1072
- const flushLit = () => {
1073
- if (i > litStart) {
1074
- parts.push({ type: "Literal", pos: litStart, end: i, value: litBuf, text: src.slice(litStart, i) });
1075
- litBuf = "";
1076
- }
1077
- };
1078
- while (i < bodyEnd) {
1079
- const ch = src.charCodeAt(i);
1080
- if (ch === 0x5c /* \\ */) {
1081
- // Backslash escape — in unquoted heredoc, \\$, \\`, \\\\ are special
1082
- if (i + 1 < bodyEnd) {
1083
- const nc = src.charCodeAt(i + 1);
1084
- if (nc === CH_NL) {
1085
- i += 2;
1086
- continue;
1087
- }
1088
- if (nc === 0x24 /* $ */ || nc === 0x60 /* ` */ || nc === 0x5c /* \\ */) {
1089
- litBuf += String.fromCharCode(nc);
1090
- i += 2;
1091
- continue;
1092
- }
1093
- }
1094
- litBuf += "\\";
1095
- i++;
1096
- continue;
1097
- }
1098
- if (ch === 0x24 /* $ */) {
1099
- flushLit();
1100
- litStart = i;
1101
- this.pos = i;
1102
- this.readDollar();
1103
- if (this._resultPart) {
1104
- hasExpansion = true;
1105
- parts.push(this._resultPart);
1106
- litStart = this.pos;
1107
- }
1108
- else {
1109
- litBuf += src.slice(i, this.pos);
1110
- }
1111
- i = this.pos;
1112
- continue;
1113
- }
1114
- if (ch === 0x60 /* ` */) {
1115
- flushLit();
1116
- litStart = i;
1117
- this.pos = i;
1118
- this.readBacktickExpansion();
1119
- if (this._resultPart) {
1120
- hasExpansion = true;
1121
- parts.push(this._resultPart);
1122
- litStart = this.pos;
1123
- }
1124
- else {
1125
- litBuf += src.slice(i, this.pos);
1126
- }
1127
- i = this.pos;
1128
- continue;
1129
- }
1130
- litBuf += src[i];
1131
- i++;
1132
- }
1133
- flushLit();
1134
- return hasExpansion ? parts : null;
1135
- }
1136
- registerHereDocTarget(target) {
1137
- if (this.pendingHereDocs === null)
1138
- return;
1139
- for (const hd of this.pendingHereDocs) {
1140
- if (!hd.target) {
1141
- hd.target = target;
1142
- return;
1143
- }
1144
- }
1145
- }
1146
- // Read the right-hand operand of =~ in [[ ]]. Bash ends the operand at
1147
- // depth-zero whitespace, `)`, `;`, `&`, `<`, or `>` (but `<(`/`>(` open a
1148
- // process substitution and `|` never delimits). An unquoted `(` opens a
1149
- // group that consumes everything — `]]`, newlines, and metacharacters
1150
- // included — until its matching `)`; inside a group only quotes stay opaque
1151
- // and expansion parens count naively, matching bash. Quotes and expansions
1152
- // at depth zero skip via the same readers normal words use, so their errors
1153
- // and spans stay identical. The token is the raw source span; value and
1154
- // parts resolve lazily like every other word.
1155
- readTestRegexWord() {
1156
- this.hasPeek = false;
1157
- this.skipSpacesAndTabs();
1158
- const src = this.src;
1159
- const len = this.srcEnd;
1160
- const start = this.pos;
1161
- let depth = 0;
1162
- while (this.pos < len) {
1163
- const ch = src.charCodeAt(this.pos);
1164
- if (ch === CH_LPAREN) {
1165
- depth++;
1166
- this.pos++;
1167
- continue;
1168
- }
1169
- if (ch === CH_BACKSLASH) {
1170
- this.pos += this.pos + 1 < len ? 2 : 1;
1171
- continue;
1172
- }
1173
- if (ch === CH_SQUOTE) {
1174
- const quotePos = this.pos++;
1175
- const ansiC = quotePos > start && src.charCodeAt(quotePos - 1) === CH_DOLLAR;
1176
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_SQUOTE) {
1177
- if (ansiC && src.charCodeAt(this.pos) === CH_BACKSLASH && this.pos + 1 < len)
1178
- this.pos++;
1179
- this.pos++;
1180
- }
1181
- if (this.pos < len)
1182
- this.pos++;
1183
- else
1184
- this.errors.push({
1185
- message: ansiC ? "unterminated ANSI-C quote" : "unterminated single quote",
1186
- pos: quotePos,
1187
- });
1188
- continue;
1189
- }
1190
- if (ch === CH_DQUOTE) {
1191
- this.pos++;
1192
- this.readDoubleQuoted();
1193
- continue;
1194
- }
1195
- if (ch === CH_BACKTICK) {
1196
- this.readBacktickExpansion();
1197
- continue;
1198
- }
1199
- if (depth > 0) {
1200
- if (ch === CH_RPAREN)
1201
- depth--;
1202
- this.pos++;
1203
- continue;
1204
- }
1205
- if (ch === CH_DOLLAR) {
1206
- this.readDollar();
1207
- continue;
1208
- }
1209
- if ((ch === CH_LT || ch === CH_GT) && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
1210
- const subPos = this.pos;
1211
- this.pos += 2;
1212
- this.extractBalanced();
1213
- if (this._unbalanced)
1214
- this.errors.push({ message: "unterminated process substitution", pos: subPos });
1215
- continue;
1216
- }
1217
- if (ch < 128 && charType[ch] & 1 && ch !== CH_PIPE)
1218
- break;
1219
- this.pos++;
1220
- }
1221
- setToken(this.current, Token.Word, src.slice(start, this.pos), start, this.pos);
1222
- return this.current;
1223
- }
1224
- // Read C-style for expressions: called after first '(' consumed by parser.
1225
- // Expects pos at second '('. Returns [init, test, update] raw text.
1226
- readCStyleForExprs() {
1227
- this.hasPeek = false; // discard any peeked token
1228
- const src = this.src;
1229
- const len = this.srcEnd;
1230
- // Skip spaces to second '('
1231
- while (this.pos < len && (src.charCodeAt(this.pos) === CH_SPACE || src.charCodeAt(this.pos) === CH_TAB))
1232
- this.pos++;
1233
- const openPos = this.pos;
1234
- if (this.pos < len && src.charCodeAt(this.pos) === CH_LPAREN)
1235
- this.pos++;
1236
- const starts = [this.pos, 0, 0];
1237
- const parts = ["", "", "", 0, 0, 0];
1238
- let partIdx = 0;
1239
- let depth = 1;
1240
- let partStart = this.pos;
1241
- let extra = false;
1242
- const setPart = (end) => {
1243
- const raw = src.slice(partStart, end);
1244
- parts[partIdx] = raw.trim();
1245
- parts[3 + partIdx] = starts[partIdx] + raw.length - raw.trimStart().length;
1246
- };
1247
- while (this.pos < len && depth > 0) {
1248
- const c = src.charCodeAt(this.pos);
1249
- if (c === CH_LPAREN) {
1250
- depth++;
1251
- this.pos++;
1252
- }
1253
- else if (c === CH_RPAREN) {
1254
- depth--;
1255
- if (depth === 0) {
1256
- if (!extra)
1257
- setPart(this.pos);
1258
- if (partIdx < 2)
1259
- this.errors.push({ message: "expected three arithmetic expressions in for header", pos: this.pos });
1260
- this.pos++; // skip closing )
1261
- // Skip the outer ) as well
1262
- while (this.pos < len && (src.charCodeAt(this.pos) === CH_SPACE || src.charCodeAt(this.pos) === CH_TAB))
1263
- this.pos++;
1264
- if (this.pos < len && src.charCodeAt(this.pos) === CH_RPAREN)
1265
- this.pos++;
1266
- break;
1267
- }
1268
- this.pos++;
1269
- }
1270
- else if (c === CH_SEMI && depth === 1) {
1271
- // Bash requires exactly three expressions; keep the first three and report the rest.
1272
- if (partIdx === 2) {
1273
- if (!extra) {
1274
- setPart(this.pos);
1275
- this.errors.push({ message: "expected three arithmetic expressions in for header", pos: this.pos });
1276
- }
1277
- extra = true;
1278
- this.pos++;
1279
- continue;
1280
- }
1281
- setPart(this.pos);
1282
- partIdx++;
1283
- this.pos++;
1284
- partStart = this.pos;
1285
- starts[partIdx] = partStart;
1286
- }
1287
- else if (c === CH_SQUOTE) {
1288
- this.pos++;
1289
- this.skipSQ();
1290
- }
1291
- else if (c === CH_DQUOTE) {
1292
- this.pos++;
1293
- this.skipDQ();
1294
- }
1295
- else {
1296
- this.pos++;
1297
- }
1298
- }
1299
- if (depth > 0) {
1300
- if (!extra)
1301
- setPart(this.pos);
1302
- this.errors.push({ message: "unterminated arithmetic for header", pos: openPos });
1303
- }
1304
- return parts;
1305
- }
1306
- peek(ctx = LexContext.Normal) {
1307
- if (!this.hasPeek) {
1308
- this.readNext(this.nextState, ctx);
1309
- this.hasPeek = true;
1310
- }
1311
- return this.nextState;
1312
- }
1313
- // Peek where the context depends on the token just consumed. peek() ignores its ctx once a
1314
- // token is cached, so the caller's context must only be derived when a read actually happens.
1315
- peekFollow(closers) {
1316
- if (!this.hasPeek) {
1317
- const ctx = closers[this.current.token] ? LexContext.CommandStart : LexContext.Normal;
1318
- this.readNext(this.nextState, ctx);
1319
- this.hasPeek = true;
1320
- }
1321
- return this.nextState;
1322
- }
1323
- next(ctx = LexContext.Normal) {
1324
- if (this.hasPeek) {
1325
- this.hasPeek = false;
1326
- const temp = this.current;
1327
- this.current = this.nextState;
1328
- this.nextState = temp;
1329
- return this.current;
1330
- }
1331
- this.readNext(this.current, ctx);
1332
- return this.current;
1333
- }
1334
- unshift(tok) {
1335
- this.nextState.copyFrom(tok);
1336
- this.hasPeek = true;
1337
- }
1338
- readNext(out, ctx) {
1339
- const src = this.src;
1340
- const len = this.srcEnd;
1341
- // Skip spaces and tabs (inlined for hot path)
1342
- let pos = this.pos;
1343
- while (pos < len) {
1344
- const ch = src.charCodeAt(pos);
1345
- if (ch === CH_SPACE || ch === CH_TAB) {
1346
- pos++;
1347
- continue;
1348
- }
1349
- if (ch === CH_BACKSLASH && pos + 1 < len && src.charCodeAt(pos + 1) === CH_NL) {
1350
- pos += 2;
1351
- continue;
1352
- }
1353
- // Inside [[ ]], newlines are whitespace
1354
- if (ch === CH_NL && ctx === LexContext.TestMode) {
1355
- pos++;
1356
- continue;
1357
- }
1358
- break;
1359
- }
1360
- this.pos = pos;
1361
- if (pos >= len) {
1362
- this.consumePendingHereDocs();
1363
- setToken(out, Token.EOF, "", pos, pos);
1364
- return;
1365
- }
1366
- const tokenStart = pos;
1367
- const ch = src.charCodeAt(pos);
1368
- if (ch === CH_HASH) {
1369
- // Skip comment
1370
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_NL)
1371
- this.pos++;
1372
- this.readNext(out, ctx);
1373
- return;
1374
- }
1375
- if (ch === CH_NL) {
1376
- this.pos++;
1377
- this.consumePendingHereDocs();
1378
- setToken(out, Token.Newline, "\n", tokenStart, this.pos);
1379
- return;
1380
- }
1381
- // In test mode (inside [[ ]]), < and > are string comparison operators, not redirects —
1382
- // except for an adjacent '(', which still opens a process substitution
1383
- if (ctx === LexContext.TestMode &&
1384
- (ch === CH_LT || ch === CH_GT) &&
1385
- !(this.pos + 1 < this.srcEnd && src.charCodeAt(this.pos + 1) === CH_LPAREN)) {
1386
- this.pos++;
1387
- setToken(out, Token.Word, ch === CH_LT ? "<" : ">", tokenStart, this.pos);
1388
- out.keywordEligible = true; // written unquoted, so it is the comparison operator
1389
- return;
1390
- }
1391
- // Operators all start with a metachar; anything else is a word
1392
- if (ch < 128 && charType[ch] & 1 && this.tryReadOperator(out, ch, ctx, tokenStart))
1393
- return;
1394
- if (ch === CH_LBRACKET && ctx === LexContext.ArrayElement && this.readArrayElement(out, tokenStart))
1395
- return;
1396
- this.readWord(out, ctx, tokenStart);
1397
- }
1398
- tryReadOperator(out, ch, ctx, tokenStart) {
1399
- const src = this.src;
1400
- const pos = this.pos;
1401
- const next = pos + 1 < this.srcEnd ? src.charCodeAt(pos + 1) : 0;
1402
- switch (ch) {
1403
- case CH_SEMI:
1404
- if (next === CH_SEMI) {
1405
- if (pos + 2 < this.srcEnd && src.charCodeAt(pos + 2) === CH_AMP) {
1406
- this.pos += 3;
1407
- setToken(out, Token.DoubleSemiAmp, ";;&", tokenStart, this.pos);
1408
- return true;
1409
- }
1410
- this.pos += 2;
1411
- setToken(out, Token.DoubleSemi, ";;", tokenStart, this.pos);
1412
- return true;
1413
- }
1414
- if (next === CH_AMP) {
1415
- this.pos += 2;
1416
- setToken(out, Token.SemiAmp, ";&", tokenStart, this.pos);
1417
- return true;
1418
- }
1419
- this.pos++;
1420
- setToken(out, Token.Semi, ";", tokenStart, this.pos);
1421
- return true;
1422
- case CH_PIPE:
1423
- if (next === CH_PIPE) {
1424
- this.pos += 2;
1425
- setToken(out, Token.Or, "||", tokenStart, this.pos);
1426
- return true;
1427
- }
1428
- if (next === CH_AMP) {
1429
- this.pos += 2;
1430
- setToken(out, Token.Pipe, "|&", tokenStart, this.pos);
1431
- return true;
1432
- } // |& → pipe (stderr merge)
1433
- this.pos++;
1434
- setToken(out, Token.Pipe, "|", tokenStart, this.pos);
1435
- return true;
1436
- case CH_AMP:
1437
- if (next === CH_AMP) {
1438
- this.pos += 2;
1439
- setToken(out, Token.And, "&&", tokenStart, this.pos);
1440
- return true;
1441
- }
1442
- if (next === CH_GT) {
1443
- // &> or &>> — redirect, not background
1444
- this.pos += 2;
1445
- const append = this.pos < this.srcEnd && src.charCodeAt(this.pos) === CH_GT;
1446
- if (append)
1447
- this.pos++;
1448
- this.skipSpacesAndTabs();
1449
- const targetPos = this.pos;
1450
- if (this.pos < this.srcEnd && src.charCodeAt(this.pos) !== CH_NL && src.charCodeAt(this.pos) !== CH_HASH) {
1451
- this.readRedirectTargetText();
1452
- }
1453
- this.redirectToken(out, append ? "&>>" : "&>", tokenStart, targetPos);
1454
- return true;
1455
- }
1456
- this.pos++;
1457
- setToken(out, Token.Amp, "&", tokenStart, this.pos);
1458
- return true;
1459
- case CH_LPAREN:
1460
- if (ctx === LexContext.CommandStart && next === CH_LPAREN) {
1461
- const savedErrors = this.errors.length;
1462
- this.readArithmeticCommand(out, tokenStart);
1463
- if (!this._notArithmetic)
1464
- return true;
1465
- this.errors.length = savedErrors;
1466
- this.pos = tokenStart;
1467
- }
1468
- this.pos++;
1469
- setToken(out, Token.LParen, "(", tokenStart, this.pos);
1470
- return true;
1471
- case CH_RPAREN:
1472
- this.pos++;
1473
- setToken(out, Token.RParen, ")", tokenStart, this.pos);
1474
- return true;
1475
- case CH_LT:
1476
- case CH_GT:
1477
- return this.readRedirection(out, tokenStart);
1478
- default:
1479
- return false;
1480
- }
1481
- }
1482
- readRedirection(out, tokenStart) {
1483
- const src = this.src;
1484
- const ch = src.charCodeAt(this.pos);
1485
- let op = "";
1486
- if (ch === CH_LT) {
1487
- this.pos++;
1488
- const next = this.pos < this.srcEnd ? src.charCodeAt(this.pos) : 0;
1489
- if (next === CH_LT) {
1490
- this.pos++;
1491
- const third = this.pos < this.srcEnd ? src.charCodeAt(this.pos) : 0;
1492
- if (third === CH_LT) {
1493
- // <<< herestring
1494
- this.pos++;
1495
- this.skipSpacesAndTabs();
1496
- const targetPos = this.pos;
1497
- if (this.pos < this.srcEnd && src.charCodeAt(this.pos) !== CH_NL && src.charCodeAt(this.pos) !== CH_HASH) {
1498
- this.readRedirectTargetText();
1499
- }
1500
- this.redirectToken(out, "<<<", tokenStart, targetPos);
1501
- return true;
1502
- }
1503
- const dash = third === CH_DASH;
1504
- if (dash)
1505
- this.pos++;
1506
- this.skipSpacesAndTabs();
1507
- const targetPos = this.pos;
1508
- if (this.pos >= this.srcEnd || src.charCodeAt(this.pos) !== CH_HASH)
1509
- this.readHereDocDelimiter();
1510
- const hasTarget = this.pos > targetPos;
1511
- if (hasTarget) {
1512
- (this.pendingHereDocs ?? (this.pendingHereDocs = [])).push({
1513
- delimiter: this._hereDelim,
1514
- strip: dash,
1515
- quoted: this._hereQuoted,
1516
- });
1517
- }
1518
- setToken(out, Token.Redirect, dash ? "<<-" : "<<", tokenStart, this.pos);
1519
- out.content = hasTarget ? this._hereDelim : undefined;
1520
- out.delimiterQuoted = hasTarget && this._hereQuoted;
1521
- out.targetPos = targetPos;
1522
- out.targetEnd = hasTarget ? this.pos : targetPos;
1523
- return true;
1524
- }
1525
- if (next === CH_LPAREN) {
1526
- this.readProcessSubstitution(out, "<", tokenStart);
1527
- return true;
1528
- }
1529
- if (next === CH_GT) {
1530
- op = "<>";
1531
- this.pos++;
1532
- }
1533
- else if (next === CH_AMP) {
1534
- op = "<&";
1535
- this.pos++;
1536
- }
1537
- else {
1538
- op = "<";
1539
- }
1540
- }
1541
- else if (ch === CH_GT) {
1542
- this.pos++;
1543
- const next = this.pos < this.srcEnd ? src.charCodeAt(this.pos) : 0;
1544
- if (next === CH_LPAREN) {
1545
- this.readProcessSubstitution(out, ">", tokenStart);
1546
- return true;
1547
- }
1548
- if (next === CH_GT) {
1549
- op = ">>";
1550
- this.pos++;
1551
- }
1552
- else if (next === CH_AMP) {
1553
- op = ">&";
1554
- this.pos++;
1555
- }
1556
- else if (next === CH_PIPE) {
1557
- op = ">|";
1558
- this.pos++;
1559
- }
1560
- else {
1561
- op = ">";
1562
- }
1563
- }
1564
- this.skipSpacesAndTabs();
1565
- if (this.pos < this.srcEnd) {
1566
- const nc = src.charCodeAt(this.pos);
1567
- if ((nc === CH_LT || nc === CH_GT) && this.pos + 1 < this.srcEnd && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
1568
- const psStart = this.pos;
1569
- this.pos += 2;
1570
- this.extractBalanced();
1571
- if (this._unbalanced)
1572
- this.errors.push({ message: "unterminated process substitution", pos: psStart });
1573
- const psText = src.slice(psStart, this.pos);
1574
- setToken(out, Token.Redirect, op, tokenStart, this.pos);
1575
- out.content = psText;
1576
- out.targetPos = psStart;
1577
- out.targetEnd = this.pos;
1578
- return true;
1579
- }
1580
- const targetPos = this.pos;
1581
- if (nc !== CH_NL && nc !== CH_HASH)
1582
- this.readRedirectTargetText();
1583
- this.redirectToken(out, op, tokenStart, targetPos);
1584
- return true;
1585
- }
1586
- this.redirectToken(out, op, tokenStart, this.pos);
1587
- return true;
1588
- }
1589
- // Redirect targets keep their processed text eagerly (it becomes the target
1590
- // word's content), so scan them in value mode.
1591
- readRedirectTargetText() {
1592
- const savedBuildValue = this._buildValue;
1593
- this._buildValue = true;
1594
- this.readWordText();
1595
- this._buildValue = savedBuildValue;
1596
- }
1597
- redirectToken(out, operator, tokenStart, targetPos) {
1598
- const hasTarget = this.pos > targetPos && (this._wordText.length > 0 || this._wordQuoted);
1599
- setToken(out, Token.Redirect, operator, tokenStart, this.pos);
1600
- out.content = hasTarget ? this._wordText : undefined;
1601
- out.targetPos = targetPos;
1602
- out.targetEnd = hasTarget ? this.pos : targetPos;
1603
- }
1604
- readProcessSubstitution(out, operator, tokenStart) {
1605
- this.pos++; // skip (
1606
- this.extractBalanced();
1607
- if (this._unbalanced)
1608
- this.errors.push({ message: "unterminated process substitution", pos: tokenStart });
1609
- const text = this.src.slice(tokenStart, this.pos);
1610
- setToken(out, Token.Word, text, tokenStart, this.pos);
1611
- }
1612
- // The delimiter is the word after quote removal: quote and escape segments may
1613
- // appear anywhere in the word, any of them makes the heredoc quoted, and inside
1614
- // double quotes a backslash is removed only before $ ` " \.
1615
- readHereDocDelimiter() {
1616
- const src = this.src;
1617
- const len = this.srcEnd;
1618
- const savedBuildValue = this._buildValue;
1619
- this._buildValue = true; // the delimiter is assembled from processed segments
1620
- let delimiter = "";
1621
- let quoted = false;
1622
- while (this.pos < len) {
1623
- const c = src.charCodeAt(this.pos);
1624
- if (c === CH_SQUOTE) {
1625
- quoted = true;
1626
- this.pos++;
1627
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_SQUOTE) {
1628
- delimiter += src[this.pos];
1629
- this.pos++;
1630
- }
1631
- if (this.pos < len)
1632
- this.pos++;
1633
- }
1634
- else if (c === CH_DQUOTE) {
1635
- quoted = true;
1636
- this.pos++;
1637
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_DQUOTE) {
1638
- if (src.charCodeAt(this.pos) === CH_BACKSLASH && this.pos + 1 < len) {
1639
- const next = src.charCodeAt(this.pos + 1);
1640
- if (next === CH_NL) {
1641
- this.pos += 2;
1642
- continue;
1643
- }
1644
- if (next === CH_DOLLAR || next === CH_BACKTICK || next === CH_DQUOTE || next === CH_BACKSLASH)
1645
- this.pos++;
1646
- }
1647
- delimiter += src[this.pos];
1648
- this.pos++;
1649
- }
1650
- if (this.pos < len)
1651
- this.pos++;
1652
- }
1653
- else if (c === CH_BACKSLASH) {
1654
- if (this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_NL) {
1655
- this.pos += 2;
1656
- continue;
1657
- }
1658
- quoted = true;
1659
- this.pos++;
1660
- if (this.pos < len) {
1661
- delimiter += src[this.pos];
1662
- this.pos++;
1663
- }
1664
- else {
1665
- delimiter += "\\"; // trailing backslash escapes nothing and stays as itself
1666
- }
1667
- }
1668
- else if (c === CH_BACKTICK) {
1669
- const btStart = this.pos;
1670
- this.pos++;
1671
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
1672
- if (src.charCodeAt(this.pos) === CH_BACKSLASH)
1673
- this.pos++;
1674
- this.pos++;
1675
- }
1676
- if (this.pos < len)
1677
- this.pos++;
1678
- delimiter += src.slice(btStart, this.pos);
1679
- }
1680
- else if (c === CH_DOLLAR) {
1681
- const next = this.pos + 1 < len ? src.charCodeAt(this.pos + 1) : 0;
1682
- if (next === CH_SQUOTE || next === CH_DQUOTE)
1683
- quoted = true;
1684
- this.readDollar();
1685
- delimiter += this._resultText;
1686
- }
1687
- else if (c < 128 && charType[c] & 1) {
1688
- break;
1689
- }
1690
- else {
1691
- delimiter += src[this.pos];
1692
- this.pos++;
1693
- }
1694
- }
1695
- this._buildValue = savedBuildValue;
1696
- this._hereDelim = delimiter;
1697
- this._hereQuoted = quoted;
1698
- }
1699
- consumePendingHereDocs() {
1700
- const pending = this.pendingHereDocs;
1701
- if (pending === null || pending.length === 0)
1702
- return;
1703
- for (const hd of pending) {
1704
- const bodyPos = this.pos;
1705
- const bodyEnd = this.skipHereDocBody(hd.delimiter, hd.strip, this.parenBoundary, hd.quoted);
1706
- if (hd.target) {
1707
- hd.target.body.pos = bodyPos;
1708
- hd.target.body.end = bodyEnd;
1709
- hd.target.body.text = this.src.slice(bodyPos, bodyEnd);
1710
- if (this.hereDocClosingPos !== -1)
1711
- hd.target.closing = { pos: this.hereDocClosingPos, end: this.hereDocClosingEnd };
1712
- }
1713
- }
1714
- pending.length = 0;
1715
- }
1716
- hereDocClosingPos = -1;
1717
- hereDocClosingEnd = -1;
1718
- // Advance past the heredoc body and its delimiter line; return the body end
1719
- // (start of the delimiter line, or srcEnd when delimited by end-of-input).
1720
- // With parenEnds (inside $(...)), a line starting with the delimiter directly
1721
- // followed by ")" also terminates the body, resuming at the ")" — bash treats
1722
- // the substitution's closing paren as end-of-file for its heredocs.
1723
- // `join` crosses `\`+newline pairs, which an unquoted delimiter may straddle.
1724
- matchHereDocDelimiter(delimiter, lineStart, end, join) {
1725
- const src = this.src;
1726
- let pos = lineStart;
1727
- for (let i = 0; i < delimiter.length;) {
1728
- if (join && src.charCodeAt(pos) === CH_BACKSLASH && pos + 1 < end && src.charCodeAt(pos + 1) === CH_NL) {
1729
- pos += 2;
1730
- continue;
1731
- }
1732
- if (pos >= end || src.charCodeAt(pos) !== delimiter.charCodeAt(i))
1733
- return -1;
1734
- pos++;
1735
- i++;
1736
- }
1737
- return pos;
1738
- }
1739
- // A `\` consumes the next character, so `\`+newline continues the line and `\\` does not.
1740
- logicalLineEnd(from, end, join) {
1741
- const src = this.src;
1742
- let lineEnd = src.indexOf("\n", from);
1743
- while (lineEnd !== -1 && lineEnd < end) {
1744
- if (!join)
1745
- return lineEnd;
1746
- let backslashes = lineEnd;
1747
- while (backslashes > from && src.charCodeAt(backslashes - 1) === CH_BACKSLASH)
1748
- backslashes--;
1749
- if ((lineEnd - backslashes) % 2 === 0)
1750
- return lineEnd;
1751
- from = lineEnd + 1;
1752
- lineEnd = src.indexOf("\n", from);
1753
- }
1754
- return end;
1755
- }
1756
- skipHereDocBody(delimiter, strip, parenEnds = false, quoted = false) {
1757
- this.hereDocClosingPos = -1;
1758
- this.hereDocClosingEnd = -1;
1759
- const src = this.src;
1760
- const len = this.srcEnd;
1761
- while (this.pos < len) {
1762
- let lineStart = this.pos;
1763
- const lineEnd = this.logicalLineEnd(lineStart, len, !quoted);
1764
- for (;;) {
1765
- const before = lineStart;
1766
- if (strip)
1767
- while (lineStart < lineEnd && src.charCodeAt(lineStart) === CH_TAB)
1768
- lineStart++;
1769
- if (!quoted)
1770
- lineStart = skipLineContinuations(src, lineStart, lineEnd);
1771
- if (lineStart === before)
1772
- break;
1773
- }
1774
- let afterDelim = this.matchHereDocDelimiter(delimiter, lineStart, lineEnd, !quoted);
1775
- if (afterDelim !== -1 && !quoted)
1776
- afterDelim = skipLineContinuations(src, afterDelim, lineEnd);
1777
- if (afterDelim === lineEnd) {
1778
- const bodyEnd = this.pos;
1779
- if (!parenEnds || !this.parenBoundary || lineEnd !== len) {
1780
- this.hereDocClosingPos = lineStart;
1781
- this.hereDocClosingEnd = lineEnd;
1782
- }
1783
- this.pos = lineEnd < len ? lineEnd + 1 : lineEnd;
1784
- return bodyEnd;
1785
- }
1786
- // A line starting with the delimiter also ends the body when a `)` follows on the same
1787
- // logical line; the scan then resumes mid-line, right after the delimiter.
1788
- if (parenEnds && afterDelim !== -1) {
1789
- let paren = afterDelim;
1790
- while (paren < lineEnd && src.charCodeAt(paren) !== CH_RPAREN)
1791
- paren++;
1792
- if (paren < lineEnd || (this.parenBoundary && lineEnd === len)) {
1793
- const bodyEnd = this.pos;
1794
- this.pos = afterDelim;
1795
- return bodyEnd;
1796
- }
1797
- }
1798
- this.pos = lineEnd < len ? lineEnd + 1 : lineEnd;
1799
- }
1800
- return this.pos;
1801
- }
1802
- _wordText = "";
1803
- _wordRaw = false;
1804
- _wordQuoted = false;
1805
- _wordHasExpansions = false;
1806
- _wordKeywordEligible = false;
1807
- _wordIsAssignment;
1808
- _wordAssignmentOperatorPos;
1809
- _wordParts = null;
1810
- _resultText = "";
1811
- // True when the last $-construct's value is exactly its raw source span.
1812
- _resultIsRaw = true;
1813
- _resultHasExpansion = false;
1814
- _resultPart;
1815
- // Set by extractBalanced when the input ended before the closing paren, so
1816
- // callers can report the construct they were scanning.
1817
- _unbalanced = false;
1818
- // Set by scanArithmeticBody when the construct turns out not to be arithmetic, so the
1819
- // caller can re-read it as a subshell or command substitution instead.
1820
- _notArithmetic = false;
1821
- _arithUnterminated = false;
1822
- _dqText = "";
1823
- _dqHasExpansions = false;
1824
- _dqParts = null;
1825
- // Content end (before the closing quote, or end of input when unterminated).
1826
- _dqEnd = 0;
1827
- _hereDelim = "";
1828
- _hereQuoted = false;
1829
- readWord(out, ctx, tokenStart = 0) {
1830
- this.readWordText();
1831
- if (ctx === LexContext.Normal) {
1832
- const next = this.pos < this.srcEnd ? this.src.charCodeAt(this.pos) : 0;
1833
- if (!this._wordRaw || (next !== CH_LT && next !== CH_GT)) {
1834
- setSpanToken(out, Token.Word, tokenStart, this.pos, this._wordRaw);
1835
- out.keywordEligible = this._wordKeywordEligible;
1836
- return;
1837
- }
1838
- }
1839
- this.classifyWord(out, ctx, tokenStart);
1840
- }
1841
- isRedirectVariable(start, end) {
1842
- const src = this.src;
1843
- for (let i = start; i < end; i++) {
1844
- const c = src.charCodeAt(i);
1845
- if (c === CH_LBRACKET && i > start) {
1846
- return (i + 2 < end && src.charCodeAt(end - 1) === CH_RBRACKET && this.findClosingBracket(i + 1, end) === end - 1);
1847
- }
1848
- if (c >= 128 || !(isIdChar[c] & (i === start ? 1 : 2)))
1849
- return false;
1850
- }
1851
- return end > start;
1852
- }
1853
- readArrayElement(out, tokenStart) {
1854
- const close = this.findClosingBracket(tokenStart + 1);
1855
- if (close === -1)
1856
- return false;
1857
- this.pos = close + 1;
1858
- this.readWordText();
1859
- setSpanToken(out, Token.Word, tokenStart, this.pos, true);
1860
- return true;
1861
- }
1862
- classifyWord(out, ctx, tokenStart) {
1863
- const src = this.src;
1864
- const raw = this._wordRaw;
1865
- const hasExpansions = this._wordHasExpansions;
1866
- const quoted = this._wordQuoted;
1867
- const keywordEligible = this._wordKeywordEligible;
1868
- const isAssignment = this._wordIsAssignment;
1869
- let assignmentOpPos = this._wordAssignmentOperatorPos;
1870
- const wordEnd = this.pos;
1871
- const wordLen = wordEnd - tokenStart;
1872
- // Only keyword classification needs a non-raw word's processed value.
1873
- let value = null;
1874
- if (!raw && !hasExpansions && keywordEligible && (ctx === LexContext.CommandStart || ctx === LexContext.TestMode)) {
1875
- const nextCh = wordEnd < this.srcEnd ? src.charCodeAt(wordEnd) : 0;
1876
- if ((!quoted && wordLen <= 16) || nextCh === CH_LT || nextCh === CH_GT) {
1877
- value = this.wordValueOf(tokenStart, wordEnd);
1878
- }
1879
- }
1880
- if (ctx === LexContext.CommandStart && keywordEligible) {
1881
- if (raw) {
1882
- if (wordLen <= 8) {
1883
- const reserved = matchReservedWord(src, tokenStart, wordLen);
1884
- if (reserved !== undefined) {
1885
- setSpanToken(out, reserved, tokenStart, wordEnd, true);
1886
- return;
1887
- }
1888
- }
1889
- if (wordLen === 2 &&
1890
- src.charCodeAt(tokenStart) === CH_LBRACKET &&
1891
- src.charCodeAt(tokenStart + 1) === CH_LBRACKET) {
1892
- setSpanToken(out, Token.DblLBracket, tokenStart, wordEnd, true);
1893
- return;
1894
- }
1895
- }
1896
- else if (value !== null && value.length > 0) {
1897
- const fc = value.charCodeAt(0);
1898
- if ((fc >= CH_a && fc <= CH_z && value.length <= 8) || fc === CH_BANG || fc === CH_LBRACE || fc === CH_RBRACE) {
1899
- const reserved = RESERVED_WORDS.get(value);
1900
- if (reserved !== undefined) {
1901
- setToken(out, reserved, value, tokenStart, wordEnd);
1902
- return;
1903
- }
1904
- }
1905
- if (fc === CH_LBRACKET && value === "[[") {
1906
- setToken(out, Token.DblLBracket, value, tokenStart, wordEnd);
1907
- return;
1908
- }
1909
- }
1910
- }
1911
- if (ctx === LexContext.CommandStart || ctx === LexContext.CommandPrefix || ctx === LexContext.Declaration) {
1912
- if (isAssignment === undefined) {
1913
- // Fast-path word (value === raw span): detect assignment positionally.
1914
- let eq = -1;
1915
- let bracket = false;
1916
- for (let i = tokenStart + 1; i < wordEnd; i++) {
1917
- const c = src.charCodeAt(i);
1918
- if (c === CH_EQ) {
1919
- eq = i;
1920
- break;
1921
- }
1922
- if (c === CH_LBRACKET)
1923
- bracket = true;
1924
- }
1925
- if (eq !== -1) {
1926
- const state = scanAssignmentPrefix(src, tokenStart, wordEnd, ASSIGNMENT_NAME_START);
1927
- if (isMatchedAssignment(state))
1928
- assignmentOpPos = assignmentOperatorPos(state);
1929
- }
1930
- else if (ctx !== LexContext.Declaration &&
1931
- bracket &&
1932
- wordEnd < this.srcEnd &&
1933
- scanAssignmentPrefix(src, tokenStart, wordEnd, ASSIGNMENT_NAME_START) >= ASSIGNMENT_INDEX_BASE) {
1934
- // The second pass leaves the fast path, setting `_wordIsAssignment`, so this
1935
- // cannot recur.
1936
- this.pos = tokenStart;
1937
- this.readWordText(true);
1938
- this.classifyWord(out, ctx, tokenStart);
1939
- return;
1940
- }
1941
- }
1942
- if (assignmentOpPos !== undefined) {
1943
- setSpanToken(out, Token.Assignment, tokenStart, wordEnd, raw);
1944
- if (value !== null)
1945
- out._value = value;
1946
- out.assignmentOperatorPos = assignmentOpPos;
1947
- return;
1948
- }
1949
- }
1950
- // `]]` is reserved only where it can close a `[[`; operands and wordlist entries, which
1951
- // read Normal, are ordinary words, as is a `]]` demoted by a command prefix.
1952
- if ((ctx === LexContext.CommandStart || ctx === LexContext.TestMode) && keywordEligible) {
1953
- if (raw) {
1954
- if (wordLen === 2 &&
1955
- src.charCodeAt(tokenStart) === CH_RBRACKET &&
1956
- src.charCodeAt(tokenStart + 1) === CH_RBRACKET) {
1957
- setSpanToken(out, Token.DblRBracket, tokenStart, wordEnd, true);
1958
- return;
1959
- }
1960
- }
1961
- else if (value === "]]") {
1962
- setToken(out, Token.DblRBracket, value, tokenStart, wordEnd);
1963
- return;
1964
- }
1965
- }
1966
- // FD number prefix: all-digit word followed by < or > → redirect with fd
1967
- if (!hasExpansions && this.pos < this.srcEnd) {
1968
- const nc = src.charCodeAt(this.pos);
1969
- if (nc === CH_LT || nc === CH_GT) {
1970
- if (raw) {
1971
- const fc = src.charCodeAt(tokenStart);
1972
- if (fc >= CH_0 && fc <= CH_9 && isAllDigitsRange(src, tokenStart, wordEnd)) {
1973
- const fd = Number.parseInt(src.slice(tokenStart, wordEnd), 10);
1974
- if (this.readRedirection(out, tokenStart)) {
1975
- out.fileDescriptor = fd;
1976
- out.descriptorEnd = wordEnd;
1977
- return;
1978
- }
1979
- }
1980
- if (fc === CH_LBRACE &&
1981
- src.charCodeAt(wordEnd - 1) === CH_RBRACE &&
1982
- this.isRedirectVariable(tokenStart + 1, wordEnd - 1)) {
1983
- const varname = src.slice(tokenStart + 1, wordEnd - 1);
1984
- if (this.readRedirection(out, tokenStart)) {
1985
- out.variableName = varname;
1986
- out.descriptorEnd = wordEnd;
1987
- return;
1988
- }
1989
- }
1990
- }
1991
- }
1992
- }
1993
- setSpanToken(out, Token.Word, tokenStart, wordEnd, raw);
1994
- if (value !== null)
1995
- out._value = value;
1996
- out.keywordEligible = keywordEligible;
1997
- }
1998
- // `subscripts` re-reads a word known to stop inside an array subscript, where
1999
- // metacharacters are ordinary text.
2000
- readWordText(subscripts = false) {
2001
- const src = this.src;
2002
- const len = this.srcEnd;
2003
- let pos = this.pos;
2004
- // Fast path: scan a single run of plain chars (covers most words)
2005
- const fastStart = pos;
2006
- let exitCh = 0;
2007
- while (pos < len) {
2008
- const c = src.charCodeAt(pos);
2009
- if (c < 128 && charType[c]) {
2010
- exitCh = c;
2011
- break;
2012
- }
2013
- pos++;
2014
- }
2015
- if (pos >= len ||
2016
- (charType[exitCh] & 1 &&
2017
- !(exitCh === CH_LPAREN && pos > fastStart && extglobPrefix[src.charCodeAt(pos - 1)]) &&
2018
- !subscripts)) {
2019
- this.pos = pos;
2020
- this._wordText = (this._buildParts || this._buildValue) && pos > fastStart ? src.slice(fastStart, pos) : "";
2021
- this._wordRaw = true;
2022
- this._wordQuoted = false;
2023
- this._wordHasExpansions = false;
2024
- this._wordKeywordEligible = true;
2025
- this._wordIsAssignment = undefined;
2026
- this._wordAssignmentOperatorPos = undefined;
2027
- if (this._buildParts)
2028
- this._wordParts = null;
2029
- return;
2030
- }
2031
- // Slow path: word contains quotes, expansions, escapes, etc. `text` (the
2032
- // processed value) is only assembled when building; the token path tracks
2033
- // positions and flags plus the last value char (for extglob prefixes) and
2034
- // whether the value still equals the raw span.
2035
- const bp = this._buildParts;
2036
- const bt = bp || this._buildValue;
2037
- let text = bt && pos > fastStart ? src.slice(fastStart, pos) : "";
2038
- let quoted = false;
2039
- let hasExpansions = false;
2040
- let keywordEligible = true;
2041
- let valueIsRaw = true;
2042
- let lastValueChar = pos > fastStart ? src.charCodeAt(pos - 1) : 0;
2043
- let assignmentState = scanAssignmentPrefix(src, fastStart, pos, ASSIGNMENT_NAME_START);
2044
- let parts;
2045
- let litBuf = "";
2046
- let litStart = 0;
2047
- if (bp) {
2048
- parts = [];
2049
- litBuf = text; // fast-path prefix is literal
2050
- litStart = fastStart;
2051
- }
2052
- while (pos < len) {
2053
- const ch = src.charCodeAt(pos);
2054
- if (ch >= 128 || !charType[ch]) {
2055
- const runStart = pos;
2056
- pos++;
2057
- while (pos < len) {
2058
- const c = src.charCodeAt(pos);
2059
- if (c < 128 && charType[c])
2060
- break;
2061
- pos++;
2062
- }
2063
- lastValueChar = src.charCodeAt(pos - 1);
2064
- assignmentState = scanAssignmentPrefix(src, runStart, pos, assignmentState);
2065
- if (bt) {
2066
- const chunk = src.slice(runStart, pos);
2067
- text += chunk;
2068
- if (bp)
2069
- litBuf += chunk;
2070
- }
2071
- continue;
2072
- }
2073
- if (charType[ch] & 1) {
2074
- if (ch === CH_LPAREN && lastValueChar < 128 && extglobPrefix[lastValueChar]) {
2075
- keywordEligible = false;
2076
- const prefixChar = lastValueChar;
2077
- pos++;
2078
- const innerStart = pos;
2079
- const close = this.findClosingShellDelimiter(innerStart, len, CH_RPAREN, prefixChar === CH_EQ);
2080
- const patternEnd = close === -1 ? len : close;
2081
- pos = close === -1 ? len : close + 1;
2082
- if (close === -1)
2083
- this.errors.push({ message: "unterminated extended glob", pos: innerStart - 2 });
2084
- lastValueChar = src.charCodeAt(pos - 1);
2085
- if (bt) {
2086
- const eg = "(" + src.slice(innerStart, pos);
2087
- text += eg;
2088
- // Create ExtendedGlob part for real extglob operators (not = which is array assignment)
2089
- if (bp && prefixChar !== CH_EQ) {
2090
- let prefixPos = innerStart - 2;
2091
- while (src.charCodeAt(prefixPos) === CH_NL && src.charCodeAt(prefixPos - 1) === CH_BACKSLASH) {
2092
- prefixPos -= 2;
2093
- }
2094
- // Remove the prefix char from litBuf (it was appended in the previous iteration)
2095
- if (litBuf.length > 0) {
2096
- const trimmed = litBuf.slice(0, -1);
2097
- if (prefixPos > litStart)
2098
- parts.push({
2099
- type: "Literal",
2100
- pos: litStart,
2101
- end: prefixPos,
2102
- value: trimmed,
2103
- text: src.slice(litStart, prefixPos),
2104
- });
2105
- litBuf = "";
2106
- }
2107
- const op = extglobOp[prefixChar];
2108
- parts.push({
2109
- type: "ExtendedGlob",
2110
- pos: prefixPos,
2111
- end: pos,
2112
- text: src.slice(prefixPos, pos),
2113
- operator: op,
2114
- pattern: src.slice(innerStart, patternEnd),
2115
- parts: hasEmbeddedWordStructure(src, innerStart, patternEnd)
2116
- ? this.parseSubFieldWord(innerStart, patternEnd).parts
2117
- : undefined,
2118
- });
2119
- litStart = pos;
2120
- }
2121
- else if (bp) {
2122
- litBuf += eg;
2123
- }
2124
- }
2125
- continue;
2126
- }
2127
- if (subscripts && assignmentState >= ASSIGNMENT_INDEX_BASE) {
2128
- const close = this.findClosingBracket(pos);
2129
- if (close !== -1) {
2130
- const spanEnd = close + 1;
2131
- assignmentState = scanAssignmentPrefix(src, pos, spanEnd, assignmentState);
2132
- lastValueChar = src.charCodeAt(close);
2133
- if (bt) {
2134
- const chunk = src.slice(pos, spanEnd);
2135
- text += chunk;
2136
- if (bp)
2137
- litBuf += chunk;
2138
- }
2139
- pos = spanEnd;
2140
- continue;
2141
- }
2142
- }
2143
- break;
2144
- }
2145
- if (ch === CH_BACKSLASH) {
2146
- pos++;
2147
- if (pos < len) {
2148
- if (src.charCodeAt(pos) === CH_NL) {
2149
- pos++;
2150
- valueIsRaw = false;
2151
- }
2152
- else {
2153
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2154
- assignmentState = ASSIGNMENT_INVALID;
2155
- quoted = true;
2156
- keywordEligible = false;
2157
- valueIsRaw = false;
2158
- lastValueChar = src.charCodeAt(pos);
2159
- if (bt) {
2160
- text += src[pos];
2161
- if (bp)
2162
- litBuf += src[pos];
2163
- }
2164
- pos++;
2165
- }
2166
- }
2167
- else {
2168
- // A backslash at end of input escapes nothing and stays as itself.
2169
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2170
- assignmentState = ASSIGNMENT_INVALID;
2171
- quoted = true;
2172
- keywordEligible = false;
2173
- lastValueChar = CH_BACKSLASH;
2174
- if (bt) {
2175
- text += "\\";
2176
- if (bp)
2177
- litBuf += "\\";
2178
- }
2179
- }
2180
- continue;
2181
- }
2182
- if (ch === CH_SQUOTE) {
2183
- const sqStart = pos;
2184
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2185
- assignmentState = ASSIGNMENT_INVALID;
2186
- quoted = true;
2187
- keywordEligible = false;
2188
- valueIsRaw = false;
2189
- pos++;
2190
- const start = pos;
2191
- while (pos < len && src.charCodeAt(pos) !== CH_SQUOTE)
2192
- pos++;
2193
- if (pos > start)
2194
- lastValueChar = src.charCodeAt(pos - 1);
2195
- const value = bt ? src.slice(start, pos) : "";
2196
- if (bt)
2197
- text += value;
2198
- if (pos < len)
2199
- pos++;
2200
- else
2201
- this.errors.push({ message: "unterminated single quote", pos: start - 1 });
2202
- if (bp) {
2203
- if (sqStart > litStart) {
2204
- parts.push({
2205
- type: "Literal",
2206
- pos: litStart,
2207
- end: sqStart,
2208
- value: litBuf,
2209
- text: src.slice(litStart, sqStart),
2210
- });
2211
- litBuf = "";
2212
- }
2213
- parts.push({ type: "SingleQuoted", pos: sqStart, end: pos, value, text: src.slice(sqStart, pos) });
2214
- litStart = pos;
2215
- }
2216
- continue;
2217
- }
2218
- if (ch === CH_DQUOTE) {
2219
- const dqStart = pos;
2220
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2221
- assignmentState = ASSIGNMENT_INVALID;
2222
- quoted = true;
2223
- keywordEligible = false;
2224
- valueIsRaw = false;
2225
- pos++;
2226
- this.pos = pos;
2227
- this.readDoubleQuoted();
2228
- pos = this.pos;
2229
- if (this._dqEnd > dqStart + 1)
2230
- lastValueChar = src.charCodeAt(this._dqEnd - 1);
2231
- if (this._dqHasExpansions)
2232
- hasExpansions = true;
2233
- if (bt)
2234
- text += this._dqText;
2235
- if (bp) {
2236
- if (dqStart > litStart) {
2237
- parts.push({
2238
- type: "Literal",
2239
- pos: litStart,
2240
- end: dqStart,
2241
- value: litBuf,
2242
- text: src.slice(litStart, dqStart),
2243
- });
2244
- litBuf = "";
2245
- }
2246
- const dqText = src.slice(dqStart, pos);
2247
- parts.push({
2248
- type: "DoubleQuoted",
2249
- pos: dqStart,
2250
- end: pos,
2251
- text: dqText,
2252
- parts: this._dqParts ?? [
2253
- {
2254
- type: "Literal",
2255
- pos: dqStart + 1,
2256
- end: this._dqEnd,
2257
- value: this._dqText,
2258
- text: src.slice(dqStart + 1, this._dqEnd),
2259
- },
2260
- ],
2261
- });
2262
- litStart = pos;
2263
- }
2264
- continue;
2265
- }
2266
- if (ch === CH_DOLLAR) {
2267
- keywordEligible = false;
2268
- const dollarStart = pos;
2269
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2270
- assignmentState = ASSIGNMENT_INVALID;
2271
- this.pos = pos;
2272
- this.readDollar();
2273
- pos = this.pos;
2274
- if (!this._resultIsRaw)
2275
- valueIsRaw = false;
2276
- if (pos > dollarStart)
2277
- lastValueChar = src.charCodeAt(pos - 1);
2278
- if (this._resultHasExpansion)
2279
- hasExpansions = true;
2280
- if (bt)
2281
- text += this._resultText;
2282
- if (bp) {
2283
- if (this._resultPart) {
2284
- if (dollarStart > litStart) {
2285
- parts.push({
2286
- type: "Literal",
2287
- pos: litStart,
2288
- end: dollarStart,
2289
- value: litBuf,
2290
- text: src.slice(litStart, dollarStart),
2291
- });
2292
- litBuf = "";
2293
- }
2294
- parts.push(this._resultPart);
2295
- litStart = pos;
2296
- }
2297
- else {
2298
- litBuf += this._resultText;
2299
- }
2300
- }
2301
- continue;
2302
- }
2303
- if (ch === CH_BACKTICK) {
2304
- keywordEligible = false;
2305
- const btStart = pos;
2306
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2307
- assignmentState = ASSIGNMENT_INVALID;
2308
- this.pos = pos;
2309
- this.readBacktickExpansion();
2310
- pos = this.pos;
2311
- valueIsRaw = false;
2312
- lastValueChar = src.charCodeAt(pos - 1);
2313
- hasExpansions = true;
2314
- if (bt)
2315
- text += this._resultText;
2316
- if (bp) {
2317
- if (btStart > litStart) {
2318
- parts.push({
2319
- type: "Literal",
2320
- pos: litStart,
2321
- end: btStart,
2322
- value: litBuf,
2323
- text: src.slice(litStart, btStart),
2324
- });
2325
- litBuf = "";
2326
- }
2327
- parts.push(this._resultPart);
2328
- litStart = pos;
2329
- }
2330
- continue;
2331
- }
2332
- if (ch === CH_LBRACE) {
2333
- if (assignmentState >= 0 && assignmentState < ASSIGNMENT_INDEX_BASE)
2334
- assignmentState = ASSIGNMENT_INVALID;
2335
- const braceEnd = scanBraceExpansion(src, pos, len);
2336
- if (braceEnd > 0) {
2337
- keywordEligible = false;
2338
- lastValueChar = src.charCodeAt(braceEnd - 1);
2339
- if (bt) {
2340
- const braceText = src.slice(pos, braceEnd);
2341
- text += braceText;
2342
- if (bp) {
2343
- if (pos > litStart) {
2344
- parts.push({
2345
- type: "Literal",
2346
- pos: litStart,
2347
- end: pos,
2348
- value: litBuf,
2349
- text: src.slice(litStart, pos),
2350
- });
2351
- litBuf = "";
2352
- }
2353
- parts.push({
2354
- type: "BraceExpansion",
2355
- pos,
2356
- end: braceEnd,
2357
- text: braceText,
2358
- parts: hasEmbeddedWordStructure(src, pos + 1, braceEnd - 1)
2359
- ? this.parseSubFieldWord(pos + 1, braceEnd - 1).parts
2360
- : undefined,
2361
- });
2362
- litStart = braceEnd;
2363
- }
2364
- }
2365
- pos = braceEnd;
2366
- continue;
2367
- }
2368
- lastValueChar = CH_LBRACE;
2369
- if (bt) {
2370
- text += "{";
2371
- if (bp)
2372
- litBuf += "{";
2373
- }
2374
- pos++;
2375
- continue;
2376
- }
2377
- pos++;
2378
- }
2379
- if (bp && pos > litStart)
2380
- parts.push({ type: "Literal", pos: litStart, end: pos, value: litBuf, text: src.slice(litStart, pos) });
2381
- this.pos = pos;
2382
- this._wordText = text;
2383
- this._wordRaw = valueIsRaw;
2384
- this._wordQuoted = quoted;
2385
- this._wordHasExpansions = hasExpansions;
2386
- this._wordKeywordEligible = keywordEligible;
2387
- this._wordIsAssignment = isMatchedAssignment(assignmentState);
2388
- this._wordAssignmentOperatorPos = this._wordIsAssignment ? assignmentOperatorPos(assignmentState) : undefined;
2389
- if (bp) {
2390
- // Only store parts if they add structure beyond a single literal
2391
- this._wordParts = parts.length > 1 || (parts.length === 1 && parts[0].type !== "Literal") ? parts : null;
2392
- }
2393
- }
2394
- readInnerWordText() {
2395
- const src = this.src;
2396
- const len = this.srcEnd;
2397
- let pos = this.pos;
2398
- let text = "";
2399
- const bp = this._buildParts;
2400
- let parts;
2401
- let litBuf = "";
2402
- let litStart = 0;
2403
- if (bp) {
2404
- parts = [];
2405
- litStart = pos;
2406
- }
2407
- while (pos < len) {
2408
- const ch = src.charCodeAt(pos);
2409
- if (ch === CH_BACKSLASH) {
2410
- pos++;
2411
- if (pos < len) {
2412
- if (src.charCodeAt(pos) === CH_NL) {
2413
- pos++;
2414
- }
2415
- else {
2416
- const escaped = src[pos++];
2417
- text += escaped;
2418
- if (bp)
2419
- litBuf += escaped;
2420
- }
2421
- }
2422
- continue;
2423
- }
2424
- if (ch === CH_SQUOTE) {
2425
- const sqStart = pos;
2426
- pos++;
2427
- const start = pos;
2428
- while (pos < len && src.charCodeAt(pos) !== CH_SQUOTE)
2429
- pos++;
2430
- const value = src.slice(start, pos);
2431
- text += value;
2432
- if (pos < len)
2433
- pos++;
2434
- if (bp) {
2435
- if (sqStart > litStart) {
2436
- parts.push({
2437
- type: "Literal",
2438
- pos: litStart,
2439
- end: sqStart,
2440
- value: litBuf,
2441
- text: src.slice(litStart, sqStart),
2442
- });
2443
- litBuf = "";
2444
- }
2445
- parts.push({ type: "SingleQuoted", pos: sqStart, end: pos, value, text: src.slice(sqStart, pos) });
2446
- litStart = pos;
2447
- }
2448
- continue;
2449
- }
2450
- if (ch === CH_DQUOTE) {
2451
- const dqStart = pos;
2452
- pos++;
2453
- this.pos = pos;
2454
- this.readDoubleQuoted();
2455
- pos = this.pos;
2456
- text += this._dqText;
2457
- if (bp) {
2458
- if (dqStart > litStart) {
2459
- parts.push({
2460
- type: "Literal",
2461
- pos: litStart,
2462
- end: dqStart,
2463
- value: litBuf,
2464
- text: src.slice(litStart, dqStart),
2465
- });
2466
- litBuf = "";
2467
- }
2468
- const dqText = src.slice(dqStart, pos);
2469
- parts.push({
2470
- type: "DoubleQuoted",
2471
- pos: dqStart,
2472
- end: pos,
2473
- text: dqText,
2474
- parts: this._dqParts ?? [
2475
- {
2476
- type: "Literal",
2477
- pos: dqStart + 1,
2478
- end: this._dqEnd,
2479
- value: this._dqText,
2480
- text: src.slice(dqStart + 1, this._dqEnd),
2481
- },
2482
- ],
2483
- });
2484
- litStart = pos;
2485
- }
2486
- continue;
2487
- }
2488
- if (ch === CH_DOLLAR) {
2489
- const dollarStart = pos;
2490
- this.pos = pos;
2491
- this.readDollar();
2492
- pos = this.pos;
2493
- text += this._resultText;
2494
- if (bp) {
2495
- if (this._resultPart) {
2496
- if (dollarStart > litStart) {
2497
- parts.push({
2498
- type: "Literal",
2499
- pos: litStart,
2500
- end: dollarStart,
2501
- value: litBuf,
2502
- text: src.slice(litStart, dollarStart),
2503
- });
2504
- litBuf = "";
2505
- }
2506
- parts.push(this._resultPart);
2507
- litStart = pos;
2508
- }
2509
- else {
2510
- litBuf += this._resultText;
2511
- }
2512
- }
2513
- continue;
2514
- }
2515
- if (ch === CH_BACKTICK) {
2516
- const btStart = pos;
2517
- this.pos = pos;
2518
- this.readBacktickExpansion();
2519
- pos = this.pos;
2520
- text += this._resultText;
2521
- if (bp) {
2522
- if (btStart > litStart) {
2523
- parts.push({
2524
- type: "Literal",
2525
- pos: litStart,
2526
- end: btStart,
2527
- value: litBuf,
2528
- text: src.slice(litStart, btStart),
2529
- });
2530
- litBuf = "";
2531
- }
2532
- parts.push(this._resultPart);
2533
- litStart = pos;
2534
- }
2535
- continue;
2536
- }
2537
- if ((ch === CH_LT || ch === CH_GT) && pos + 1 < len && src.charCodeAt(pos + 1) === CH_LPAREN) {
2538
- const psStart = pos;
2539
- this.pos = pos + 2;
2540
- const inner = this.extractBalanced();
2541
- pos = this.pos;
2542
- const raw = src.slice(psStart, pos);
2543
- text += raw;
2544
- if (bp) {
2545
- if (psStart > litStart) {
2546
- parts.push({
2547
- type: "Literal",
2548
- pos: litStart,
2549
- end: psStart,
2550
- value: litBuf,
2551
- text: src.slice(litStart, psStart),
2552
- });
2553
- litBuf = "";
2554
- }
2555
- const part = {
2556
- type: "ProcessSubstitution",
2557
- pos: psStart,
2558
- end: pos,
2559
- text: raw,
2560
- operator: ch === CH_LT ? "<" : ">",
2561
- script: undefined,
2562
- };
2563
- parts.push(part);
2564
- this.collect(part, inner, psStart + 2, !this._unbalanced);
2565
- litStart = pos;
2566
- }
2567
- continue;
2568
- }
2569
- text += src[pos];
2570
- if (bp)
2571
- litBuf += src[pos];
2572
- pos++;
2573
- }
2574
- if (bp && pos > litStart)
2575
- parts.push({ type: "Literal", pos: litStart, end: pos, value: litBuf, text: src.slice(litStart, pos) });
2576
- this.pos = pos;
2577
- this._wordText = text;
2578
- this._wordRaw = false;
2579
- this._wordQuoted = false;
2580
- this._wordHasExpansions = false;
2581
- this._wordKeywordEligible = false;
2582
- if (bp) {
2583
- this._wordParts = parts.length > 1 || (parts.length === 1 && parts[0].type !== "Literal") ? parts : null;
2584
- }
2585
- }
2586
- // Parse a parameter-expansion sub-field (operand, slice bound, replacement pattern) over
2587
- // the window [start, end) of the original source. Parsing in place — rather than against a
2588
- // detached slice — gives the word and any nested substitutions absolute offsets, and
2589
- // composes through nested ${...}. The `${...}` inner is a verbatim substring of the
2590
- // source, so every sub-field offset maps straight back.
2591
- parseSubFieldWord(start, end) {
2592
- if (start >= end)
2593
- return new WordImpl("", start, start);
2594
- // Sub-fields nest through readInnerWordText (nested expansions, arithmetic embedded
2595
- // words); once the shared budget is spent, keep the raw span as an unstructured word.
2596
- if (this._nestingDepth >= MAX_SYNTAX_NESTING)
2597
- return new WordImpl(this.src.slice(start, end), start, end);
2598
- this._nestingDepth++;
2599
- const savedEnd = this.srcEnd;
2600
- const savedPos = this.pos;
2601
- const savedText = this._wordText;
2602
- const savedParts = this._wordParts;
2603
- const savedQuoted = this._wordQuoted;
2604
- const savedKeywordEligible = this._wordKeywordEligible;
2605
- this.srcEnd = end;
2606
- this.pos = start;
2607
- this.readInnerWordText();
2608
- // text is the raw source span (so source.slice(pos, end) === text holds, as for every
2609
- // other word); value resolves quotes via parts.
2610
- const word = new WordImpl(this.src.slice(start, end), start, end);
2611
- if (this._buildParts && this._wordParts) {
2612
- word.parts = this._wordParts;
2613
- }
2614
- this.srcEnd = savedEnd;
2615
- this.pos = savedPos;
2616
- this._wordText = savedText;
2617
- this._wordParts = savedParts;
2618
- this._wordQuoted = savedQuoted;
2619
- this._wordKeywordEligible = savedKeywordEligible;
2620
- this._nestingDepth--;
2621
- return word;
2622
- }
2623
- skipSQ() {
2624
- while (this.pos < this.srcEnd && this.src.charCodeAt(this.pos) !== CH_SQUOTE)
2625
- this.pos++;
2626
- if (this.pos < this.srcEnd)
2627
- this.pos++;
2628
- }
2629
- skipAnsiCQuoted() {
2630
- const quotePos = this.pos - 1;
2631
- const result = decodeAnsiCQuoted(this.src, this.pos, this.srcEnd);
2632
- this.pos = result.end;
2633
- if (!result.closed)
2634
- this.errors.push({ message: "unterminated ANSI-C quote", pos: quotePos });
2635
- }
2636
- skipDQ() {
2637
- const src = this.src;
2638
- const len = this.srcEnd;
2639
- while (this.pos < len) {
2640
- const ch = src.charCodeAt(this.pos);
2641
- if (ch === CH_DQUOTE) {
2642
- this.pos++;
2643
- return;
2644
- }
2645
- if (ch === CH_BACKSLASH) {
2646
- this.pos += 2;
2647
- continue;
2648
- }
2649
- if (ch === CH_DOLLAR && this.pos + 1 < len) {
2650
- const next = src.charCodeAt(this.pos + 1);
2651
- if (next === CH_LPAREN) {
2652
- const csStart = this.pos;
2653
- this.pos += 2;
2654
- this.extractBalanced();
2655
- if (this._unbalanced)
2656
- this.errors.push({ message: "unterminated command substitution", pos: csStart });
2657
- continue;
2658
- }
2659
- if (next === CH_LBRACE) {
2660
- this.pos += 2;
2661
- let d = 1;
2662
- while (this.pos < len && d > 0) {
2663
- const c = src.charCodeAt(this.pos);
2664
- if (c === CH_RBRACE) {
2665
- if (--d === 0) {
2666
- this.pos++;
2667
- break;
2668
- }
2669
- }
2670
- else if (c === CH_LBRACE && this.pos > 0 && src.charCodeAt(this.pos - 1) === CH_DOLLAR)
2671
- d++;
2672
- else if (c === CH_BACKSLASH) {
2673
- this.pos++;
2674
- }
2675
- else if (c === CH_SQUOTE) {
2676
- this.pos++;
2677
- this.skipSQ();
2678
- continue;
2679
- }
2680
- else if (c === CH_DQUOTE) {
2681
- this.pos++;
2682
- this.skipDQ();
2683
- continue;
2684
- }
2685
- this.pos++;
2686
- }
2687
- continue;
2688
- }
2689
- }
2690
- if (ch === CH_BACKTICK) {
2691
- this.pos++;
2692
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
2693
- if (src.charCodeAt(this.pos) === CH_BACKSLASH)
2694
- this.pos++;
2695
- this.pos++;
2696
- }
2697
- if (this.pos < len)
2698
- this.pos++;
2699
- continue;
2700
- }
2701
- this.pos++;
2702
- }
2703
- }
2704
- skipSpacesAndTabs() {
2705
- const src = this.src;
2706
- const len = this.srcEnd;
2707
- while (this.pos < len) {
2708
- const ch = src.charCodeAt(this.pos);
2709
- if (ch === CH_SPACE || ch === CH_TAB)
2710
- this.pos++;
2711
- else if (ch === CH_BACKSLASH && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_NL)
2712
- this.pos += 2;
2713
- else
2714
- break;
2715
- }
2716
- }
2717
- readDoubleQuoted() {
2718
- const src = this.src;
2719
- const len = this.srcEnd;
2720
- const contentStart = this.pos;
2721
- let hasExpansions = false;
2722
- const bp = this._buildParts;
2723
- const bt = bp || this._buildValue;
2724
- // Fast path: pure literal content (no $, `, or \ — just find closing ")
2725
- if (!bp) {
2726
- let p = this.pos;
2727
- while (p < len) {
2728
- const c = src.charCodeAt(p);
2729
- if (c === CH_DQUOTE) {
2730
- this._dqText = bt ? src.slice(contentStart, p) : "";
2731
- this._dqEnd = p;
2732
- this.pos = p + 1;
2733
- this._dqHasExpansions = false;
2734
- this._dqParts = null;
2735
- return;
2736
- }
2737
- if (c === CH_DOLLAR || c === CH_BACKTICK || c === CH_BACKSLASH)
2738
- break;
2739
- p++;
2740
- }
2741
- // Fall through to general path
2742
- }
2743
- let text = "";
2744
- let parts = null;
2745
- let litBuf = "";
2746
- let litStart = bp ? this.pos : 0;
2747
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_DQUOTE) {
2748
- // Scan run of plain chars inside double quotes
2749
- const runStart = this.pos;
2750
- while (this.pos < len) {
2751
- const c = src.charCodeAt(this.pos);
2752
- if (c === CH_DQUOTE || c === CH_BACKSLASH || c === CH_DOLLAR || c === CH_BACKTICK)
2753
- break;
2754
- this.pos++;
2755
- }
2756
- if (bt && this.pos > runStart) {
2757
- const chunk = src.slice(runStart, this.pos);
2758
- text += chunk;
2759
- if (bp)
2760
- litBuf += chunk;
2761
- }
2762
- if (this.pos >= len || src.charCodeAt(this.pos) === CH_DQUOTE)
2763
- break;
2764
- const ch = src.charCodeAt(this.pos);
2765
- if (ch === CH_BACKSLASH) {
2766
- this.pos++;
2767
- if (this.pos < len) {
2768
- const next = src.charCodeAt(this.pos);
2769
- if (next === CH_NL) {
2770
- this.pos++;
2771
- continue;
2772
- }
2773
- if (bt) {
2774
- if (next === CH_DOLLAR || next === CH_BACKTICK || next === CH_DQUOTE || next === CH_BACKSLASH) {
2775
- const c = src[this.pos];
2776
- text += c;
2777
- if (bp)
2778
- litBuf += c;
2779
- }
2780
- else {
2781
- const pair = "\\" + src[this.pos];
2782
- text += pair;
2783
- if (bp)
2784
- litBuf += pair;
2785
- }
2786
- }
2787
- this.pos++;
2788
- }
2789
- continue;
2790
- }
2791
- if (ch === CH_DOLLAR) {
2792
- // Inside double quotes `$"` and `$'` are a literal $: no locale string, no ANSI-C quote.
2793
- const afterDollar = this.pos + 1 < len ? src.charCodeAt(this.pos + 1) : 0;
2794
- if (afterDollar === CH_DQUOTE || afterDollar === CH_SQUOTE) {
2795
- if (bt) {
2796
- text += "$";
2797
- if (bp)
2798
- litBuf += "$";
2799
- }
2800
- this.pos++;
2801
- continue;
2802
- }
2803
- const expStart = this.pos;
2804
- this.readDollar();
2805
- if (bt)
2806
- text += this._resultText;
2807
- if (this._resultHasExpansion)
2808
- hasExpansions = true;
2809
- if (bp) {
2810
- const rp = this._resultPart;
2811
- if (rp && isDQChild(rp)) {
2812
- if (!parts)
2813
- parts = [];
2814
- if (expStart > litStart) {
2815
- parts.push({
2816
- type: "Literal",
2817
- pos: litStart,
2818
- end: expStart,
2819
- value: litBuf,
2820
- text: src.slice(litStart, expStart),
2821
- });
2822
- litBuf = "";
2823
- }
2824
- parts.push(rp);
2825
- litStart = this.pos;
2826
- }
2827
- else {
2828
- litBuf += this._resultText;
2829
- }
2830
- }
2831
- continue;
2832
- }
2833
- if (ch === CH_BACKTICK) {
2834
- const btStart = this.pos;
2835
- this.readBacktickExpansion(true);
2836
- if (bt)
2837
- text += this._resultText;
2838
- hasExpansions = true;
2839
- if (bp && this._resultPart && isDQChild(this._resultPart)) {
2840
- if (!parts)
2841
- parts = [];
2842
- if (btStart > litStart) {
2843
- parts.push({
2844
- type: "Literal",
2845
- pos: litStart,
2846
- end: btStart,
2847
- value: litBuf,
2848
- text: src.slice(litStart, btStart),
2849
- });
2850
- litBuf = "";
2851
- }
2852
- parts.push(this._resultPart);
2853
- litStart = this.pos;
2854
- }
2855
- continue;
2856
- }
2857
- }
2858
- if (bp && parts && this.pos > litStart)
2859
- parts.push({ type: "Literal", pos: litStart, end: this.pos, value: litBuf, text: src.slice(litStart, this.pos) });
2860
- this._dqEnd = this.pos;
2861
- if (this.pos < len)
2862
- this.pos++; // closing "
2863
- else
2864
- this.errors.push({ message: "unterminated double quote", pos: contentStart - 1 });
2865
- this._dqText = text;
2866
- this._dqHasExpansions = hasExpansions;
2867
- this._dqParts = parts;
2868
- }
2869
- readDollar() {
2870
- const dollarPos = this.pos;
2871
- this.pos++; // skip $
2872
- const src = this.src;
2873
- const len = this.srcEnd;
2874
- const bt = this._buildParts || this._buildValue;
2875
- if (this.pos >= len) {
2876
- this._resultText = "$";
2877
- this._resultIsRaw = true;
2878
- this._resultHasExpansion = false;
2879
- this._resultPart = undefined;
2880
- return;
2881
- }
2882
- const logicalPos = skipLineContinuations(src, this.pos, len);
2883
- if (logicalPos > this.pos &&
2884
- src.charCodeAt(logicalPos) === CH_LPAREN &&
2885
- src.charCodeAt(logicalPos + 1) !== CH_LPAREN)
2886
- this.pos = logicalPos;
2887
- const ch = src.charCodeAt(this.pos);
2888
- if (ch === CH_LPAREN) {
2889
- if (this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
2890
- const savedPos = this.pos;
2891
- const savedErrors = this.errors.length;
2892
- this.readArithmeticExpansion(dollarPos);
2893
- if (!this._notArithmetic)
2894
- return;
2895
- this.errors.length = savedErrors;
2896
- this.pos = savedPos;
2897
- }
2898
- this.readCommandSubstitution(dollarPos);
2899
- return;
2900
- }
2901
- if (ch === CH_LBRACE) {
2902
- const after = this.pos + 1 < len ? src.charCodeAt(this.pos + 1) : 0;
2903
- if (after === CH_SPACE || after === CH_TAB || after === CH_NL) {
2904
- this.readBraceCommandSubstitution();
2905
- return;
2906
- }
2907
- if (after === CH_PIPE) {
2908
- this.readValueSubstitution();
2909
- return;
2910
- }
2911
- this.readParameterExpansion();
2912
- return;
2913
- }
2914
- if (ch === CH_SQUOTE) {
2915
- this.pos++;
2916
- if (bt) {
2917
- const value = this.readAnsiCQuoted();
2918
- this._resultText = value;
2919
- this._resultPart = this._buildParts
2920
- ? { type: "AnsiCQuoted", pos: dollarPos, end: this.pos, text: src.slice(dollarPos, this.pos), value }
2921
- : undefined;
2922
- }
2923
- else {
2924
- this.skipAnsiCQuoted();
2925
- this._resultText = "";
2926
- this._resultPart = undefined;
2927
- }
2928
- this._resultIsRaw = false;
2929
- this._resultHasExpansion = false;
2930
- return;
2931
- }
2932
- if (ch === CH_DQUOTE) {
2933
- this.pos++;
2934
- this.readDoubleQuoted();
2935
- this._resultText = this._dqText;
2936
- this._resultIsRaw = false;
2937
- this._resultHasExpansion = this._dqHasExpansions;
2938
- if (this._buildParts) {
2939
- const text = src.slice(dollarPos, this.pos);
2940
- this._resultPart = {
2941
- type: "LocaleString",
2942
- pos: dollarPos,
2943
- end: this.pos,
2944
- text,
2945
- parts: this._dqParts ?? [
2946
- {
2947
- type: "Literal",
2948
- pos: dollarPos + 2,
2949
- end: this._dqEnd,
2950
- value: this._dqText,
2951
- text: src.slice(dollarPos + 2, this._dqEnd),
2952
- },
2953
- ],
2954
- };
2955
- }
2956
- else {
2957
- this._resultPart = undefined;
2958
- }
2959
- return;
2960
- }
2961
- if (ch === CH_AT ||
2962
- ch === CH_STAR ||
2963
- ch === CH_HASH ||
2964
- ch === CH_QUESTION ||
2965
- ch === CH_DASH ||
2966
- ch === CH_DOLLAR ||
2967
- ch === CH_BANG ||
2968
- (ch >= CH_0 && ch <= CH_9)) {
2969
- this.pos++;
2970
- const text = bt ? src.slice(this.pos - 2, this.pos) : "";
2971
- this._resultText = text;
2972
- this._resultIsRaw = true;
2973
- this._resultHasExpansion = false;
2974
- this._resultPart = this._buildParts
2975
- ? { type: "SimpleExpansion", pos: dollarPos, end: this.pos, text }
2976
- : undefined;
2977
- return;
2978
- }
2979
- if (ch < 128 && isIdChar[ch] & 1) {
2980
- const namePos = this.pos - 1;
2981
- while (this.pos < len) {
2982
- const c = src.charCodeAt(this.pos);
2983
- if (c < 128 && isIdChar[c] & 2)
2984
- this.pos++;
2985
- else
2986
- break;
2987
- }
2988
- const text = bt ? src.slice(namePos, this.pos) : "";
2989
- this._resultText = text;
2990
- this._resultIsRaw = true;
2991
- this._resultHasExpansion = false;
2992
- this._resultPart = this._buildParts
2993
- ? { type: "SimpleExpansion", pos: dollarPos, end: this.pos, text }
2994
- : undefined;
2995
- return;
2996
- }
2997
- // $[ expr ] is bash's deprecated spelling of $(( expr )). It runs to the matching ']',
2998
- // so parentheses inside belong to the expansion instead of ending the word.
2999
- if (ch === CH_LBRACKET) {
3000
- const close = this.findClosingArithmeticBracket(this.pos + 1);
3001
- if (close !== -1) {
3002
- const bodyStart = this.pos + 1;
3003
- const body = src.slice(bodyStart, close);
3004
- this.pos = close + 1;
3005
- const text = bt ? src.slice(dollarPos, this.pos) : "";
3006
- this._resultText = text;
3007
- this._resultIsRaw = true;
3008
- this._resultHasExpansion = false;
3009
- this._resultPart = this._buildParts
3010
- ? {
3011
- type: "ArithmeticExpansion",
3012
- pos: bodyStart - 2,
3013
- end: this.pos,
3014
- text,
3015
- expression: this.buildArithmeticExpression(body, bodyStart),
3016
- }
3017
- : undefined;
3018
- return;
3019
- }
3020
- }
3021
- this._resultText = "$";
3022
- this._resultIsRaw = true;
3023
- this._resultHasExpansion = false;
3024
- this._resultPart = undefined;
3025
- }
3026
- scanArithmeticBody() {
3027
- this._notArithmetic = false;
3028
- this._arithUnterminated = false;
3029
- this.pos += 2;
3030
- let depth = 1;
3031
- let parenDepth = 0;
3032
- let parentParenDepth = 0;
3033
- let parenDepths;
3034
- let expansions = 0;
3035
- let reported = false;
3036
- const src = this.src;
3037
- const len = this.srcEnd;
3038
- const start = this.pos;
3039
- while (this.pos < len && depth > 0) {
3040
- const c = src.charCodeAt(this.pos);
3041
- if (c === CH_BACKSLASH) {
3042
- this.pos += this.pos + 1 < len ? 2 : 1;
3043
- }
3044
- else if (c === CH_SQUOTE) {
3045
- this.pos++;
3046
- this.skipSQ();
3047
- }
3048
- else if (c === CH_DQUOTE) {
3049
- this.pos++;
3050
- this.skipDQ();
3051
- }
3052
- else if (c === CH_BACKTICK) {
3053
- this.pos++;
3054
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3055
- if (src.charCodeAt(this.pos) === CH_BACKSLASH)
3056
- this.pos++;
3057
- this.pos++;
3058
- }
3059
- if (this.pos < len)
3060
- this.pos++;
3061
- }
3062
- else if (c === CH_DOLLAR &&
3063
- this.pos + 2 < len &&
3064
- src.charCodeAt(this.pos + 1) === CH_LPAREN &&
3065
- src.charCodeAt(this.pos + 2) !== CH_LPAREN) {
3066
- const dollarPos = this.pos;
3067
- this.pos += 2;
3068
- this.extractBalanced();
3069
- if (this._unbalanced)
3070
- this.errors.push({ message: "unterminated command substitution", pos: dollarPos });
3071
- }
3072
- else if (c === CH_DOLLAR && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LBRACE) {
3073
- const close = this.findClosingBrace(this.pos + 2, len);
3074
- this.pos = close === -1 ? len : close + 1;
3075
- }
3076
- else if ((c === CH_LT || c === CH_GT) && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
3077
- this.pos += 2;
3078
- this.extractBalanced();
3079
- }
3080
- else if (c === CH_LPAREN) {
3081
- if (src.charCodeAt(this.pos - 1) === CH_DOLLAR && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
3082
- if (depth === 1)
3083
- parentParenDepth = parenDepth;
3084
- else
3085
- (parenDepths ?? (parenDepths = [])).push(parenDepth);
3086
- depth++;
3087
- parenDepth = 0;
3088
- // Nested $((...)) — count it against the shared budget (the expansion this scan
3089
- // belongs to is level one, hence >=) so over-deep chains surface a parse error.
3090
- if (++expansions + this._nestingDepth >= MAX_SYNTAX_NESTING) {
3091
- if (!reported) {
3092
- this.errors.push({ message: "maximum arithmetic expansion nesting depth exceeded", pos: this.pos - 1 });
3093
- reported = true;
3094
- }
3095
- }
3096
- this.pos += 2;
3097
- }
3098
- else {
3099
- parenDepth++;
3100
- this.pos++;
3101
- }
3102
- }
3103
- else if (c === CH_RPAREN && parenDepth > 0) {
3104
- parenDepth--;
3105
- this.pos++;
3106
- }
3107
- else if (c === CH_RPAREN && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_RPAREN) {
3108
- if (--depth === 0) {
3109
- this.pos += 2;
3110
- break;
3111
- }
3112
- parenDepth = depth === 1 ? parentParenDepth : parenDepths.pop();
3113
- this.pos += 2;
3114
- }
3115
- else if (c === CH_RPAREN && depth === 1) {
3116
- // Bash reads `((` and `$((` as arithmetic only when the inner parenthesis pair is
3117
- // immediately followed by `)`. It closed without one, so `((a) )` is nested subshells
3118
- // and `$((a) || (b))` a command substitution; callers re-read from the start.
3119
- this._notArithmetic = true;
3120
- return "";
3121
- }
3122
- else {
3123
- this.pos++;
3124
- }
3125
- }
3126
- const bt = this._buildParts || this._buildValue;
3127
- if (depth > 0) {
3128
- this._arithUnterminated = true;
3129
- return bt ? src.slice(start, this.pos) : "";
3130
- }
3131
- return bt ? src.slice(start, this.pos - 2) : "";
3132
- }
3133
- readArithmeticExpansion(dollarPos) {
3134
- const bodyStart = this.pos + 2; // absolute offset of the body, past the "((" at this.pos
3135
- const body = this.scanArithmeticBody();
3136
- if (this._notArithmetic)
3137
- return;
3138
- if (this._arithUnterminated)
3139
- this.errors.push({ message: "unterminated arithmetic expansion", pos: dollarPos });
3140
- const text = this._buildParts || this._buildValue ? this.src.slice(dollarPos, this.pos) : "";
3141
- this._resultText = text;
3142
- this._resultIsRaw = true;
3143
- this._resultHasExpansion = false;
3144
- this._resultPart = this._buildParts
3145
- ? {
3146
- type: "ArithmeticExpansion",
3147
- pos: dollarPos,
3148
- end: this.pos,
3149
- text,
3150
- expression: this.buildArithmeticExpression(body, bodyStart),
3151
- }
3152
- : undefined;
3153
- }
3154
- // Pass the absolute body offset so arithmetic nodes index the original source directly
3155
- // (no re-basing). Nested $(...) command subs inside the arithmetic get an absolute
3156
- // innerStart so resolveCollected parses their window in place.
3157
- buildArithmeticExpression(body, bodyStart) {
3158
- if (!hasEmbeddedWordStructure(this.src, bodyStart, bodyStart + body.length)) {
3159
- return parseArithmeticExpression(body, bodyStart) ?? undefined;
3160
- }
3161
- const commandExpansions = [];
3162
- const embeddedWords = [];
3163
- const expr = parseArithmeticExpression(body, bodyStart, {
3164
- commandExpansions,
3165
- embeddedWords,
3166
- findClosingBracket: (start, end) => this.findClosingBracket(start, end),
3167
- findClosingBrace: (start, end) => this.findClosingBrace(start, end),
3168
- findClosingParenthesis: (start, end) => this.findClosingParenthesis(start, end),
3169
- findArithmeticExpansionEnd: (start, end) => this.findArithmeticExpansionEnd(start, end),
3170
- findArithmeticWordEnd: (start, end) => this.findArithmeticWordEnd(start, end),
3171
- }) ?? undefined;
3172
- for (const node of commandExpansions) {
3173
- this.collect(node, node.text.slice(2, -1), node.pos + 2, true);
3174
- }
3175
- for (const node of embeddedWords)
3176
- node.parts = this.parseSubFieldWord(node.pos, node.end).parts;
3177
- return expr;
3178
- }
3179
- readArithmeticCommand(out, tokenStart) {
3180
- const savedBuildValue = this._buildValue;
3181
- this._buildValue = true;
3182
- const body = this.scanArithmeticBody();
3183
- this._buildValue = savedBuildValue;
3184
- if (this._arithUnterminated)
3185
- this.errors.push({ message: "unterminated arithmetic command", pos: tokenStart });
3186
- setToken(out, Token.ArithCmd, body, tokenStart, this.pos);
3187
- }
3188
- readCommandSubstitution(dollarPos) {
3189
- const openPos = this.pos;
3190
- this.pos++; // skip (
3191
- // extractBalanced returns the inner text without the closing paren, so it
3192
- // stays correct when the input ended before that paren was reached.
3193
- const inner = this.extractBalanced();
3194
- if (this._unbalanced)
3195
- this.errors.push({ message: "unterminated command substitution", pos: dollarPos });
3196
- const bt = this._buildParts || this._buildValue;
3197
- const rawText = bt ? this.src.slice(dollarPos, this.pos) : "";
3198
- const text = !bt || openPos === dollarPos + 1 ? rawText : "$" + this.src.slice(openPos, this.pos);
3199
- this._resultText = text;
3200
- this._resultIsRaw = openPos === dollarPos + 1;
3201
- this._resultHasExpansion = true;
3202
- if (this._buildParts) {
3203
- this._resultPart = { type: "CommandExpansion", pos: dollarPos, end: this.pos, text: rawText, script: undefined };
3204
- this.collect(this._resultPart, inner, openPos + 1, !this._unbalanced);
3205
- }
3206
- else {
3207
- this._resultPart = undefined;
3208
- }
3209
- }
3210
- readBraceCommandSubstitution() {
3211
- this.readBraceSubstitution(1);
3212
- }
3213
- readValueSubstitution() {
3214
- this.readBraceSubstitution(2);
3215
- }
3216
- readBraceSubstitution(skip) {
3217
- const dollarPos = this.pos - 1;
3218
- this.pos += skip;
3219
- const src = this.src;
3220
- const len = this.srcEnd;
3221
- let depth = 1;
3222
- const start = this.pos;
3223
- while (this.pos < len) {
3224
- const c = src.charCodeAt(this.pos);
3225
- if (c === CH_LBRACE)
3226
- depth++;
3227
- else if (c === CH_RBRACE) {
3228
- if (--depth === 0) {
3229
- this.pos++;
3230
- break;
3231
- }
3232
- }
3233
- else if (c === CH_SQUOTE) {
3234
- this.pos++;
3235
- this.skipSQ();
3236
- continue;
3237
- }
3238
- else if (c === CH_DQUOTE) {
3239
- this.pos++;
3240
- this.skipDQ();
3241
- continue;
3242
- }
3243
- else if (c === CH_BACKSLASH)
3244
- this.pos++;
3245
- this.pos++;
3246
- }
3247
- this._resultIsRaw = true;
3248
- this._resultHasExpansion = true;
3249
- if (this._buildParts || this._buildValue) {
3250
- const rawInner = src.slice(start, this.pos - 1);
3251
- const inner = rawInner.trim();
3252
- const text = src.slice(dollarPos, this.pos);
3253
- this._resultText = text;
3254
- if (this._buildParts) {
3255
- const innerStart = start + (rawInner.length - rawInner.trimStart().length);
3256
- this._resultPart = { type: "CommandExpansion", pos: dollarPos, end: this.pos, text, script: undefined };
3257
- this.collect(this._resultPart, inner, innerStart);
3258
- }
3259
- else {
3260
- this._resultPart = undefined;
3261
- }
3262
- }
3263
- else {
3264
- this._resultText = "";
3265
- this._resultPart = undefined;
3266
- }
3267
- }
3268
- readBacktickExpansion(insideDoubleQuotes = false) {
3269
- this.pos++; // skip opening `
3270
- const src = this.src;
3271
- const len = this.srcEnd;
3272
- const start = this.pos;
3273
- if (!this._buildParts && !this._buildValue) {
3274
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3275
- if (src.charCodeAt(this.pos) === CH_BACKSLASH && this.pos + 1 < len)
3276
- this.pos++;
3277
- this.pos++;
3278
- }
3279
- if (this.pos < len)
3280
- this.pos++;
3281
- else
3282
- this.errors.push({ message: "unterminated backtick", pos: start - 1 });
3283
- this._resultText = "";
3284
- this._resultIsRaw = false;
3285
- this._resultHasExpansion = true;
3286
- this._resultPart = undefined;
3287
- return;
3288
- }
3289
- let inner = "";
3290
- let hasEscapes = false;
3291
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3292
- if (src.charCodeAt(this.pos) === CH_BACKSLASH) {
3293
- hasEscapes = true;
3294
- break;
3295
- }
3296
- this.pos++;
3297
- }
3298
- if (!hasEscapes) {
3299
- inner = src.slice(start, this.pos);
3300
- }
3301
- else {
3302
- inner = src.slice(start, this.pos);
3303
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3304
- if (src.charCodeAt(this.pos) === CH_BACKSLASH) {
3305
- this.pos++;
3306
- if (this.pos < len) {
3307
- const c = src.charCodeAt(this.pos);
3308
- if (c === CH_DOLLAR || c === CH_BACKTICK || c === CH_BACKSLASH || (insideDoubleQuotes && c === CH_DQUOTE)) {
3309
- inner += src[this.pos];
3310
- }
3311
- else {
3312
- inner += "\\" + src[this.pos];
3313
- }
3314
- this.pos++;
3315
- }
3316
- }
3317
- else {
3318
- const runStart = this.pos;
3319
- while (this.pos < len) {
3320
- const c = src.charCodeAt(this.pos);
3321
- if (c === CH_BACKTICK || c === CH_BACKSLASH)
3322
- break;
3323
- this.pos++;
3324
- }
3325
- inner += src.slice(runStart, this.pos);
3326
- }
3327
- }
3328
- }
3329
- if (this.pos < len)
3330
- this.pos++; // closing `
3331
- else
3332
- this.errors.push({ message: "unterminated backtick", pos: start - 1 });
3333
- const text = src.slice(start - 1, this.pos); // raw source including backticks
3334
- this._resultText = inner;
3335
- this._resultHasExpansion = true;
3336
- if (this._buildParts) {
3337
- // Escaped backticks rebuild `inner` (escapes removed), so its offsets no
3338
- // longer map linearly onto the source — leave innerStart undefined there.
3339
- this._resultPart = {
3340
- type: "CommandExpansion",
3341
- pos: start - 1,
3342
- end: this.pos,
3343
- text,
3344
- script: undefined,
3345
- };
3346
- this.collect(this._resultPart, inner, hasEscapes ? undefined : start);
3347
- }
3348
- else {
3349
- this._resultPart = undefined;
3350
- }
3351
- }
3352
- readParameterExpansion() {
3353
- const src = this.src;
3354
- const len = this.srcEnd;
3355
- const start = this.pos; // at {
3356
- this.pos++;
3357
- let depth = 1;
3358
- let reported = false;
3359
- while (this.pos < len && depth > 0) {
3360
- const ch = src.charCodeAt(this.pos);
3361
- if (ch === CH_DOLLAR) {
3362
- // Dispatch forward: `$$` consumes its own second `$`, so a `{` after it is literal.
3363
- const next = this.pos + 1 < len ? src.charCodeAt(this.pos + 1) : 0;
3364
- if (next === CH_LBRACE) {
3365
- depth++;
3366
- if (this._nestingDepth + depth > MAX_SYNTAX_NESTING && !reported) {
3367
- this.errors.push({ message: "maximum parameter expansion nesting depth exceeded", pos: this.pos });
3368
- reported = true;
3369
- }
3370
- this.pos += 2;
3371
- continue;
3372
- }
3373
- if (next === CH_DOLLAR) {
3374
- this.pos += 2;
3375
- continue;
3376
- }
3377
- if (next === CH_LPAREN) {
3378
- const dollarPos = this.pos;
3379
- this.pos += 2;
3380
- this.extractBalanced();
3381
- if (this._unbalanced)
3382
- this.errors.push({ message: "unterminated command substitution", pos: dollarPos });
3383
- continue;
3384
- }
3385
- }
3386
- else if (ch === CH_BACKTICK) {
3387
- this.pos++;
3388
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3389
- if (src.charCodeAt(this.pos) === CH_BACKSLASH)
3390
- this.pos++;
3391
- this.pos++;
3392
- }
3393
- if (this.pos < len)
3394
- this.pos++;
3395
- continue;
3396
- }
3397
- else if (ch === CH_RBRACE) {
3398
- if (--depth === 0) {
3399
- this.pos++;
3400
- break;
3401
- }
3402
- }
3403
- else if (ch === CH_BACKSLASH) {
3404
- if (this.pos + 1 < len)
3405
- this.pos++;
3406
- }
3407
- else if (ch === CH_SQUOTE) {
3408
- this.pos++;
3409
- if (this.pos > start + 1 && src.charCodeAt(this.pos - 2) === CH_DOLLAR)
3410
- this.skipAnsiCQuoted();
3411
- else
3412
- this.skipSQ();
3413
- continue;
3414
- }
3415
- else if (ch === CH_DQUOTE) {
3416
- this.pos++;
3417
- this.skipDQ();
3418
- continue;
3419
- }
3420
- this.pos++;
3421
- }
3422
- const closed = depth === 0;
3423
- if (!closed)
3424
- this.errors.push({ message: "unterminated parameter expansion", pos: start - 1 });
3425
- const text = this._buildParts || this._buildValue ? src.slice(start - 1, this.pos) : "";
3426
- this._resultText = text;
3427
- this._resultIsRaw = true;
3428
- this._resultHasExpansion = false;
3429
- if (this._buildParts) {
3430
- const inner = src.slice(start + 1, closed ? this.pos - 1 : this.pos);
3431
- this._resultPart = this.parseParamInner(text, inner, start + 1);
3432
- }
3433
- else {
3434
- this._resultPart = undefined;
3435
- }
3436
- }
3437
- // `innerStart` is the absolute offset of `inner` in the original source, so each sub-field
3438
- // word is parsed in place at its true position. `sub(a, b)` maps inner-relative offsets to
3439
- // that absolute window.
3440
- parseParamInner(text, inner, innerStart) {
3441
- const result = {
3442
- type: "ParameterExpansion",
3443
- pos: innerStart - 2,
3444
- end: this.pos,
3445
- text,
3446
- parameter: "",
3447
- parameterPos: innerStart,
3448
- parameterEnd: innerStart,
3449
- prefix: undefined,
3450
- index: undefined,
3451
- operation: undefined,
3452
- };
3453
- const ilen = inner.length;
3454
- if (ilen === 0)
3455
- return result;
3456
- const sub = (a, b) => this.parseSubFieldWord(innerStart + a, innerStart + b);
3457
- const closeBracket = (start) => {
3458
- const close = this.findClosingBracket(innerStart + start, innerStart + ilen);
3459
- return close === -1 ? -1 : close - innerStart;
3460
- };
3461
- let i = 0;
3462
- if (ilen > 1 && inner.charCodeAt(0) === CH_BANG) {
3463
- result.prefix = "!";
3464
- i = 1;
3465
- }
3466
- if (ilen > 1 && inner.charCodeAt(0) === CH_HASH) {
3467
- const nameEnd = this.scanParamName(inner, 1);
3468
- let parameterEnd = nameEnd;
3469
- let indexEnd = -1;
3470
- if (parameterEnd < ilen && inner.charCodeAt(parameterEnd) === CH_LBRACKET) {
3471
- indexEnd = closeBracket(parameterEnd + 1);
3472
- if (indexEnd !== -1)
3473
- parameterEnd = indexEnd + 1;
3474
- }
3475
- if (nameEnd > 1 && parameterEnd === ilen) {
3476
- result.prefix = "#";
3477
- result.parameter = inner.slice(1, nameEnd);
3478
- result.parameterPos = innerStart + 1;
3479
- result.parameterEnd = innerStart + nameEnd;
3480
- if (indexEnd !== -1)
3481
- result.index = sub(nameEnd + 1, indexEnd);
3482
- return result;
3483
- }
3484
- }
3485
- const nameStart = i;
3486
- i = this.scanParamName(inner, i);
3487
- result.parameter = inner.slice(nameStart, i);
3488
- result.parameterPos = innerStart + nameStart;
3489
- result.parameterEnd = innerStart + i;
3490
- if (i < ilen && inner.charCodeAt(i) === CH_LBRACKET) {
3491
- const closeB = closeBracket(i + 1);
3492
- if (closeB !== -1) {
3493
- result.index = sub(i + 1, closeB);
3494
- i = closeB + 1;
3495
- }
3496
- }
3497
- if (i >= ilen)
3498
- return result;
3499
- const pos = innerStart + i;
3500
- const end = innerStart + ilen;
3501
- const opChar = inner.charCodeAt(i);
3502
- const nextChar = inner.charCodeAt(i + 1);
3503
- const defaultChar = inner[opChar === CH_COLON ? i + 1 : i];
3504
- if (defaultChar === "-" || defaultChar === "=" || defaultChar === "+" || defaultChar === "?") {
3505
- const operandStart = i + (opChar === CH_COLON ? 2 : 1);
3506
- result.operation = {
3507
- type: "Default",
3508
- pos,
3509
- end,
3510
- operatorEnd: innerStart + operandStart,
3511
- operator: opChar === CH_COLON ? `:${defaultChar}` : defaultChar,
3512
- operand: sub(operandStart, ilen),
3513
- };
3514
- return result;
3515
- }
3516
- if (opChar === CH_COLON) {
3517
- i++;
3518
- const sliceStart = innerStart + i;
3519
- const colonIdx = findUnnested(inner.slice(i), CH_COLON, true, (index, quoted) => {
3520
- return this.findNestedShellEnd(sliceStart + index, end, quoted) - sliceStart;
3521
- });
3522
- result.operation = {
3523
- type: "Slice",
3524
- pos,
3525
- end,
3526
- operatorEnd: sliceStart,
3527
- operator: ":",
3528
- offset: sub(i, colonIdx === -1 ? ilen : i + colonIdx),
3529
- length: colonIdx === -1 ? undefined : sub(i + colonIdx + 1, ilen),
3530
- };
3531
- return result;
3532
- }
3533
- if (opChar === CH_HASH || opChar === CH_PERCENT) {
3534
- const doubled = nextChar === opChar;
3535
- const operator = opChar === CH_HASH ? (doubled ? "##" : "#") : doubled ? "%%" : "%";
3536
- const operandStart = i + (doubled ? 2 : 1);
3537
- result.operation = {
3538
- type: "Remove",
3539
- pos,
3540
- end,
3541
- operatorEnd: innerStart + operandStart,
3542
- operator,
3543
- operand: sub(operandStart, ilen),
3544
- };
3545
- return result;
3546
- }
3547
- if (opChar === CH_SLASH) {
3548
- i++;
3549
- let operator = "/";
3550
- if (nextChar === CH_SLASH || nextChar === CH_HASH || nextChar === CH_PERCENT) {
3551
- operator = nextChar === CH_SLASH ? "//" : nextChar === CH_HASH ? "/#" : "/%";
3552
- i++;
3553
- }
3554
- let separatorStart = i;
3555
- if (nextChar === CH_SLASH) {
3556
- // After // a leading slash belongs to the pattern; /# and /% allow empty patterns.
3557
- separatorStart = skipLineContinuations(inner, i, ilen);
3558
- if (inner.charCodeAt(separatorStart) === CH_SLASH)
3559
- separatorStart++;
3560
- }
3561
- const sepIdx = findUnnested(inner.slice(separatorStart), CH_SLASH);
3562
- const patternEnd = sepIdx === -1 ? ilen : separatorStart + sepIdx;
3563
- result.operation = {
3564
- type: "Replace",
3565
- pos,
3566
- end,
3567
- operatorEnd: innerStart + i,
3568
- operator,
3569
- pattern: sub(i, patternEnd),
3570
- replacement: sub(sepIdx === -1 ? ilen : patternEnd + 1, ilen),
3571
- };
3572
- return result;
3573
- }
3574
- if (opChar === CH_CARET || opChar === CH_COMMA) {
3575
- const doubled = nextChar === opChar;
3576
- const operator = opChar === CH_CARET ? (doubled ? "^^" : "^") : doubled ? ",," : ",";
3577
- const operandStart = i + (doubled ? 2 : 1);
3578
- result.operation = {
3579
- type: "CaseModification",
3580
- pos,
3581
- end,
3582
- operatorEnd: innerStart + operandStart,
3583
- operator,
3584
- operand: operandStart === ilen ? undefined : sub(operandStart, ilen),
3585
- };
3586
- return result;
3587
- }
3588
- if (result.prefix === "!" &&
3589
- result.index === undefined &&
3590
- i + 1 === ilen &&
3591
- (opChar === CH_AT || opChar === CH_STAR)) {
3592
- result.operation = { type: "Names", pos, end, operatorEnd: end, operator: opChar === CH_AT ? "@" : "*" };
3593
- return result;
3594
- }
3595
- if (opChar === CH_AT) {
3596
- result.operation = {
3597
- type: "Transform",
3598
- pos,
3599
- end,
3600
- operatorEnd: pos + 1,
3601
- operator: "@",
3602
- operand: sub(i + 1, ilen),
3603
- };
3604
- return result;
3605
- }
3606
- result.operation = { type: "Unknown", pos, end, operatorEnd: end, operator: inner.slice(i) };
3607
- return result;
3608
- }
3609
- findNestedShellEnd(start, end, quoted) {
3610
- const ch = this.src.charCodeAt(start);
3611
- if (ch === CH_BACKTICK) {
3612
- let pos = start + 1;
3613
- while (pos < end) {
3614
- const current = this.src.charCodeAt(pos);
3615
- if (current === CH_BACKSLASH) {
3616
- pos += 2;
3617
- continue;
3618
- }
3619
- pos++;
3620
- if (current === CH_BACKTICK)
3621
- return pos;
3622
- }
3623
- return end;
3624
- }
3625
- let close;
3626
- if (ch === CH_DOLLAR) {
3627
- const next = start + 1;
3628
- if (next < end && this.src.charCodeAt(next) === CH_LBRACE) {
3629
- close = this.findClosingBrace(next + 1, end);
3630
- }
3631
- else {
3632
- const open = skipLineContinuations(this.src, next, end);
3633
- if (open >= end || this.src.charCodeAt(open) !== CH_LPAREN)
3634
- return start;
3635
- close = this.findClosingParenthesis(open + 1, end);
3636
- }
3637
- }
3638
- else {
3639
- const open = start + 1;
3640
- if (quoted || (ch !== CH_LT && ch !== CH_GT) || open >= end || this.src.charCodeAt(open) !== CH_LPAREN) {
3641
- return start;
3642
- }
3643
- close = this.findClosingParenthesis(open + 1, end);
3644
- }
3645
- return close === -1 ? end : close + 1;
3646
- }
3647
- scanParamName(s, start) {
3648
- let i = start;
3649
- if (i >= s.length)
3650
- return i;
3651
- const c = s.charCodeAt(i);
3652
- // Special single-char params
3653
- if (c === CH_AT ||
3654
- c === CH_STAR ||
3655
- c === CH_HASH ||
3656
- c === CH_QUESTION ||
3657
- c === CH_DASH ||
3658
- c === CH_DOLLAR ||
3659
- c === CH_BANG) {
3660
- return i + 1;
3661
- }
3662
- // Digits
3663
- if (c >= CH_0 && c <= CH_9) {
3664
- while (i < s.length && s.charCodeAt(i) >= CH_0 && s.charCodeAt(i) <= CH_9)
3665
- i++;
3666
- return i;
3667
- }
3668
- // Regular name: [a-zA-Z_][a-zA-Z0-9_]*
3669
- if ((c >= CH_a && c <= CH_z) || (c >= CH_A && c <= CH_Z) || c === CH_UNDERSCORE) {
3670
- i++;
3671
- while (i < s.length) {
3672
- const ch = s.charCodeAt(i);
3673
- if ((ch >= CH_a && ch <= CH_z) ||
3674
- (ch >= CH_A && ch <= CH_Z) ||
3675
- (ch >= CH_0 && ch <= CH_9) ||
3676
- ch === CH_UNDERSCORE)
3677
- i++;
3678
- else
3679
- break;
3680
- }
3681
- }
3682
- return i;
3683
- }
3684
- readAnsiCQuoted() {
3685
- const quotePos = this.pos - 1;
3686
- const result = decodeAnsiCQuoted(this.src, this.pos, this.srcEnd);
3687
- this.pos = result.end;
3688
- if (!result.closed)
3689
- this.errors.push({ message: "unterminated ANSI-C quote", pos: quotePos });
3690
- return result.value;
3691
- }
3692
- // Extract balanced parens for $(...) — respects nested quotes and case..esac
3693
- extractBalanced() {
3694
- const src = this.src;
3695
- const len = this.srcEnd;
3696
- const bt = this._buildParts || this._buildValue;
3697
- let depth = 1;
3698
- const start = this.pos;
3699
- this._unbalanced = false;
3700
- let wordStart = true;
3701
- // Fast path: scan for simple cases with no nested quotes/parens/case. Nothing here
3702
- // opens a paren — `(` breaks to the slow path — so depth stays 1 and the first `)`
3703
- // closes the construct.
3704
- while (this.pos < len) {
3705
- const c = src.charCodeAt(this.pos);
3706
- if (c === CH_RPAREN) {
3707
- const result = bt ? src.slice(start, this.pos) : "";
3708
- this.pos++;
3709
- return result;
3710
- }
3711
- else if (c === CH_LPAREN || c === CH_BACKSLASH || c === CH_SQUOTE || c === CH_DQUOTE || c === CH_BACKTICK) {
3712
- break;
3713
- }
3714
- else if (c === CH_LT && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LT) {
3715
- break;
3716
- }
3717
- else if (c === CH_HASH && wordStart) {
3718
- break;
3719
- }
3720
- else if (c === 99 /* c */ &&
3721
- wordStart &&
3722
- this.pos + 3 < len &&
3723
- src.charCodeAt(this.pos + 1) === 97 /* a */ &&
3724
- src.charCodeAt(this.pos + 2) === 115 /* s */ &&
3725
- src.charCodeAt(this.pos + 3) === 101 /* e */ &&
3726
- (this.pos + 4 >= len || (src.charCodeAt(this.pos + 4) < 128 && charType[src.charCodeAt(this.pos + 4)] & 1))) {
3727
- break;
3728
- }
3729
- else {
3730
- wordStart = c < 128 && (charType[c] & 1) !== 0;
3731
- this.pos++;
3732
- }
3733
- }
3734
- // Slow path: just track position (source is copied verbatim, so slice at end)
3735
- let caseDepth = 0;
3736
- // Parentheses opened since the innermost `case` began. A `)` only terminates a case
3737
- // pattern when nothing is open — otherwise it closes a pattern's leading `(`, an
3738
- // extglob group, or a subshell in the case body, and must rebalance `depth`.
3739
- let caseParens = 0;
3740
- // Word-form parens resume mid-word; grammar parens resume where `#` can open a comment.
3741
- const wordStartAfterParen = [];
3742
- let pendingDelims = null;
3743
- let arithBase = -1;
3744
- // A `$((` extent is found by bash's arithmetic scanner, where `#` is ordinary, and keeps
3745
- // that extent even for a command body. The two chars before `start` are the delimiter.
3746
- const arithExtent = start >= 2 &&
3747
- src.charCodeAt(start) === CH_LPAREN &&
3748
- src.charCodeAt(start - 1) === CH_LPAREN &&
3749
- src.charCodeAt(start - 2) === CH_DOLLAR;
3750
- let substitutions = 0;
3751
- let reported = false;
3752
- let continuedDollarPos = -1;
3753
- let continuedParenPos = -1;
3754
- while (this.pos < len && depth > 0) {
3755
- const ch = src.charCodeAt(this.pos);
3756
- if (ch === CH_LPAREN) {
3757
- const prev = this.pos > start ? src.charCodeAt(this.pos - 1) : 0;
3758
- const commandDollarPos = prev === CH_DOLLAR ? this.pos - 1 : this.pos === continuedParenPos ? continuedDollarPos : -1;
3759
- const wordParen = commandDollarPos !== -1 ||
3760
- prev === CH_LT ||
3761
- prev === CH_GT ||
3762
- prev === CH_EQ ||
3763
- prev === CH_AT ||
3764
- prev === CH_QUESTION ||
3765
- prev === CH_STAR ||
3766
- prev === CH_PLUS ||
3767
- prev === CH_BANG ||
3768
- (prev === CH_LPAREN && wordStartAfterParen[wordStartAfterParen.length - 1] === false) ||
3769
- (arithExtent && this.pos === start);
3770
- wordStartAfterParen.push(!wordParen);
3771
- wordStart = true;
3772
- // (( opens arithmetic — suppress heredoc detection until the parens
3773
- // rebalance so shift operators inside aren't mistaken for heredocs
3774
- if (arithBase < 0 && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LPAREN) {
3775
- arithBase = depth;
3776
- }
3777
- // Nested $( — count it against the shared budget (the substitution being
3778
- // scanned is level one, hence >=) so over-deep chains surface a parse error.
3779
- if (commandDollarPos !== -1 && ++substitutions + this._nestingDepth >= MAX_SYNTAX_NESTING) {
3780
- if (!reported) {
3781
- this.errors.push({ message: "maximum command substitution nesting depth exceeded", pos: commandDollarPos });
3782
- reported = true;
3783
- }
3784
- }
3785
- continuedDollarPos = -1;
3786
- continuedParenPos = -1;
3787
- depth++;
3788
- if (caseDepth > 0)
3789
- caseParens++;
3790
- this.pos++;
3791
- }
3792
- else if (ch === CH_RPAREN) {
3793
- if (caseDepth > 0 && caseParens === 0) {
3794
- this.pos++;
3795
- wordStart = true;
3796
- }
3797
- else {
3798
- if (caseDepth > 0)
3799
- caseParens--;
3800
- depth--;
3801
- if (depth === 0) {
3802
- const result = bt ? src.slice(start, this.pos) : "";
3803
- this.pos++;
3804
- return result;
3805
- }
3806
- if (depth <= arithBase)
3807
- arithBase = -1;
3808
- wordStart = wordStartAfterParen.pop() ?? true;
3809
- this.pos++;
3810
- }
3811
- }
3812
- else if (ch === CH_BACKSLASH) {
3813
- if (this.pos > start && src.charCodeAt(this.pos - 1) === CH_DOLLAR) {
3814
- const logicalPos = skipLineContinuations(src, this.pos, len);
3815
- if (logicalPos > this.pos &&
3816
- src.charCodeAt(logicalPos) === CH_LPAREN &&
3817
- src.charCodeAt(logicalPos + 1) !== CH_LPAREN) {
3818
- continuedDollarPos = this.pos - 1;
3819
- continuedParenPos = logicalPos;
3820
- }
3821
- }
3822
- this.pos++;
3823
- if (this.pos < len) {
3824
- if (src.charCodeAt(this.pos) !== CH_NL) {
3825
- wordStart = false;
3826
- }
3827
- this.pos++;
3828
- }
3829
- }
3830
- else if (ch === CH_SQUOTE) {
3831
- this.pos++;
3832
- this.skipSQ();
3833
- wordStart = false;
3834
- }
3835
- else if (ch === CH_DQUOTE) {
3836
- this.pos++;
3837
- this.skipDQ();
3838
- wordStart = false;
3839
- }
3840
- else if (ch === CH_BACKTICK) {
3841
- this.pos++;
3842
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_BACKTICK) {
3843
- if (src.charCodeAt(this.pos) === CH_BACKSLASH)
3844
- this.pos++;
3845
- if (this.pos < len)
3846
- this.pos++;
3847
- }
3848
- if (this.pos < len)
3849
- this.pos++;
3850
- wordStart = false;
3851
- }
3852
- else if (ch === CH_LT && arithBase < 0 && this.pos + 1 < len && src.charCodeAt(this.pos + 1) === CH_LT) {
3853
- // << is a heredoc operator even in case-pattern position — unquoted <<
3854
- // inside a pattern is a bash syntax error, so no caseDepth gate here
3855
- if (this.pos + 2 < len && src.charCodeAt(this.pos + 2) === CH_LT) {
3856
- this.pos += 3; // <<< herestring
3857
- }
3858
- else {
3859
- this.pos += 2;
3860
- const strip = this.pos < len && src.charCodeAt(this.pos) === CH_DASH;
3861
- if (strip)
3862
- this.pos++;
3863
- this.skipSpacesAndTabs();
3864
- this.readHereDocDelimiter();
3865
- // Empty unquoted delimiter means there was no delimiter word (`<< )`)
3866
- if (this._hereDelim || this._hereQuoted) {
3867
- (pendingDelims ?? (pendingDelims = [])).push({
3868
- delimiter: this._hereDelim,
3869
- strip,
3870
- quoted: this._hereQuoted,
3871
- });
3872
- }
3873
- }
3874
- wordStart = false;
3875
- }
3876
- else if (ch === CH_NL && pendingDelims) {
3877
- this.pos++;
3878
- for (const hd of pendingDelims)
3879
- this.skipHereDocBody(hd.delimiter, hd.strip, true, hd.quoted);
3880
- pendingDelims = null;
3881
- wordStart = true;
3882
- }
3883
- else if (ch === CH_HASH && arithBase < 0 && !arithExtent && wordStart) {
3884
- // Word-boundary # opens a comment — opaque up to (not including) the
3885
- // newline, so quotes and << inside it stay inert
3886
- while (this.pos < len && src.charCodeAt(this.pos) !== CH_NL)
3887
- this.pos++;
3888
- }
3889
- else {
3890
- const wStart = this.pos;
3891
- while (this.pos < len) {
3892
- const wc = src.charCodeAt(this.pos);
3893
- if (wc < 128 && charType[wc])
3894
- break;
3895
- this.pos++;
3896
- }
3897
- if (this.pos > wStart) {
3898
- const wLen = this.pos - wStart;
3899
- if (wLen === 4 && wordStart) {
3900
- const c0 = src.charCodeAt(wStart);
3901
- if (c0 === 99 &&
3902
- src.charCodeAt(wStart + 1) === 97 &&
3903
- src.charCodeAt(wStart + 2) === 115 &&
3904
- src.charCodeAt(wStart + 3) === 101) {
3905
- caseDepth++;
3906
- }
3907
- else if (c0 === 101 &&
3908
- src.charCodeAt(wStart + 1) === 115 &&
3909
- src.charCodeAt(wStart + 2) === 97 &&
3910
- src.charCodeAt(wStart + 3) === 99 &&
3911
- caseDepth > 0) {
3912
- caseDepth--;
3913
- if (caseDepth === 0)
3914
- caseParens = 0;
3915
- }
3916
- }
3917
- wordStart = false;
3918
- }
3919
- else {
3920
- const wc = src.charCodeAt(this.pos);
3921
- wordStart = wc < 128 && (charType[wc] & 1) !== 0;
3922
- this.pos++;
3923
- }
3924
- }
3925
- }
3926
- // Ran out of input before the closing paren.
3927
- this._unbalanced = true;
3928
- return bt ? src.slice(start, this.pos) : "";
3929
- }
3930
- }