funkscript 0.2.3 → 0.2.6

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 (359) hide show
  1. package/README.md +23 -5
  2. package/dist/ast/types.d.ts.map +1 -1
  3. package/dist/ast/types.js.map +1 -1
  4. package/dist/ast/walk.d.ts.map +1 -1
  5. package/dist/ast/walk.js.map +1 -1
  6. package/dist/cli/build-bun.d.ts.map +1 -1
  7. package/dist/cli/build-bun.js.map +1 -1
  8. package/dist/cli/build-watch.d.ts.map +1 -1
  9. package/dist/cli/build-watch.js +5 -3
  10. package/dist/cli/build-watch.js.map +1 -1
  11. package/dist/cli/build.d.ts +1 -1
  12. package/dist/cli/build.d.ts.map +1 -1
  13. package/dist/cli/build.js.map +1 -1
  14. package/dist/cli/check.d.ts.map +1 -1
  15. package/dist/cli/check.js.map +1 -1
  16. package/dist/cli/commands.d.ts.map +1 -1
  17. package/dist/cli/commands.js.map +1 -1
  18. package/dist/cli/doc.d.ts.map +1 -1
  19. package/dist/cli/doc.js.map +1 -1
  20. package/dist/cli/doctor.d.ts.map +1 -1
  21. package/dist/cli/doctor.js +4 -2
  22. package/dist/cli/doctor.js.map +1 -1
  23. package/dist/cli/emit.d.ts +1 -1
  24. package/dist/cli/emit.d.ts.map +1 -1
  25. package/dist/cli/emit.js.map +1 -1
  26. package/dist/cli/explain.d.ts.map +1 -1
  27. package/dist/cli/explain.js.map +1 -1
  28. package/dist/cli/fmt.d.ts.map +1 -1
  29. package/dist/cli/fmt.js.map +1 -1
  30. package/dist/cli/index.d.ts.map +1 -1
  31. package/dist/cli/index.js +0 -0
  32. package/dist/cli/index.js.map +1 -1
  33. package/dist/cli/init.d.ts +1 -1
  34. package/dist/cli/init.d.ts.map +1 -1
  35. package/dist/cli/init.js +66 -21
  36. package/dist/cli/init.js.map +1 -1
  37. package/dist/cli/io.d.ts.map +1 -1
  38. package/dist/cli/io.js.map +1 -1
  39. package/dist/cli/pipeline-style.d.ts.map +1 -1
  40. package/dist/cli/pipeline-style.js.map +1 -1
  41. package/dist/cli/repl.d.ts.map +1 -1
  42. package/dist/cli/repl.js.map +1 -1
  43. package/dist/cli/run.d.ts.map +1 -1
  44. package/dist/cli/run.js.map +1 -1
  45. package/dist/cli/test.d.ts +1 -1
  46. package/dist/cli/test.d.ts.map +1 -1
  47. package/dist/cli/test.js.map +1 -1
  48. package/dist/cli/tsc.d.ts.map +1 -1
  49. package/dist/cli/tsc.js +5 -3
  50. package/dist/cli/tsc.js.map +1 -1
  51. package/dist/cli/typecheck.d.ts.map +1 -1
  52. package/dist/cli/typecheck.js.map +1 -1
  53. package/dist/compiler/ast-inspection.d.ts.map +1 -1
  54. package/dist/compiler/ast-inspection.js.map +1 -1
  55. package/dist/compiler/boolean-operators.d.ts.map +1 -1
  56. package/dist/compiler/boolean-operators.js +12 -2
  57. package/dist/compiler/boolean-operators.js.map +1 -1
  58. package/dist/compiler/check.d.ts.map +1 -1
  59. package/dist/compiler/check.js +95 -103
  60. package/dist/compiler/check.js.map +1 -1
  61. package/dist/compiler/diagnostics.d.ts.map +1 -1
  62. package/dist/compiler/diagnostics.js.map +1 -1
  63. package/dist/compiler/effect-mutation-rule.d.ts.map +1 -1
  64. package/dist/compiler/effect-mutation-rule.js.map +1 -1
  65. package/dist/compiler/entry-rules.d.ts.map +1 -1
  66. package/dist/compiler/entry-rules.js.map +1 -1
  67. package/dist/compiler/incremental-build.d.ts.map +1 -1
  68. package/dist/compiler/incremental-build.js.map +1 -1
  69. package/dist/compiler/incremental-dependencies.d.ts.map +1 -1
  70. package/dist/compiler/incremental-dependencies.js.map +1 -1
  71. package/dist/compiler/js-interop-nullability.d.ts.map +1 -1
  72. package/dist/compiler/js-interop-nullability.js.map +1 -1
  73. package/dist/compiler/modules/output-collisions.d.ts.map +1 -1
  74. package/dist/compiler/modules/output-collisions.js.map +1 -1
  75. package/dist/compiler/modules/output-plan.d.ts.map +1 -1
  76. package/dist/compiler/modules/output-plan.js.map +1 -1
  77. package/dist/compiler/modules/resolution.d.ts.map +1 -1
  78. package/dist/compiler/modules/resolution.js +2 -1
  79. package/dist/compiler/modules/resolution.js.map +1 -1
  80. package/dist/compiler/modules/source-files.d.ts +3 -0
  81. package/dist/compiler/modules/source-files.d.ts.map +1 -0
  82. package/dist/compiler/modules/source-files.js +5 -0
  83. package/dist/compiler/modules/source-files.js.map +1 -0
  84. package/dist/compiler/numeric-comparisons.d.ts.map +1 -1
  85. package/dist/compiler/numeric-comparisons.js.map +1 -1
  86. package/dist/compiler/optional-arguments.d.ts.map +1 -1
  87. package/dist/compiler/optional-arguments.js.map +1 -1
  88. package/dist/compiler/package-fingerprint.d.ts.map +1 -1
  89. package/dist/compiler/package-fingerprint.js.map +1 -1
  90. package/dist/compiler/package-record-contracts.d.ts.map +1 -1
  91. package/dist/compiler/package-record-contracts.js.map +1 -1
  92. package/dist/compiler/pipelines/catalog.d.ts.map +1 -1
  93. package/dist/compiler/pipelines/catalog.js.map +1 -1
  94. package/dist/compiler/pipelines/companions.d.ts.map +1 -1
  95. package/dist/compiler/pipelines/companions.js.map +1 -1
  96. package/dist/compiler/pipelines/resolution.d.ts.map +1 -1
  97. package/dist/compiler/pipelines/resolution.js.map +1 -1
  98. package/dist/compiler/project-config.d.ts.map +1 -1
  99. package/dist/compiler/project-config.js +29 -19
  100. package/dist/compiler/project-config.js.map +1 -1
  101. package/dist/compiler/record-contracts.d.ts.map +1 -1
  102. package/dist/compiler/record-contracts.js.map +1 -1
  103. package/dist/compiler/rules/control-flow.d.ts.map +1 -1
  104. package/dist/compiler/rules/control-flow.js.map +1 -1
  105. package/dist/compiler/rules/diagnostic.d.ts.map +1 -1
  106. package/dist/compiler/rules/diagnostic.js.map +1 -1
  107. package/dist/compiler/rules/module-scope-refs.d.ts.map +1 -1
  108. package/dist/compiler/rules/module-scope-refs.js.map +1 -1
  109. package/dist/compiler/rules/resource-escape.d.ts +7 -0
  110. package/dist/compiler/rules/resource-escape.d.ts.map +1 -0
  111. package/dist/compiler/rules/resource-escape.js +146 -0
  112. package/dist/compiler/rules/resource-escape.js.map +1 -0
  113. package/dist/compiler/rules/resource-providers.d.ts +19 -0
  114. package/dist/compiler/rules/resource-providers.d.ts.map +1 -0
  115. package/dist/compiler/rules/resource-providers.js +222 -0
  116. package/dist/compiler/rules/resource-providers.js.map +1 -0
  117. package/dist/compiler/schemas/analysis.d.ts.map +1 -1
  118. package/dist/compiler/schemas/analysis.js.map +1 -1
  119. package/dist/compiler/schemas/imported-record-functions.d.ts.map +1 -1
  120. package/dist/compiler/schemas/imported-record-functions.js.map +1 -1
  121. package/dist/compiler/schemas/imported-schemas.d.ts.map +1 -1
  122. package/dist/compiler/schemas/imported-schemas.js.map +1 -1
  123. package/dist/compiler/source-map.d.ts.map +1 -1
  124. package/dist/compiler/source-map.js.map +1 -1
  125. package/dist/compiler/type-view-paths.d.ts +4 -0
  126. package/dist/compiler/type-view-paths.d.ts.map +1 -0
  127. package/dist/compiler/type-view-paths.js +4 -0
  128. package/dist/compiler/type-view-paths.js.map +1 -0
  129. package/dist/compiler/typescript-context.d.ts.map +1 -1
  130. package/dist/compiler/typescript-context.js.map +1 -1
  131. package/dist/compiler.d.ts.map +1 -1
  132. package/dist/compiler.js.map +1 -1
  133. package/dist/emitter/assemblyscript.d.ts.map +1 -1
  134. package/dist/emitter/assemblyscript.js.map +1 -1
  135. package/dist/emitter/declarations.d.ts.map +1 -1
  136. package/dist/emitter/declarations.js.map +1 -1
  137. package/dist/emitter/emitter.d.ts +3 -1
  138. package/dist/emitter/emitter.d.ts.map +1 -1
  139. package/dist/emitter/emitter.js +10 -1
  140. package/dist/emitter/emitter.js.map +1 -1
  141. package/dist/emitter/imports.d.ts.map +1 -1
  142. package/dist/emitter/imports.js.map +1 -1
  143. package/dist/emitter/indent.d.ts.map +1 -1
  144. package/dist/emitter/indent.js.map +1 -1
  145. package/dist/emitter/jsx.d.ts.map +1 -1
  146. package/dist/emitter/jsx.js.map +1 -1
  147. package/dist/emitter/local-bindings.d.ts.map +1 -1
  148. package/dist/emitter/local-bindings.js.map +1 -1
  149. package/dist/emitter/match.d.ts.map +1 -1
  150. package/dist/emitter/match.js.map +1 -1
  151. package/dist/emitter/runtime-helpers.d.ts.map +1 -1
  152. package/dist/emitter/runtime-helpers.js.map +1 -1
  153. package/dist/emitter/schemas.d.ts.map +1 -1
  154. package/dist/emitter/schemas.js.map +1 -1
  155. package/dist/emitter/statements.d.ts +1 -0
  156. package/dist/emitter/statements.d.ts.map +1 -1
  157. package/dist/emitter/statements.js +1 -0
  158. package/dist/emitter/statements.js.map +1 -1
  159. package/dist/emitter/tagged-match.d.ts.map +1 -1
  160. package/dist/emitter/tagged-match.js.map +1 -1
  161. package/dist/emitter/types.d.ts.map +1 -1
  162. package/dist/emitter/types.js.map +1 -1
  163. package/dist/errors.d.ts.map +1 -1
  164. package/dist/errors.js.map +1 -1
  165. package/dist/formatter/comments.d.ts.map +1 -1
  166. package/dist/formatter/comments.js +13 -0
  167. package/dist/formatter/comments.js.map +1 -1
  168. package/dist/formatter/index.d.ts.map +1 -1
  169. package/dist/formatter/index.js +57 -3
  170. package/dist/formatter/index.js.map +1 -1
  171. package/dist/formatter/operator-precedence.d.ts.map +1 -1
  172. package/dist/formatter/operator-precedence.js.map +1 -1
  173. package/dist/formatter/prettier.d.ts.map +1 -1
  174. package/dist/formatter/prettier.js.map +1 -1
  175. package/dist/index.d.ts.map +1 -1
  176. package/dist/index.js.map +1 -1
  177. package/dist/interop/callback.d.ts.map +1 -1
  178. package/dist/interop/callback.js.map +1 -1
  179. package/dist/interop/js.d.ts.map +1 -1
  180. package/dist/interop/js.js.map +1 -1
  181. package/dist/interop/record.d.ts.map +1 -1
  182. package/dist/interop/record.js.map +1 -1
  183. package/dist/interop/valibot.d.ts.map +1 -1
  184. package/dist/interop/valibot.js.map +1 -1
  185. package/dist/interop/zod.d.ts.map +1 -1
  186. package/dist/interop/zod.js.map +1 -1
  187. package/dist/lexer/lexer.d.ts +1 -0
  188. package/dist/lexer/lexer.d.ts.map +1 -1
  189. package/dist/lexer/lexer.js +26 -10
  190. package/dist/lexer/lexer.js.map +1 -1
  191. package/dist/lexer/tokens.d.ts.map +1 -1
  192. package/dist/lexer/tokens.js.map +1 -1
  193. package/dist/lsp/code-action-worker.d.ts.map +1 -1
  194. package/dist/lsp/code-action-worker.js.map +1 -1
  195. package/dist/lsp/completion.d.ts.map +1 -1
  196. package/dist/lsp/completion.js.map +1 -1
  197. package/dist/lsp/definition.d.ts.map +1 -1
  198. package/dist/lsp/definition.js.map +1 -1
  199. package/dist/lsp/diagnostics-worker.d.ts.map +1 -1
  200. package/dist/lsp/diagnostics-worker.js +1 -1
  201. package/dist/lsp/diagnostics-worker.js.map +1 -1
  202. package/dist/lsp/docs.d.ts +1 -1
  203. package/dist/lsp/docs.d.ts.map +1 -1
  204. package/dist/lsp/docs.js +4 -3
  205. package/dist/lsp/docs.js.map +1 -1
  206. package/dist/lsp/error-channel.d.ts.map +1 -1
  207. package/dist/lsp/error-channel.js.map +1 -1
  208. package/dist/lsp/hover.d.ts.map +1 -1
  209. package/dist/lsp/hover.js +16 -5
  210. package/dist/lsp/hover.js.map +1 -1
  211. package/dist/lsp/imports.d.ts.map +1 -1
  212. package/dist/lsp/imports.js +10 -1
  213. package/dist/lsp/imports.js.map +1 -1
  214. package/dist/lsp/index.d.ts.map +1 -1
  215. package/dist/lsp/index.js.map +1 -1
  216. package/dist/lsp/inlay-hints.d.ts.map +1 -1
  217. package/dist/lsp/inlay-hints.js.map +1 -1
  218. package/dist/lsp/interop-rename.d.ts.map +1 -1
  219. package/dist/lsp/interop-rename.js.map +1 -1
  220. package/dist/lsp/match-arms.d.ts.map +1 -1
  221. package/dist/lsp/match-arms.js.map +1 -1
  222. package/dist/lsp/navigation.d.ts.map +1 -1
  223. package/dist/lsp/navigation.js.map +1 -1
  224. package/dist/lsp/parsed-documents.d.ts.map +1 -1
  225. package/dist/lsp/parsed-documents.js.map +1 -1
  226. package/dist/lsp/rename-worker.d.ts.map +1 -1
  227. package/dist/lsp/rename-worker.js.map +1 -1
  228. package/dist/lsp/server.d.ts +2 -1
  229. package/dist/lsp/server.d.ts.map +1 -1
  230. package/dist/lsp/server.js +20 -0
  231. package/dist/lsp/server.js.map +1 -1
  232. package/dist/lsp/signature-help.d.ts +6 -0
  233. package/dist/lsp/signature-help.d.ts.map +1 -0
  234. package/dist/lsp/signature-help.js +183 -0
  235. package/dist/lsp/signature-help.js.map +1 -0
  236. package/dist/lsp/thunk-pipeline.d.ts.map +1 -1
  237. package/dist/lsp/thunk-pipeline.js.map +1 -1
  238. package/dist/lsp/validation.d.ts.map +1 -1
  239. package/dist/lsp/validation.js +3 -2
  240. package/dist/lsp/validation.js.map +1 -1
  241. package/dist/lsp/workspace.d.ts.map +1 -1
  242. package/dist/lsp/workspace.js.map +1 -1
  243. package/dist/parser/declarations.d.ts.map +1 -1
  244. package/dist/parser/declarations.js +22 -1
  245. package/dist/parser/declarations.js.map +1 -1
  246. package/dist/parser/errors.d.ts.map +1 -1
  247. package/dist/parser/errors.js.map +1 -1
  248. package/dist/parser/jsx.d.ts.map +1 -1
  249. package/dist/parser/jsx.js.map +1 -1
  250. package/dist/parser/operator-expressions.d.ts.map +1 -1
  251. package/dist/parser/operator-expressions.js.map +1 -1
  252. package/dist/parser/parser.d.ts.map +1 -1
  253. package/dist/parser/parser.js.map +1 -1
  254. package/dist/parser/patterns.d.ts.map +1 -1
  255. package/dist/parser/patterns.js.map +1 -1
  256. package/dist/parser/pipeline-expressions.d.ts.map +1 -1
  257. package/dist/parser/pipeline-expressions.js.map +1 -1
  258. package/dist/parser/scope.d.ts.map +1 -1
  259. package/dist/parser/scope.js.map +1 -1
  260. package/dist/parser/statements.d.ts.map +1 -1
  261. package/dist/parser/statements.js.map +1 -1
  262. package/dist/parser/types.d.ts.map +1 -1
  263. package/dist/parser/types.js.map +1 -1
  264. package/dist/plugins/bun-preload.d.ts.map +1 -1
  265. package/dist/plugins/bun-preload.js.map +1 -1
  266. package/dist/plugins/bun.d.ts.map +1 -1
  267. package/dist/plugins/bun.js.map +1 -1
  268. package/dist/plugins/esbuild.d.ts.map +1 -1
  269. package/dist/plugins/esbuild.js.map +1 -1
  270. package/dist/plugins/type-view.d.ts.map +1 -1
  271. package/dist/plugins/type-view.js +5 -3
  272. package/dist/plugins/type-view.js.map +1 -1
  273. package/dist/plugins/vite.d.ts.map +1 -1
  274. package/dist/plugins/vite.js.map +1 -1
  275. package/dist/testing/index.d.ts.map +1 -1
  276. package/dist/testing/index.js.map +1 -1
  277. package/dist/tooling/doc.d.ts.map +1 -1
  278. package/dist/tooling/doc.js.map +1 -1
  279. package/dist/tooling/idiomatic.d.ts.map +1 -1
  280. package/dist/tooling/idiomatic.js.map +1 -1
  281. package/dist/tooling/pipeline-style.d.ts.map +1 -1
  282. package/dist/tooling/pipeline-style.js.map +1 -1
  283. package/dist/version.d.ts.map +1 -1
  284. package/dist/version.js.map +1 -1
  285. package/package.json +13 -6
  286. package/src/cli/build-watch.ts +6 -3
  287. package/src/cli/doctor.ts +8 -2
  288. package/src/cli/init.ts +66 -21
  289. package/src/cli/tsc.ts +8 -3
  290. package/src/compiler/boolean-operators.ts +11 -2
  291. package/src/compiler/check.ts +124 -132
  292. package/src/compiler/modules/resolution.ts +2 -1
  293. package/src/compiler/modules/source-files.ts +4 -0
  294. package/src/compiler/project-config.ts +30 -19
  295. package/src/compiler/rules/resource-escape.ts +223 -0
  296. package/src/compiler/rules/resource-providers.ts +293 -0
  297. package/src/compiler/type-view-paths.ts +3 -0
  298. package/src/emitter/emitter.ts +13 -1
  299. package/src/emitter/statements.ts +2 -0
  300. package/src/formatter/comments.ts +14 -0
  301. package/src/formatter/index.ts +70 -2
  302. package/src/lexer/lexer.ts +39 -20
  303. package/src/lsp/diagnostics-worker.ts +1 -4
  304. package/src/lsp/docs.ts +4 -3
  305. package/src/lsp/hover.ts +23 -4
  306. package/src/lsp/imports.ts +20 -1
  307. package/src/lsp/server.ts +30 -0
  308. package/src/lsp/signature-help.ts +226 -0
  309. package/src/lsp/validation.ts +3 -2
  310. package/src/parser/declarations.ts +27 -1
  311. package/src/plugins/type-view.ts +11 -3
  312. package/dist/Widget.tsx +0 -9
  313. package/dist/cli/output-collisions.d.ts +0 -2
  314. package/dist/cli/output-collisions.d.ts.map +0 -1
  315. package/dist/cli/output-collisions.js +0 -39
  316. package/dist/cli/output-collisions.js.map +0 -1
  317. package/dist/compiler/imported-record-functions.d.ts +0 -4
  318. package/dist/compiler/imported-record-functions.d.ts.map +0 -1
  319. package/dist/compiler/imported-record-functions.js +0 -706
  320. package/dist/compiler/imported-record-functions.js.map +0 -1
  321. package/dist/compiler/imported-schemas.d.ts +0 -21
  322. package/dist/compiler/imported-schemas.d.ts.map +0 -1
  323. package/dist/compiler/imported-schemas.js +0 -461
  324. package/dist/compiler/imported-schemas.js.map +0 -1
  325. package/dist/compiler/module-resolution.d.ts +0 -6
  326. package/dist/compiler/module-resolution.d.ts.map +0 -1
  327. package/dist/compiler/module-resolution.js +0 -44
  328. package/dist/compiler/module-resolution.js.map +0 -1
  329. package/dist/compiler/pipeline-companions.d.ts +0 -18
  330. package/dist/compiler/pipeline-companions.d.ts.map +0 -1
  331. package/dist/compiler/pipeline-companions.js +0 -1042
  332. package/dist/compiler/pipeline-companions.js.map +0 -1
  333. package/dist/compiler/providers.d.ts +0 -4
  334. package/dist/compiler/providers.d.ts.map +0 -1
  335. package/dist/compiler/providers.js +0 -101
  336. package/dist/compiler/providers.js.map +0 -1
  337. package/dist/emitter/pipeline-catalog.d.ts +0 -15
  338. package/dist/emitter/pipeline-catalog.d.ts.map +0 -1
  339. package/dist/emitter/pipeline-catalog.js +0 -55
  340. package/dist/emitter/pipeline-catalog.js.map +0 -1
  341. package/dist/emitter/pipeline-resolution.d.ts +0 -38
  342. package/dist/emitter/pipeline-resolution.d.ts.map +0 -1
  343. package/dist/emitter/pipeline-resolution.js +0 -571
  344. package/dist/emitter/pipeline-resolution.js.map +0 -1
  345. package/dist/interop/index.d.ts +0 -6
  346. package/dist/interop/index.d.ts.map +0 -1
  347. package/dist/interop/index.js +0 -6
  348. package/dist/interop/index.js.map +0 -1
  349. package/dist/math.ts +0 -1
  350. package/dist/parser/index.d.ts +0 -9
  351. package/dist/parser/index.d.ts.map +0 -1
  352. package/dist/parser/index.js +0 -9
  353. package/dist/parser/index.js.map +0 -1
  354. package/dist/service.ts +0 -3
  355. package/dist/service.ts.map +0 -1
  356. package/dist/tooling/migrate.d.ts +0 -62
  357. package/dist/tooling/migrate.d.ts.map +0 -1
  358. package/dist/tooling/migrate.js +0 -608
  359. package/dist/tooling/migrate.js.map +0 -1
@@ -0,0 +1,293 @@
1
+ import * as fs from "node:fs";
2
+ import type { Program } from "../../ast/types.js";
3
+ import { FunScriptError, isFileNotFoundError } from "../../errors.js";
4
+ import { Lexer } from "../../lexer/lexer.js";
5
+ import { Parser } from "../../parser/parser.js";
6
+ import {
7
+ astBool,
8
+ astChild,
9
+ astChildren,
10
+ astName,
11
+ collectPatternVars,
12
+ getMemberNames,
13
+ type AstInspectNode,
14
+ } from "../ast-inspection.js";
15
+ import { resolveFunModule } from "../modules/resolution.js";
16
+ import { findResourceEscape } from "./resource-escape.js";
17
+
18
+ const scopedEffectProviders = new Set([
19
+ "acquireRelease",
20
+ "makeSpanScoped",
21
+ "forkScoped",
22
+ ]);
23
+
24
+ export function effectImportNames(program: Program | undefined) {
25
+ const effect = new Set(["Effect"]);
26
+ const scope = new Set(["Scope"]);
27
+ const acquire = new Set(["acquireRelease"]);
28
+ const finalizer = new Set(["addFinalizer"]);
29
+ for (const item of program?.body ?? []) {
30
+ if (item.kind !== "ImportDeclaration" || item.isTypeOnly) continue;
31
+ const source = item.source.parts
32
+ .map((part) => (part.kind === "StringRawPart" ? part.value : ""))
33
+ .join("");
34
+ if (source === "effect") {
35
+ for (const spec of item.specifiers) {
36
+ if (spec.isTypeOnly) continue;
37
+ if (spec.imported.name === "Effect") effect.add(spec.local.name);
38
+ if (spec.imported.name === "Scope") scope.add(spec.local.name);
39
+ }
40
+ }
41
+ if (source === "effect/Effect" || source === "effect/Scope") {
42
+ if (item.namespaceBinding)
43
+ (source === "effect/Effect" ? effect : scope).add(
44
+ item.namespaceBinding.name,
45
+ );
46
+ for (const spec of item.specifiers) {
47
+ if (spec.isTypeOnly) continue;
48
+ if (
49
+ source === "effect/Effect" &&
50
+ scopedEffectProviders.has(spec.imported.name)
51
+ )
52
+ acquire.add(spec.local.name);
53
+ if (spec.imported.name === "addFinalizer")
54
+ finalizer.add(spec.local.name);
55
+ }
56
+ }
57
+ }
58
+ for (const item of program?.body ?? []) {
59
+ const declaration =
60
+ item.kind === "ExportDeclaration" ? item.declaration : item;
61
+ if (
62
+ declaration.kind !== "BindingDeclaration" ||
63
+ declaration.id.kind !== "Identifier"
64
+ )
65
+ continue;
66
+ effect.delete(declaration.id.name);
67
+ scope.delete(declaration.id.name);
68
+ acquire.delete(declaration.id.name);
69
+ finalizer.delete(declaration.id.name);
70
+ }
71
+ return { effect, scope, acquire, finalizer };
72
+ }
73
+
74
+ type Ref = { target: string; name: string };
75
+ type Module = {
76
+ file: string;
77
+ ast: Program;
78
+ bindings: Map<string, AstInspectNode>;
79
+ named: Map<string, Ref>;
80
+ namespaces: Map<string, string>;
81
+ imports: ReturnType<typeof effectImportNames>;
82
+ };
83
+
84
+ /** Resolve resource acquisition through inspected FunkScript modules only. */
85
+ export function createResourceProviderResolver(options: {
86
+ rootFile: string;
87
+ rootAst: Program;
88
+ rootBindings: Map<string, AstInspectNode>;
89
+ rootImports: ReturnType<typeof effectImportNames>;
90
+ shadowed: ReadonlySet<string>;
91
+ sources: ReadonlyMap<string, string>;
92
+ programs: ReadonlyMap<string, Program>;
93
+ }): (expr: AstInspectNode, seen: Set<string>) => boolean {
94
+ const modules = new Map<string, Module>();
95
+ const resolveTarget = (file: string, specifier: string) =>
96
+ resolveFunModule(
97
+ file,
98
+ specifier,
99
+ (name) => options.sources.has(name) || fs.existsSync(name),
100
+ { directories: true },
101
+ );
102
+ const moduleFor = (file: string, ast?: Program): Module | undefined => {
103
+ const cached = modules.get(file);
104
+ if (cached) return cached;
105
+ if (!ast) {
106
+ ast = options.programs.get(file);
107
+ if (!ast) {
108
+ try {
109
+ const source =
110
+ options.sources.get(file) ?? fs.readFileSync(file, "utf8");
111
+ ast = new Parser(
112
+ new Lexer(source, file).tokenize(),
113
+ file,
114
+ source,
115
+ ).parse();
116
+ } catch (error) {
117
+ if (!(error instanceof FunScriptError) && !isFileNotFoundError(error))
118
+ throw error;
119
+ return undefined;
120
+ }
121
+ }
122
+ }
123
+ const root = file === options.rootFile;
124
+ const context: Module = {
125
+ file,
126
+ ast,
127
+ bindings: root ? options.rootBindings : new Map<string, AstInspectNode>(),
128
+ imports: root ? options.rootImports : effectImportNames(ast),
129
+ named: new Map(),
130
+ namespaces: new Map(),
131
+ };
132
+ modules.set(file, context);
133
+ for (const entry of ast.body) {
134
+ const binding =
135
+ entry.kind === "ExportDeclaration" ? entry.declaration : entry;
136
+ if (
137
+ !root &&
138
+ binding.kind === "BindingDeclaration" &&
139
+ binding.id.kind === "Identifier"
140
+ )
141
+ context.bindings.set(binding.id.name, binding.init);
142
+ if (entry.kind !== "ImportDeclaration" || entry.isTypeOnly) continue;
143
+ const specifier = entry.source.parts
144
+ .map((part) => (part.kind === "StringRawPart" ? part.value : ""))
145
+ .join("");
146
+ const target = resolveTarget(file, specifier);
147
+ if (!target) continue;
148
+ if (
149
+ entry.namespaceBinding &&
150
+ !(root && options.shadowed.has(entry.namespaceBinding.name))
151
+ )
152
+ context.namespaces.set(entry.namespaceBinding.name, target);
153
+ for (const spec of entry.specifiers) {
154
+ if (
155
+ !spec.isTypeOnly &&
156
+ !(root && options.shadowed.has(spec.local.name))
157
+ )
158
+ context.named.set(spec.local.name, {
159
+ target,
160
+ name: spec.imported.name,
161
+ });
162
+ }
163
+ }
164
+ return context;
165
+ };
166
+ const root = moduleFor(options.rootFile, options.rootAst)!;
167
+ const exported = (
168
+ file: string,
169
+ name: string,
170
+ seen: Set<string>,
171
+ ): { expression: AstInspectNode; context: Module } | undefined => {
172
+ const key = `export:${file}:${name}`;
173
+ if (seen.has(key)) return undefined;
174
+ const nextSeen = new Set([...seen, key]);
175
+ const context = moduleFor(file);
176
+ if (!context) return undefined;
177
+ for (const entry of context.ast.body) {
178
+ if (
179
+ entry.kind === "ExportDeclaration" &&
180
+ entry.declaration.kind === "BindingDeclaration" &&
181
+ entry.declaration.id.kind === "Identifier" &&
182
+ entry.declaration.id.name === name
183
+ )
184
+ return { expression: entry.declaration.init, context };
185
+ if (entry.kind === "ExportFromDeclaration" && !entry.isTypeOnly) {
186
+ const spec = entry.specifiers.find(
187
+ (item) => !item.isTypeOnly && item.local.name === name,
188
+ );
189
+ if (!spec) continue;
190
+ const source = entry.source.parts
191
+ .map((part) => (part.kind === "StringRawPart" ? part.value : ""))
192
+ .join("");
193
+ const target = resolveTarget(file, source);
194
+ if (target) return exported(target, spec.imported.name, nextSeen);
195
+ }
196
+ }
197
+ return undefined;
198
+ };
199
+ // Function parameters shadow names only in their own module. Keep graph
200
+ // cycle markers when following an import, but not lexical shadowing names.
201
+ const acrossModule = (seen: Set<string>) =>
202
+ new Set(
203
+ [...seen].filter(
204
+ (key) =>
205
+ key.startsWith("binding:") ||
206
+ key.startsWith("namespace:") ||
207
+ key.startsWith("export:"),
208
+ ),
209
+ );
210
+ const follows = (
211
+ expr: AstInspectNode | null,
212
+ seen: Set<string>,
213
+ context: Module,
214
+ ): boolean => {
215
+ if (!expr) return false;
216
+ if (expr.kind === "Identifier") {
217
+ const name = astName(expr);
218
+ if (!name || seen.has(name)) return false;
219
+ const key = `binding:${context.file}:${name}`;
220
+ if (seen.has(key)) return false;
221
+ const nextSeen = new Set([...seen, key]);
222
+ const local = context.bindings.get(name);
223
+ if (local) return follows(local, nextSeen, context);
224
+ const imported = context.named.get(name);
225
+ const target =
226
+ imported && exported(imported.target, imported.name, nextSeen);
227
+ return target
228
+ ? follows(target.expression, acrossModule(nextSeen), target.context)
229
+ : false;
230
+ }
231
+ if (expr.kind === "FunctionExpression") {
232
+ const nestedSeen = new Set(seen);
233
+ for (const param of astChildren(expr, "params"))
234
+ for (const name of collectPatternVars(astChild(param, "name")))
235
+ nestedSeen.add(name);
236
+ return follows(astChild(expr, "body"), nestedSeen, context);
237
+ }
238
+ if (expr.kind === "BlockStatement")
239
+ return follows(astChild(expr, "finalExpression"), seen, context);
240
+ if (expr.kind === "EffectBlockExpression" && astBool(expr, "unscoped")) {
241
+ const result = astChild(expr, "finalExpression");
242
+ return !!(
243
+ result &&
244
+ findResourceEscape(
245
+ expr,
246
+ result,
247
+ (source, localSeen) =>
248
+ follows(source, new Set([...seen, ...localSeen]), context),
249
+ () => true,
250
+ )
251
+ );
252
+ }
253
+ if (expr.kind === "CallExpression") {
254
+ const callee = astChild(expr, "callee");
255
+ const member = getMemberNames(callee);
256
+ const name = astName(callee);
257
+ if (
258
+ (member?.object &&
259
+ !seen.has(member.object) &&
260
+ context.imports.effect.has(member.object) &&
261
+ !!member.property &&
262
+ scopedEffectProviders.has(member.property)) ||
263
+ (callee?.kind === "Identifier" &&
264
+ name &&
265
+ !seen.has(name) &&
266
+ context.imports.acquire.has(name))
267
+ )
268
+ return true;
269
+ if (callee?.kind === "Identifier") return follows(callee, seen, context);
270
+ if (
271
+ member?.object &&
272
+ member.property &&
273
+ !seen.has(member.object) &&
274
+ !context.bindings.has(member.object)
275
+ ) {
276
+ const key = `namespace:${context.file}:${member.object}.${member.property}`;
277
+ if (seen.has(key)) return false;
278
+ const nextSeen = new Set([...seen, key]);
279
+ const namespace = context.namespaces.get(member.object);
280
+ const target =
281
+ namespace && exported(namespace, member.property, nextSeen);
282
+ if (target)
283
+ return follows(
284
+ target.expression,
285
+ acrossModule(nextSeen),
286
+ target.context,
287
+ );
288
+ }
289
+ }
290
+ return false;
291
+ };
292
+ return (expr, seen) => follows(expr, seen, root);
293
+ }
@@ -0,0 +1,3 @@
1
+ /** Default location and manifest shared by the type-view writer and readers. */
2
+ export const DEFAULT_TYPE_VIEW_DIR = ".funscript/types";
3
+ export const TYPE_VIEW_MANIFEST = ".funscript-type-view.json";
@@ -585,6 +585,7 @@ export class Emitter {
585
585
  > = [];
586
586
  private userEffectBindings = new Set<string>();
587
587
  public effectModuleBindings = new Set<string>();
588
+ private moduleNamespaceBindings = new Set<string>();
588
589
  private userEsToolkitBindings = new Set<string>();
589
590
  public userImportBindings = new Set<string>();
590
591
  private esToolkitImports = new Set<string>();
@@ -714,8 +715,10 @@ export class Emitter {
714
715
  for (const spec of item.specifiers) {
715
716
  if (!spec.isTypeOnly) this.userImportBindings.add(spec.local.name);
716
717
  }
717
- if (item.namespaceBinding)
718
+ if (item.namespaceBinding) {
718
719
  this.userImportBindings.add(item.namespaceBinding.name);
720
+ this.moduleNamespaceBindings.add(item.namespaceBinding.name);
721
+ }
719
722
  }
720
723
  }
721
724
  if (item.kind === "ImportDeclaration" && item.source.raw === '"effect"') {
@@ -2315,6 +2318,15 @@ export class Emitter {
2315
2318
  );
2316
2319
  }
2317
2320
 
2321
+ public isImportedNamespace(name: string): boolean {
2322
+ return (
2323
+ this.moduleNamespaceBindings.has(name) &&
2324
+ !this.bindings.has(name) &&
2325
+ !this.parameterScopes.some((scope) => scope.has(name)) &&
2326
+ !this.localBindingScopes.some((scope) => scope.has(name))
2327
+ );
2328
+ }
2329
+
2318
2330
  private emitBinaryExpression(expr: BinaryExpression): string {
2319
2331
  const emitOperand = (operand: Expression) => {
2320
2332
  const emitted = this.emitExpression(operand);
@@ -27,6 +27,7 @@ export interface StatementEmitterContext {
27
27
  emitMemberProperty(expr: MemberExpression): string;
28
28
  activeDraftParams: Set<string>;
29
29
  effectModuleBindings: Set<string>;
30
+ isImportedNamespace(name: string): boolean;
30
31
  isUserBinding(name: string): boolean;
31
32
  addEffectImport(name: string): void;
32
33
  }
@@ -139,6 +140,7 @@ export function emitEffectCall(
139
140
  if (
140
141
  EFFECT_BUILTIN_MODULES.has(obj.name) ||
141
142
  ctx.effectModuleBindings.has(obj.name) ||
143
+ ctx.isImportedNamespace(obj.name) ||
142
144
  obj.name === "Promise"
143
145
  ) {
144
146
  if (
@@ -198,6 +198,17 @@ export class CommentAttachments {
198
198
  }
199
199
  return false;
200
200
  }
201
+ if (kind === "ImportDeclaration" && node.span) {
202
+ const span = node.span as Span;
203
+ // Import formatting handles comments within the declaration itself.
204
+ // The end line is excluded so a trailing declaration comment is handled normally.
205
+ if (span.end.line > span.start.line) {
206
+ rawCodeRanges.push({
207
+ start: span.start.line,
208
+ end: span.end.line - 1,
209
+ });
210
+ }
211
+ }
201
212
  });
202
213
 
203
214
  for (const c of this.comments) {
@@ -275,6 +286,7 @@ export class CommentAttachments {
275
286
  entries?: AstInspectNode[];
276
287
  left?: AstInspectNode;
277
288
  right?: AstInspectNode;
289
+ consequent?: AstInspectNode;
278
290
  };
279
291
  switch (node.kind) {
280
292
  case "Program":
@@ -302,6 +314,8 @@ export class CommentAttachments {
302
314
  ...(n.statements ?? []),
303
315
  ...(n.finalExpression ? [n.finalExpression] : []),
304
316
  ];
317
+ case "WhenStatement":
318
+ return n.consequent ? [n.consequent] : [];
305
319
  case "EffectBlockExpression":
306
320
  return [
307
321
  ...((n.body as AstInspectNode[] | undefined) ?? []),
@@ -45,6 +45,7 @@ import { convertPipelineStyle } from "../tooling/pipeline-style.js";
45
45
  import { ASSOCIATIVITY, PRECEDENCE } from "./operator-precedence.js";
46
46
  import {
47
47
  CommentAttachments,
48
+ extractComments,
48
49
  type Comment,
49
50
  type AstInspectNode,
50
51
  } from "./comments.js";
@@ -254,11 +255,73 @@ export class Formatter {
254
255
  }
255
256
 
256
257
  private formatImportDeclaration(decl: ImportDeclaration): string {
258
+ const original = this.source.slice(
259
+ decl.span.start.offset,
260
+ decl.span.end.offset,
261
+ );
257
262
  const firstPart = decl.source.parts[0];
258
263
  const rawVal =
259
264
  firstPart && firstPart.kind === "StringRawPart" ? firstPart.value : "";
260
265
  const source = `"${this.escapeStringPart(rawVal)}"`;
261
- return renderImport(decl, source).slice(0, -1);
266
+ const rendered = renderImport(decl, source).slice(0, -1);
267
+ const comments = extractComments(original);
268
+ if (comments.length === 0) return rendered;
269
+
270
+ // Line comments need a multiline import so they stay next to their specifier.
271
+ const open = rendered.indexOf("{");
272
+ const close = rendered.indexOf("}", open);
273
+ if (open < 0 || close < 0) return original;
274
+ const lines = [rendered.slice(0, open + 1)];
275
+ const indent = this.spaces(this.indentSize);
276
+ let commentIndex = 0;
277
+ const position = (comment: Comment) => ({
278
+ line: comment.line + decl.span.start.line - 1,
279
+ column:
280
+ comment.line === 1
281
+ ? comment.col + decl.span.start.column - 1
282
+ : comment.col,
283
+ });
284
+ const before = (comment: Comment, line: number, column: number) => {
285
+ const pos = position(comment);
286
+ return pos.line < line || (pos.line === line && pos.column < column);
287
+ };
288
+ for (const specifier of decl.specifiers) {
289
+ while (
290
+ commentIndex < comments.length &&
291
+ before(
292
+ comments[commentIndex],
293
+ specifier.span.start.line,
294
+ specifier.span.start.column,
295
+ )
296
+ ) {
297
+ const comment = comments[commentIndex++];
298
+ if (
299
+ comment.isTrailing &&
300
+ position(comment).line === decl.span.start.line
301
+ ) {
302
+ lines[0] += ` ${comment.text}`;
303
+ } else {
304
+ lines.push(`${indent}${comment.text}`);
305
+ }
306
+ }
307
+ const name = specifier.imported.name;
308
+ const alias =
309
+ specifier.local.name === name ? "" : ` as ${specifier.local.name}`;
310
+ let line = `${indent}${specifier.isTypeOnly ? "type " : ""}${name}${alias},`;
311
+ if (
312
+ commentIndex < comments.length &&
313
+ comments[commentIndex].isTrailing &&
314
+ position(comments[commentIndex]).line === specifier.span.end.line
315
+ ) {
316
+ line += ` ${comments[commentIndex++].text}`;
317
+ }
318
+ lines.push(line);
319
+ }
320
+ while (commentIndex < comments.length) {
321
+ lines.push(`${indent}${comments[commentIndex++].text}`);
322
+ }
323
+ lines.push(rendered.slice(close));
324
+ return lines.join("\n");
262
325
  }
263
326
 
264
327
  private formatTypeParameters(
@@ -1312,7 +1375,12 @@ export class Formatter {
1312
1375
  expr.body,
1313
1376
  indent + this.indentSize,
1314
1377
  );
1315
- return body ? `${sig} {\n${body}\n${this.spaces(indent)}}` : `${sig} {}`;
1378
+ if (this.source.length === 0) {
1379
+ return body
1380
+ ? `${sig} {\n${body}\n${this.spaces(indent)}}`
1381
+ : `${sig} {}`;
1382
+ }
1383
+ return `${sig}\n${body}`;
1316
1384
  } else if (
1317
1385
  expr.body.kind === "PipelineExpression" &&
1318
1386
  this.shouldExpandPipeline(
@@ -8,6 +8,8 @@ import {
8
8
  TokenType,
9
9
  } from "./tokens.js";
10
10
 
11
+ const TAB_WIDTH = 4;
12
+
11
13
  export class LexerError extends FunScriptError {
12
14
  constructor(message: string, span: Span) {
13
15
  super(message, span);
@@ -27,9 +29,23 @@ export class Lexer {
27
29
  private parenLevel = 0;
28
30
  private bracketLevel = 0;
29
31
  private braceStack: (
30
- "record" | "block" | "interpolation" | "template_interpolation" | "jsx_expr"
32
+ | "record"
33
+ | "block"
34
+ | "import"
35
+ | "interpolation"
36
+ | "template_interpolation"
37
+ | "jsx_expr"
31
38
  )[] = [];
32
39
 
40
+ private isImportBrace(): boolean {
41
+ for (let i = this.tokens.length - 1; i >= 0; i--) {
42
+ const type = this.tokens[i].type;
43
+ if (type === TokenType.IMPORT) return true;
44
+ if (type === TokenType.NEWLINE || type === TokenType.LBRACE) return false;
45
+ }
46
+ return false;
47
+ }
48
+
33
49
  private isBlockBrace(): boolean {
34
50
  const lastToken = this.tokens[this.tokens.length - 1];
35
51
  if (!lastToken) return false;
@@ -119,12 +135,6 @@ export class Lexer {
119
135
 
120
136
  // Whitespace (inline)
121
137
  if (char === " " || char === "\t") {
122
- if (char === "\t") {
123
- throw new LexerError(
124
- "Tabs are not allowed for indentation or spacing; use 2 spaces",
125
- this.currentSpan(1),
126
- );
127
- }
128
138
  this.advance();
129
139
  continue;
130
140
  }
@@ -288,7 +298,13 @@ export class Lexer {
288
298
  this.emitToken(TokenType.RBRACKET, "]", 1);
289
299
  break;
290
300
  case "{":
291
- this.braceStack.push(this.isBlockBrace() ? "block" : "record");
301
+ this.braceStack.push(
302
+ this.isImportBrace()
303
+ ? "import"
304
+ : this.isBlockBrace()
305
+ ? "block"
306
+ : "record",
307
+ );
292
308
  this.emitToken(TokenType.LBRACE, "{", 1);
293
309
  break;
294
310
  case "}":
@@ -379,7 +395,11 @@ export class Lexer {
379
395
  }
380
396
 
381
397
  private handleIndentation(): void {
382
- if (this.bracketLevel > 0 || this.isInJsxChildrenOrTag()) {
398
+ if (
399
+ this.bracketLevel > 0 ||
400
+ this.braceStack[this.braceStack.length - 1] === "import" ||
401
+ this.isInJsxChildrenOrTag()
402
+ ) {
383
403
  this.atLineStart = false;
384
404
  return;
385
405
  }
@@ -393,10 +413,8 @@ export class Lexer {
393
413
  spaces++;
394
414
  this.advance();
395
415
  } else if (c === "\t") {
396
- throw new LexerError(
397
- "Tabs are not allowed for indentation; use 2 spaces",
398
- this.currentSpan(1),
399
- );
416
+ spaces += TAB_WIDTH - (spaces % TAB_WIDTH);
417
+ this.advance();
400
418
  } else {
401
419
  break;
402
420
  }
@@ -425,6 +443,12 @@ export class Lexer {
425
443
  span: { start: startPos, end: this.currentPosition() },
426
444
  });
427
445
  } else if (spaces < currentIndent) {
446
+ if (!this.indentStack.includes(spaces)) {
447
+ throw new LexerError(
448
+ `Indentation does not match an open block: found ${spaces} columns; expected one of ${this.indentStack.join(", ")}. Align this line with an existing block; tabs use 4-column stops.`,
449
+ { start: startPos, end: this.currentPosition() },
450
+ );
451
+ }
428
452
  while (
429
453
  this.indentStack.length > 1 &&
430
454
  this.indentStack[this.indentStack.length - 1] > spaces
@@ -436,12 +460,6 @@ export class Lexer {
436
460
  span: { start: startPos, end: this.currentPosition() },
437
461
  });
438
462
  }
439
- if (this.indentStack[this.indentStack.length - 1] !== spaces) {
440
- throw new LexerError(
441
- `Inconsistent indentation: unindent does not match any outer indentation level (expected ${this.indentStack.join(", ")}, got ${spaces})`,
442
- { start: startPos, end: this.currentPosition() },
443
- );
444
- }
445
463
  }
446
464
  }
447
465
 
@@ -978,7 +996,8 @@ export class Lexer {
978
996
  (raw === "type" &&
979
997
  lastToken?.type === TokenType.EXPORT &&
980
998
  /^[ \t]*\{/.test(this.source.slice(this.offset))) ||
981
- this.braceStack[this.braceStack.length - 1] === "record"
999
+ this.braceStack[this.braceStack.length - 1] === "record" ||
1000
+ this.braceStack[this.braceStack.length - 1] === "import"
982
1001
  ) {
983
1002
  this.tokens.push({
984
1003
  type: TokenType.IDENTIFIER,
@@ -64,10 +64,7 @@ parentPort?.on("message", (request: Request) => {
64
64
  for (const cache of caches.values()) {
65
65
  cache.compiledFiles.delete(filename);
66
66
  cache.sourceFiles.delete(
67
- filename.replace(
68
- /\.(fun|funx)$/,
69
- filename.endsWith(".funx") ? ".tsx" : ".ts",
70
- ),
67
+ filename + (filename.endsWith(".funx") ? ".tsx" : ".ts"),
71
68
  );
72
69
  }
73
70
  }
package/src/lsp/docs.ts CHANGED
@@ -119,11 +119,11 @@ export const DOC_MAP: Record<string, DocDef> = {
119
119
  ],
120
120
  export: [
121
121
  "keyword",
122
- "export declaration = ...\nexport schema Name = ...\nexport service Name ...\nexport default <expression>",
122
+ "export name = value\nexport schema Name = ...\nexport error Name(...)\nexport service Name ...\nexport default expression",
123
123
  "Exports a binding, schema, error, service, or default value from the module.",
124
124
  "Exposes module members to other files. Supports both named exports (`export name = value`) and default exports (`export default expr`).",
125
- 'export greet = (name: string) => "Hello, " + name\nexport schema User = { id: string, name: string }\nexport default App',
126
- ["import", "default"],
125
+ 'export greet = (name: String) => "Hello, {name}!"\nexport schema User = { id: String, name: String }\nexport error ValidationError(message: String)\nexport default greet',
126
+ ["import", "default", "error"],
127
127
  ],
128
128
  default: [
129
129
  "keyword",
@@ -772,6 +772,7 @@ export const DOC_MAP: Record<string, DocDef> = {
772
772
 
773
773
  /** Complete examples checked against the lexer and parser in tests/reference-docs.test.ts. */
774
774
  export const PARSED_DOC_EXAMPLES = [
775
+ "export",
775
776
  "effect",
776
777
  "and",
777
778
  "not",