@scriptc/compiler 0.0.1 → 0.0.3

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 (42) hide show
  1. package/dist/backend/emission/emit-exprs.js +2 -0
  2. package/dist/backend/emission/emit-exprs.js.map +1 -1
  3. package/dist/backend/llvm/emitter.js +19 -4
  4. package/dist/backend/llvm/emitter.js.map +1 -1
  5. package/dist/coverage/report.d.ts +1 -0
  6. package/dist/coverage/report.js +12 -0
  7. package/dist/coverage/report.js.map +1 -1
  8. package/dist/coverage/surface-manifest.d.ts +22 -0
  9. package/dist/coverage/surface-manifest.js +295 -0
  10. package/dist/coverage/surface-manifest.js.map +1 -0
  11. package/dist/diagnostics/diagnostic.d.ts +16 -0
  12. package/dist/diagnostics/diagnostic.js +24 -0
  13. package/dist/diagnostics/diagnostic.js.map +1 -1
  14. package/dist/frontend/lowering/lower-calls.js +10 -5
  15. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  16. package/dist/frontend/lowering/lower-containers.d.ts +3 -0
  17. package/dist/frontend/lowering/lower-containers.js +64 -0
  18. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  19. package/dist/frontend/lowering/lower-exprs.js +14 -2
  20. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  21. package/dist/frontend/lowering/lower-inspect.js +8 -3
  22. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  23. package/dist/frontend/lowering/lower-modules.js +3 -3
  24. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  25. package/dist/frontend/lowering/lower-stmts.js +2 -2
  26. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  27. package/dist/frontend/lowering/lowerer.js +4 -3
  28. package/dist/frontend/lowering/lowerer.js.map +1 -1
  29. package/dist/frontend/program.js +104 -21
  30. package/dist/frontend/program.js.map +1 -1
  31. package/dist/frontend/shared.d.ts +7 -0
  32. package/dist/frontend/shared.js +9 -0
  33. package/dist/frontend/shared.js.map +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.js +12 -6
  36. package/dist/index.js.map +1 -1
  37. package/dist/ir/nodes.d.ts +1 -1
  38. package/dist/ir/nodes.js.map +1 -1
  39. package/dist/ir/validate.js +1 -0
  40. package/dist/ir/validate.js.map +1 -1
  41. package/package.json +6 -4
  42. package/surface-manifest.json +2052 -0
@@ -12,6 +12,7 @@
12
12
  * - Lexical scoping is resolved here: locals get function-unique ids
13
13
  * ("x.0", "x.1" for shadowing); the IR is scope-flat.
14
14
  */
15
+ import { isRelativeSpecifier } from "../shared.js";
15
16
  import * as ts from "../ts7/adapter.js";
16
17
  import { anyOpRequiresDynamicDiag, blockedBindingUseDiag, checkerPanicDiag, isCheckerPanic, genericSignatureTypeDiag, indexSignatureTypeDiag, noLoweringDiag, recordShapeMismatchDiag, requiresDynamicApiDiag, requiresDynamicPackageDiag, requiresDynamicTypeDiag, unionMismatchDiag, unsupportedDiag, unsupportedTypeDiag, } from "../../diagnostics/diagnostic.js";
17
18
  import { arrayOf, BOOL, canAdaptDynFuncTo, canConvertToDyn, canCrossIslandBoundary, canExitIslandToType, canMarshalTypedFuncIntoIsland, DYN, F64, isJsonSafeType, isUndefinedArmedUnion, isUnitType, JSVAL, RUNTIME_ERROR_CLASSES, STRING, typeEquals, UNDEFINED_T, VOID } from "../../ir/nodes.js";
@@ -1017,7 +1018,7 @@ export class Lowerer {
1017
1018
  return null;
1018
1019
  }
1019
1020
  const spec = importDecl.moduleSpecifier.text;
1020
- if (!spec.startsWith("./") && !spec.startsWith("../"))
1021
+ if (!isRelativeSpecifier(spec))
1021
1022
  return null;
1022
1023
  const dep = resolveImport(this.program, importDecl.getSourceFile(), spec);
1023
1024
  if (!dep || !isJsSourceFile(dep) || isNodeEsmFile(dep))
@@ -1049,7 +1050,7 @@ export class Lowerer {
1049
1050
  return false;
1050
1051
  }
1051
1052
  const spec = requireSpecOf(decl.initializer);
1052
- if (spec === null || !(spec.startsWith("./") || spec.startsWith("../")))
1053
+ if (spec === null || !isRelativeSpecifier(spec))
1053
1054
  return false;
1054
1055
  }
1055
1056
  // SINGLE-VALUE exporters (`module.exports = Countdown` / `= double` /
@@ -1153,7 +1154,7 @@ export class Lowerer {
1153
1154
  * specifier is not a relative program module (builtins load nothing;
1154
1155
  * anything else kept its preflight fence). */
1155
1156
  requireInitStmt(spec, node) {
1156
- if (!spec.startsWith("./") && !spec.startsWith("../"))
1157
+ if (!isRelativeSpecifier(spec))
1157
1158
  return null;
1158
1159
  const dep = resolveImport(this.program, node.getSourceFile(), spec);
1159
1160
  if (!dep || dep.fileName.endsWith(".json"))