nomen-lang 0.9.0 → 0.11.0
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 +9 -7
- package/core/System/Array.nm +1 -1
- package/core/System/Atomic.nm +3 -3
- package/core/System/BigInt.nm +182 -23
- package/core/System/Buffer.nm +37 -35
- package/core/System/ClassBuffer.nm +18 -18
- package/core/System/Controls/Alert.nm +1 -1
- package/core/System/Controls/App.nm +5 -5
- package/core/System/Controls/Button.nm +1 -1
- package/core/System/Controls/CheckBox.nm +1 -1
- package/core/System/Controls/ColorPicker.nm +1 -1
- package/core/System/Controls/ComboBox.nm +1 -1
- package/core/System/Controls/Container.nm +34 -34
- package/core/System/Controls/DatePicker.nm +1 -1
- package/core/System/Controls/Form.nm +2 -2
- package/core/System/Controls/GroupBox.nm +1 -1
- package/core/System/Controls/ImageView.nm +1 -1
- package/core/System/Controls/Layout.nm +5 -5
- package/core/System/Controls/LevelIndicator.nm +1 -1
- package/core/System/Controls/ListView.nm +1 -1
- package/core/System/Controls/Menu.nm +1 -1
- package/core/System/Controls/NumberInput.nm +3 -3
- package/core/System/Controls/OtpInput.nm +2 -2
- package/core/System/Controls/OutlineView.nm +1 -1
- package/core/System/Controls/Pagination.nm +6 -6
- package/core/System/Controls/Popover.nm +1 -1
- package/core/System/Controls/Progress.nm +1 -1
- package/core/System/Controls/Radio.nm +1 -1
- package/core/System/Controls/Scrollable.nm +1 -1
- package/core/System/Controls/SearchField.nm +1 -1
- package/core/System/Controls/SecureField.nm +1 -1
- package/core/System/Controls/Segmented.nm +1 -1
- package/core/System/Controls/Select.nm +1 -1
- package/core/System/Controls/Separator.nm +1 -1
- package/core/System/Controls/Sheet.nm +1 -1
- package/core/System/Controls/Slider.nm +1 -1
- package/core/System/Controls/Spinner.nm +3 -3
- package/core/System/Controls/SplitView.nm +2 -2
- package/core/System/Controls/Stepper.nm +1 -1
- package/core/System/Controls/Switch.nm +1 -1
- package/core/System/Controls/Table.nm +1 -1
- package/core/System/Controls/Tabs.nm +1 -1
- package/core/System/Controls/Text.nm +1 -1
- package/core/System/Controls/TextBox.nm +1 -1
- package/core/System/Controls/TextView.nm +1 -1
- package/core/System/Controls/Toggle.nm +1 -1
- package/core/System/Controls/Toolbar.nm +1 -1
- package/core/System/Controls/Window.nm +11 -3
- package/core/System/Fiber.nm +16 -3
- package/core/System/Format.nm +751 -0
- package/core/System/Graph.nm +2 -2
- package/core/System/LinkedList.nm +8 -6
- package/core/System/List.nm +16 -13
- package/core/System/Map.nm +11 -9
- package/core/System/Random.nm +3 -3
- package/core/System/Set.nm +9 -7
- package/core/System/StableList.nm +7 -7
- package/core/System/Stream/File.nm +16 -16
- package/core/System/Stream/Http.nm +3 -3
- package/core/System/Stream/Tcp.nm +5 -5
- package/core/System/StringBuilder.nm +16 -16
- package/core/System/Task.nm +56 -64
- package/core/System/Test.nm +18 -18
- package/core/System/Text/Chars.nm +1 -1
- package/core/System/Text/Json.nm +12 -12
- package/core/System/Text/JsonTree.nm +8 -8
- package/core/System/Text/Regex.nm +20 -20
- package/core/System/Thread.nm +26 -3
- package/core/System/Tree.nm +19 -3
- package/dist/index.mjs +3423 -1849
- package/package.json +1 -1
- package/src/docs.ts +10 -1
|
@@ -92,7 +92,7 @@ pub mv struct Spinner: Control {
|
|
|
92
92
|
```
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
95
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
96
96
|
```
|
|
97
97
|
#arch: c
|
|
98
98
|
#platform: macos
|
|
@@ -123,7 +123,7 @@ pub mv struct Spinner: Control {
|
|
|
123
123
|
```
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
pub func start = (ref self) {
|
|
126
|
+
pub func start = (ref self {}) {
|
|
127
127
|
```
|
|
128
128
|
#arch: c
|
|
129
129
|
#platform: macos
|
|
@@ -154,7 +154,7 @@ pub mv struct Spinner: Control {
|
|
|
154
154
|
```
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
pub func stop = (ref self) {
|
|
157
|
+
pub func stop = (ref self {}) {
|
|
158
158
|
```
|
|
159
159
|
#arch: c
|
|
160
160
|
#platform: macos
|
|
@@ -334,7 +334,7 @@ pub mv struct SplitView: Control {
|
|
|
334
334
|
|
|
335
335
|
// Move divider `index`. For a vertical split the position is the left
|
|
336
336
|
// edge of the pane after the divider, in points from the left.
|
|
337
|
-
pub func set_position = (ref self, float position, int divider) {
|
|
337
|
+
pub func set_position = (ref self {}, float position, int divider) {
|
|
338
338
|
```
|
|
339
339
|
#arch: c
|
|
340
340
|
#platform: macos
|
|
@@ -424,7 +424,7 @@ pub mv struct SplitView: Control {
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
// ── Control trait conformance ──
|
|
427
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
427
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
428
428
|
```
|
|
429
429
|
#arch: c
|
|
430
430
|
#platform: macos
|
|
@@ -744,7 +744,7 @@ pub mv struct Table: Control {
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
// ── Control trait conformance ──
|
|
747
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
747
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
748
748
|
```
|
|
749
749
|
#arch: c
|
|
750
750
|
#platform: macos
|
|
@@ -415,7 +415,7 @@ pub mv struct Tabs: Control {
|
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// ── Control trait conformance ──
|
|
418
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
418
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
419
419
|
```
|
|
420
420
|
#arch: c
|
|
421
421
|
#platform: macos
|
|
@@ -456,7 +456,7 @@ pub mv struct Toolbar: Control {
|
|
|
456
456
|
// ── Control trait conformance ──
|
|
457
457
|
// A toolbar is window chrome: the layout engine never frames it (AppKit
|
|
458
458
|
// owns the layout rect and shrinks the contentView itself).
|
|
459
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
459
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
460
460
|
// No-op: the NSWindow carries the toolbar's geometry.
|
|
461
461
|
}
|
|
462
462
|
|
|
@@ -1190,7 +1190,7 @@ pub mv struct Window: Control {
|
|
|
1190
1190
|
// frame where the content rect changed. The grid must outlive the run
|
|
1191
1191
|
// (an app field — registration stores its address). Call from
|
|
1192
1192
|
// App.start; also arms the resize delegate's target pair.
|
|
1193
|
-
pub func set_content = (ref self, ref Container grid) {
|
|
1193
|
+
pub func set_content = (ref self {}, ref Container grid { aligns, cols, dirty, dirty_idx, gaps, grows, h_kinds, h_vals, handles, kinds, measured_count, mh, mw, pads, pars, prh, prw, prx, pry, rh, rw, rx, ry, shrinks, spans, w_kinds, w_vals }) {
|
|
1194
1194
|
```
|
|
1195
1195
|
#arch: c
|
|
1196
1196
|
#platform: macos
|
|
@@ -1307,6 +1307,12 @@ pub mv struct Window: Control {
|
|
|
1307
1307
|
// FORCED: it bypasses the close_requested interception (the delegate's
|
|
1308
1308
|
// windowShouldClose: sees nomen_close_forced and allows). Only the red
|
|
1309
1309
|
// button routes through `close_requested`.
|
|
1310
|
+
//
|
|
1311
|
+
// The forced latch is one-shot: it is armed immediately before
|
|
1312
|
+
// performClose: (which dispatches windowShouldClose: synchronously) and
|
|
1313
|
+
// disarmed right after. Left armed it is process-global — every LATER
|
|
1314
|
+
// red-button close (another window, a later run loop) would silently
|
|
1315
|
+
// bypass App.close_requested forever.
|
|
1310
1316
|
pub func close = (self) {
|
|
1311
1317
|
```
|
|
1312
1318
|
#arch: c
|
|
@@ -1314,6 +1320,7 @@ pub mv struct Window: Control {
|
|
|
1314
1320
|
extern int nomen_close_forced;
|
|
1315
1321
|
nomen_close_forced = 1;
|
|
1316
1322
|
((void(*)(id, SEL, id))objc_msgSend)((id)self->handle, sel_registerName("performClose:"), (id)0);
|
|
1323
|
+
nomen_close_forced = 0;
|
|
1317
1324
|
```
|
|
1318
1325
|
```
|
|
1319
1326
|
#arch: aarch64_use_c
|
|
@@ -1321,6 +1328,7 @@ pub mv struct Window: Control {
|
|
|
1321
1328
|
extern int nomen_close_forced;
|
|
1322
1329
|
nomen_close_forced = 1;
|
|
1323
1330
|
((void(*)(id, SEL, id))objc_msgSend)((id)self->handle, sel_registerName("performClose:"), (id)0);
|
|
1331
|
+
nomen_close_forced = 0;
|
|
1324
1332
|
```
|
|
1325
1333
|
```
|
|
1326
1334
|
#arch: c
|
|
@@ -1345,7 +1353,7 @@ pub mv struct Window: Control {
|
|
|
1345
1353
|
// a FrameEvents each frame.
|
|
1346
1354
|
// The app is consumed: it is destroyed when the loop exits (controls
|
|
1347
1355
|
// release, buffers free).
|
|
1348
|
-
pub func run = (ref self, mv App app) {
|
|
1356
|
+
pub func run = (ref self {}, mv App app) {
|
|
1349
1357
|
app.start(ref self)
|
|
1350
1358
|
Container.arm_resize_delegate(self)
|
|
1351
1359
|
self.arm_mouse_moves()
|
|
@@ -1432,7 +1440,7 @@ pub mv struct Window: Control {
|
|
|
1432
1440
|
return s
|
|
1433
1441
|
}
|
|
1434
1442
|
|
|
1435
|
-
pub func set_frame = (ref self, int x, int y, int width, int height) {
|
|
1443
|
+
pub func set_frame = (ref self {}, int x, int y, int width, int height) {
|
|
1436
1444
|
```
|
|
1437
1445
|
#arch: c
|
|
1438
1446
|
#platform: macos
|
package/core/System/Fiber.nm
CHANGED
|
@@ -71,9 +71,13 @@ pub mv struct Fiber<T> : Spawnable<T> {
|
|
|
71
71
|
// out of the instance (started; #destroy no-ops), return the handle.
|
|
72
72
|
// While the fiber waits, it parks and frees its worker instead of
|
|
73
73
|
// blocking it.
|
|
74
|
-
pub func start = (ref self, mv out Task<T>) {
|
|
74
|
+
pub func start = (ref self {}, mv out Task<T>) {
|
|
75
75
|
```
|
|
76
76
|
#arch: c
|
|
77
|
+
// Single-launch contract: a consumed construction (started) owns
|
|
78
|
+
// nothing — the handles below are zeroed, and writing the ref count
|
|
79
|
+
// through the null future would fault. Abort with the reason.
|
|
80
|
+
if (self->started) __nomen_spawn_double_start_abort();
|
|
77
81
|
struct nomen_future *_f = (struct nomen_future *)self->future;
|
|
78
82
|
_f->refs = self->nursery_futures ? 3 : 2;
|
|
79
83
|
__nomen_fiber_spawn((struct nomen_closure *)self->task, _f);
|
|
@@ -83,7 +87,12 @@ pub mv struct Fiber<T> : Spawnable<T> {
|
|
|
83
87
|
```
|
|
84
88
|
```
|
|
85
89
|
#arch: aarch64
|
|
86
|
-
// x19 = self. f = self->future (#32); nursery_futures
|
|
90
|
+
// x19 = self. started at #40; f = self->future (#32); nursery_futures
|
|
91
|
+
// at #48. Single-launch contract first: a consumed construction has
|
|
92
|
+
// zeroed handles, and the ref-store below would write through null.
|
|
93
|
+
ldrb w9, [x19, #40]
|
|
94
|
+
cbnz w9, .Lnomen_fstart_double
|
|
95
|
+
// f = self->future (#32); nursery_futures at #48.
|
|
87
96
|
ldr x0, [x19, #32]
|
|
88
97
|
ldr x1, [x19, #48]
|
|
89
98
|
mov w2, #2
|
|
@@ -103,6 +112,10 @@ pub mv struct Fiber<T> : Spawnable<T> {
|
|
|
103
112
|
ldr x3, [x19, #32]
|
|
104
113
|
bl ___nomen_nursery_track
|
|
105
114
|
.Lnomen_fstart_notrack:
|
|
115
|
+
b .Lnomen_fstart_done
|
|
116
|
+
.Lnomen_fstart_double:
|
|
117
|
+
bl ___nomen_spawn_double_start_abort
|
|
118
|
+
.Lnomen_fstart_done:
|
|
106
119
|
```
|
|
107
120
|
var t = Task<T>()
|
|
108
121
|
t.result_slot = self.result_slot
|
|
@@ -122,7 +135,7 @@ pub mv struct Fiber<T> : Spawnable<T> {
|
|
|
122
135
|
// The fiber is launched exactly like start, but the handle is dropped
|
|
123
136
|
// immediately: the future's refs are released as the discarded Task is
|
|
124
137
|
// reclaimed, and the fiber completes into the void — nothing joins it.
|
|
125
|
-
pub func detach = (ref self) {
|
|
138
|
+
pub func detach = (ref self {}) {
|
|
126
139
|
self.start()
|
|
127
140
|
}
|
|
128
141
|
|