nomen-lang 0.5.0 → 0.6.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.
- package/core/System/Arena.nm +6 -6
- package/core/System/Buffer.nm +15 -6
- package/core/System/Channel.nm +2 -0
- package/core/System/ClassBuffer.nm +14 -5
- package/core/System/Controls/Button.nm +2 -2
- package/core/System/Controls/CheckBox.nm +2 -2
- package/core/System/Controls/Container.nm +3 -3
- package/core/System/Controls/TextBox.nm +2 -2
- package/core/System/Fiber.nm +85 -5
- package/core/System/Graph.nm +1 -1
- package/core/System/LinkedList.nm +1 -1
- package/core/System/List.nm +3 -3
- package/core/System/Map.nm +2 -2
- package/core/System/Mutex.nm +8 -8
- package/core/System/Option.nm +2 -2
- package/core/System/Random.nm +67 -0
- package/core/System/Result.nm +2 -2
- package/core/System/Set.nm +1 -1
- package/core/System/Spawnable.nm +18 -0
- package/core/System/Stream/File.nm +3 -3
- package/core/System/Stream/Http.nm +5 -5
- package/core/System/Stream/Tcp.nm +6 -6
- package/core/System/String.nm +7 -7
- package/core/System/StringBuilder.nm +116 -1
- package/core/System/Task.nm +42 -8
- package/core/System/Test.nm +20 -11
- package/core/System/Text/CharIndex.nm +8 -8
- package/core/System/Text/Chars.nm +1 -1
- package/core/System/Text/JsonTree.nm +1 -1
- package/core/System/Text/Regex.nm +176 -58
- package/core/System/Text/Utf8.nm +6 -6
- package/core/System/Thread.nm +118 -2
- package/core/System/Tree.nm +1 -1
- package/dist/index.mjs +1201 -1101
- package/package.json +1 -1
- package/src/test.ts +22 -4
package/package.json
CHANGED
package/src/test.ts
CHANGED
|
@@ -3,7 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
|
-
import build from "../../src/build.ts";
|
|
6
|
+
import build, { default_platform } from "../../src/build.ts";
|
|
7
7
|
import join from "../../src/join.ts";
|
|
8
8
|
import { get_library } from "../../src/lib.ts";
|
|
9
9
|
import parse from "../../src/parse.ts";
|
|
@@ -329,7 +329,12 @@ export function run_test_file(
|
|
|
329
329
|
audit_obj = path.join(buildDir, "audit_runtime.o");
|
|
330
330
|
execFileSync("clang", ["-c", runtime_src, "-o", audit_obj]);
|
|
331
331
|
}
|
|
332
|
-
const
|
|
332
|
+
const platform = default_platform();
|
|
333
|
+
// Match the run/build command's emission: ObjC-bearing sources (GUI code
|
|
334
|
+
// pulled in through the library graph) must land in a `.m` TU on Apple
|
|
335
|
+
// platforms — the ObjC framework headers are Objective-C, and including
|
|
336
|
+
// them from a plain `.c` TU fails with `@class NSString` syntax errors.
|
|
337
|
+
const ext = arch === "aarch64" ? ".s" : platform === "macos" || platform === "ios" ? ".m" : ".c";
|
|
333
338
|
const codefile = path.join(buildDir, path.basename(entry_path, ".nm") + ext);
|
|
334
339
|
const outfile = path.join(buildDir, path.basename(entry_path, ".nm"));
|
|
335
340
|
// The C backend's generated source does `#include "main.h"`, so write the
|
|
@@ -337,10 +342,23 @@ export function run_test_file(
|
|
|
337
342
|
fs.writeFileSync(path.join(buildDir, "main.h"), buildResult.headers ?? "");
|
|
338
343
|
fs.writeFileSync(codefile, buildResult.code);
|
|
339
344
|
|
|
340
|
-
// Link the harness binary.
|
|
341
|
-
//
|
|
345
|
+
// Link the harness binary. Frameworks are passed on Apple platforms for
|
|
346
|
+
// the same reason as the run/build command: the joined source may reference
|
|
347
|
+
// ObjC runtime symbols even when the test body doesn't, and unused
|
|
348
|
+
// frameworks cost nothing at link time.
|
|
342
349
|
const link_args = ["-o", outfile, codefile];
|
|
343
350
|
if (audit_obj) link_args.push(audit_obj);
|
|
351
|
+
if (platform === "macos" || platform === "ios") {
|
|
352
|
+
link_args.push(
|
|
353
|
+
"-framework",
|
|
354
|
+
"CoreGraphics",
|
|
355
|
+
"-framework",
|
|
356
|
+
"Foundation",
|
|
357
|
+
"-framework",
|
|
358
|
+
"AppKit",
|
|
359
|
+
"-lobjc",
|
|
360
|
+
);
|
|
361
|
+
}
|
|
344
362
|
try {
|
|
345
363
|
execFileSync("clang", link_args, {
|
|
346
364
|
encoding: "utf8",
|