@shd101wyy/yo 0.0.27 → 0.0.29

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 (46) hide show
  1. package/README.md +2 -1
  2. package/out/cjs/index.cjs +513 -513
  3. package/out/cjs/yo-cli.cjs +677 -552
  4. package/out/esm/index.mjs +478 -478
  5. package/out/types/src/build-runner.d.ts +22 -0
  6. package/out/types/src/cache.d.ts +3 -0
  7. package/out/types/src/codegen/codegen-c.d.ts +3 -0
  8. package/out/types/src/codegen/index.d.ts +4 -0
  9. package/out/types/src/codegen/utils/index.d.ts +3 -0
  10. package/out/types/src/evaluator/builtins/build.d.ts +135 -0
  11. package/out/types/src/expr.d.ts +17 -0
  12. package/out/types/src/fetch-command.d.ts +6 -0
  13. package/out/types/src/fetch.d.ts +10 -0
  14. package/out/types/src/init.d.ts +5 -0
  15. package/out/types/src/install-command.d.ts +6 -0
  16. package/out/types/src/lock-file.d.ts +16 -0
  17. package/out/types/src/module-manager.d.ts +3 -1
  18. package/out/types/src/pkg-config.d.ts +11 -0
  19. package/out/types/src/target.d.ts +28 -0
  20. package/out/types/src/tests/build-system.test.d.ts +1 -0
  21. package/out/types/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/std/build.yo +287 -0
  24. package/std/crypto/random.yo +2 -2
  25. package/std/fs/dir.yo +1 -1
  26. package/std/fs/temp.yo +1 -1
  27. package/std/os/env.yo +5 -5
  28. package/std/os/signal.yo +8 -8
  29. package/std/path.yo +2 -2
  30. package/std/process.yo +23 -43
  31. package/std/regex/compiler.yo +355 -0
  32. package/std/regex/flags.yo +104 -0
  33. package/std/regex/match.yo +83 -0
  34. package/std/regex/node.yo +283 -0
  35. package/std/regex/parser.yo +847 -0
  36. package/std/regex/regex.yo +714 -0
  37. package/std/regex/unicode.yo +365 -0
  38. package/std/regex/vm.yo +737 -0
  39. package/std/sys/clock.yo +1 -1
  40. package/std/sys/constants.yo +3 -3
  41. package/std/sys/mmap.yo +2 -2
  42. package/std/sys/signals.yo +4 -4
  43. package/std/sys/socket.yo +25 -25
  44. package/std/sys/sysinfo.yo +4 -4
  45. package/std/time/sleep.yo +18 -0
  46. package/std/time.yo +0 -13
package/std/sys/clock.yo CHANGED
@@ -11,7 +11,7 @@ CLOCK_REALTIME :: i32(0);
11
11
 
12
12
  // Monotonic time (non-decreasing; use for durations)
13
13
  CLOCK_MONOTONIC :: cond(
14
- (platform == Platform.Darwin) => i32(6),
14
+ (platform == Platform.Macos) => i32(6),
15
15
  true => i32(1)
16
16
  );
17
17
 
@@ -17,16 +17,16 @@
17
17
  // ============================================================================
18
18
 
19
19
  AT_FDCWD :: cond(
20
- (platform == Platform.Darwin) => i32(-2),
20
+ (platform == Platform.Macos) => i32(-2),
21
21
  true => i32(-100)
22
22
  );
23
23
  AT_REMOVEDIR :: cond(
24
- (platform == Platform.Darwin) => i32(0x80),
24
+ (platform == Platform.Macos) => i32(0x80),
25
25
  true => i32(0x200)
26
26
  );
27
27
  AT_EMPTY_PATH :: i32(0x1000);
28
28
  AT_SYMLINK_NOFOLLOW :: cond(
29
- (platform == Platform.Darwin) => i32(0x20),
29
+ (platform == Platform.Macos) => i32(0x20),
30
30
  true => i32(0x100)
31
31
  );
32
32
  AT_STATX_SYNC_AS_STAT :: i32(0x0000);
package/std/sys/mmap.yo CHANGED
@@ -28,7 +28,7 @@ PROT_EXEC :: i32(4);
28
28
  MAP_SHARED :: i32(1);
29
29
  MAP_PRIVATE :: i32(2);
30
30
  MAP_ANONYMOUS :: cond(
31
- (platform == Platform.Darwin) => i32(0x1000),
31
+ (platform == Platform.Macos) => i32(0x1000),
32
32
  true => i32(0x20)
33
33
  );
34
34
 
@@ -36,7 +36,7 @@ MAP_ANONYMOUS :: cond(
36
36
  MS_ASYNC :: i32(1);
37
37
  MS_INVALIDATE :: i32(2);
38
38
  MS_SYNC :: cond(
39
- (platform == Platform.Darwin) => i32(0x10),
39
+ (platform == Platform.Macos) => i32(0x10),
40
40
  true => i32(4)
41
41
  );
42
42
 
@@ -27,19 +27,19 @@ SIGTERM :: i32(15);
27
27
 
28
28
  // Platform-dependent signal numbers
29
29
  SIGCHLD :: cond(
30
- (platform == Platform.Darwin) => i32(20),
30
+ (platform == Platform.Macos) => i32(20),
31
31
  true => i32(17)
32
32
  );
33
33
  SIGCONT :: cond(
34
- (platform == Platform.Darwin) => i32(19),
34
+ (platform == Platform.Macos) => i32(19),
35
35
  true => i32(18)
36
36
  );
37
37
  SIGSTOP :: cond(
38
- (platform == Platform.Darwin) => i32(17),
38
+ (platform == Platform.Macos) => i32(17),
39
39
  true => i32(19)
40
40
  );
41
41
  SIGTSTP :: cond(
42
- (platform == Platform.Darwin) => i32(18),
42
+ (platform == Platform.Macos) => i32(18),
43
43
  true => i32(20)
44
44
  );
45
45
 
package/std/sys/socket.yo CHANGED
@@ -20,8 +20,8 @@ AF_UNIX :: i32(1);
20
20
  AF_LOCAL :: i32(1);
21
21
  AF_INET :: i32(2);
22
22
  AF_INET6 :: cond(
23
- (platform == Platform.Darwin) => i32(30),
24
- (platform == Platform.Win32) => i32(23),
23
+ (platform == Platform.Macos) => i32(30),
24
+ (platform == Platform.Windows) => i32(23),
25
25
  true => i32(10)
26
26
  );
27
27
 
@@ -39,7 +39,7 @@ SOCK_SEQPACKET :: i32(5);
39
39
  // ============================================================================
40
40
 
41
41
  SOL_SOCKET :: cond(
42
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0xFFFF),
42
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0xFFFF),
43
43
  true => i32(1)
44
44
  );
45
45
  IPPROTO_TCP :: i32(6);
@@ -52,48 +52,48 @@ IPPROTO_IPV6 :: i32(41);
52
52
  // ============================================================================
53
53
 
54
54
  SO_REUSEADDR :: cond(
55
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x0004),
55
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x0004),
56
56
  true => i32(2)
57
57
  );
58
58
  SO_KEEPALIVE :: cond(
59
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x0008),
59
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x0008),
60
60
  true => i32(9)
61
61
  );
62
62
  SO_BROADCAST :: cond(
63
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x0020),
63
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x0020),
64
64
  true => i32(6)
65
65
  );
66
66
  SO_RCVBUF :: cond(
67
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1002),
67
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1002),
68
68
  true => i32(8)
69
69
  );
70
70
  SO_SNDBUF :: cond(
71
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1001),
71
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1001),
72
72
  true => i32(7)
73
73
  );
74
74
  SO_RCVTIMEO :: cond(
75
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1006),
75
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1006),
76
76
  true => i32(20)
77
77
  );
78
78
  SO_SNDTIMEO :: cond(
79
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1005),
79
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1005),
80
80
  true => i32(21)
81
81
  );
82
82
  SO_ERROR :: cond(
83
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1007),
83
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1007),
84
84
  true => i32(4)
85
85
  );
86
86
  SO_TYPE :: cond(
87
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x1008),
87
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x1008),
88
88
  true => i32(3)
89
89
  );
90
90
  SO_LINGER :: cond(
91
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(0x0080),
91
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(0x0080),
92
92
  true => i32(13)
93
93
  );
94
94
  SO_REUSEPORT :: cond(
95
- (platform == Platform.Darwin) => i32(0x0200),
96
- (platform == Platform.Win32) => i32(0),
95
+ (platform == Platform.Macos) => i32(0x0200),
96
+ (platform == Platform.Windows) => i32(0),
97
97
  true => i32(15)
98
98
  );
99
99
 
@@ -103,18 +103,18 @@ SO_REUSEPORT :: cond(
103
103
 
104
104
  TCP_NODELAY :: i32(1);
105
105
  TCP_KEEPIDLE :: cond(
106
- (platform == Platform.Darwin) => i32(0x10),
107
- (platform == Platform.Win32) => i32(3),
106
+ (platform == Platform.Macos) => i32(0x10),
107
+ (platform == Platform.Windows) => i32(3),
108
108
  true => i32(4)
109
109
  );
110
110
  TCP_KEEPINTVL :: cond(
111
- (platform == Platform.Darwin) => i32(0x101),
112
- (platform == Platform.Win32) => i32(17),
111
+ (platform == Platform.Macos) => i32(0x101),
112
+ (platform == Platform.Windows) => i32(17),
113
113
  true => i32(5)
114
114
  );
115
115
  TCP_KEEPCNT :: cond(
116
- (platform == Platform.Darwin) => i32(0x102),
117
- (platform == Platform.Win32) => i32(16),
116
+ (platform == Platform.Macos) => i32(0x102),
117
+ (platform == Platform.Windows) => i32(16),
118
118
  true => i32(6)
119
119
  );
120
120
 
@@ -159,19 +159,19 @@ sockaddr_un_size :: (fn() -> usize)(
159
159
  // ============================================================================
160
160
 
161
161
  NI_NUMERICHOST :: cond(
162
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(2),
162
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(2),
163
163
  true => i32(1)
164
164
  );
165
165
  NI_NUMERICSERV :: cond(
166
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(8),
166
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(8),
167
167
  true => i32(2)
168
168
  );
169
169
  NI_NOFQDN :: cond(
170
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(1),
170
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(1),
171
171
  true => i32(4)
172
172
  );
173
173
  NI_NAMEREQD :: cond(
174
- ((platform == Platform.Darwin) || (platform == Platform.Win32)) => i32(4),
174
+ ((platform == Platform.Macos) || (platform == Platform.Windows)) => i32(4),
175
175
  true => i32(8)
176
176
  );
177
177
  NI_DGRAM :: i32(16);
@@ -14,14 +14,14 @@
14
14
  // macOS uses 256-byte fields (5 fields).
15
15
  // Windows emulation uses 256-byte fields (5 fields).
16
16
  UTSNAME_FIELD_SIZE :: cond(
17
- (platform == Platform.Darwin) => usize(256),
18
- (platform == Platform.Win32) => usize(256),
17
+ (platform == Platform.Macos) => usize(256),
18
+ (platform == Platform.Windows) => usize(256),
19
19
  true => usize(65)
20
20
  );
21
21
 
22
22
  UTSNAME_SIZE :: cond(
23
- (platform == Platform.Darwin) => usize(1280),
24
- (platform == Platform.Win32) => usize(1280),
23
+ (platform == Platform.Macos) => usize(1280),
24
+ (platform == Platform.Windows) => usize(1280),
25
25
  true => usize(390)
26
26
  );
27
27
 
@@ -0,0 +1,18 @@
1
+ // std/time/sleep.yo - Synchronous sleep
2
+ //
3
+ // Blocks the current thread for the given number of milliseconds.
4
+ // For async (non-blocking) sleep, use std/sys/timer.yo instead.
5
+ //
6
+ // Example:
7
+ // { sleep } :: import "std/time/sleep";
8
+ // sleep(usize(100)); // sleep 100ms
9
+
10
+ extern "Yo",
11
+ __yo_ms_sleep : (fn(ms: usize) -> unit)
12
+ ;
13
+
14
+ sleep :: __yo_ms_sleep;
15
+
16
+ export
17
+ sleep
18
+ ;
package/std/time.yo DELETED
@@ -1,13 +0,0 @@
1
- extern "Yo",
2
- __yo_ms_sleep : (fn(ms: usize) -> unit)
3
- ;
4
-
5
- Time :: impl {
6
- sleep :: __yo_ms_sleep;
7
-
8
- export sleep;
9
- };
10
-
11
- export
12
- Time
13
- ;