@shd101wyy/yo 0.1.26 → 0.1.28

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 (174) hide show
  1. package/.github/skills/yo-async-effects/SKILL.md +4 -4
  2. package/.github/skills/yo-async-effects/async-effects-recipes.md +34 -34
  3. package/.github/skills/yo-core-patterns/SKILL.md +1 -1
  4. package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +29 -26
  5. package/.github/skills/yo-project-workflow/SKILL.md +6 -3
  6. package/.github/skills/yo-project-workflow/workflow-cheatsheet.md +36 -11
  7. package/.github/skills/yo-syntax/SKILL.md +7 -6
  8. package/.github/skills/yo-syntax/syntax-cheatsheet.md +225 -64
  9. package/.github/skills/yo-wasm-integration/wasm-integration-cheatsheet.md +3 -3
  10. package/README.md +10 -8
  11. package/out/cjs/index.cjs +553 -535
  12. package/out/cjs/yo-cli.cjs +685 -651
  13. package/out/cjs/yo-lsp.cjs +596 -569
  14. package/out/esm/index.mjs +396 -378
  15. package/out/types/src/env.d.ts +1 -0
  16. package/out/types/src/evaluator/calls/helper.d.ts +4 -2
  17. package/out/types/src/evaluator/types/synthesizer.d.ts +1 -0
  18. package/out/types/src/formatter.d.ts +11 -0
  19. package/out/types/src/lsp/formatting.d.ts +2 -0
  20. package/out/types/src/test-runner.d.ts +2 -0
  21. package/out/types/src/tests/formatter.test.d.ts +1 -0
  22. package/out/types/tsconfig.tsbuildinfo +1 -1
  23. package/package.json +1 -1
  24. package/scripts/probe-parser-parity.ts +61 -0
  25. package/scripts/probe-yo-self-parser.sh +33 -0
  26. package/scripts/validate-yo-self-fmt.ts +184 -0
  27. package/std/alg/hash.yo +13 -21
  28. package/std/allocator.yo +25 -40
  29. package/std/async.yo +3 -7
  30. package/std/build.yo +105 -151
  31. package/std/cli/arg_parser.yo +184 -169
  32. package/std/collections/array_list.yo +350 -314
  33. package/std/collections/btree_map.yo +142 -131
  34. package/std/collections/deque.yo +132 -128
  35. package/std/collections/hash_map.yo +542 -566
  36. package/std/collections/hash_set.yo +623 -687
  37. package/std/collections/linked_list.yo +275 -293
  38. package/std/collections/ordered_map.yo +113 -85
  39. package/std/collections/priority_queue.yo +73 -73
  40. package/std/crypto/md5.yo +191 -95
  41. package/std/crypto/random.yo +56 -64
  42. package/std/crypto/sha256.yo +151 -107
  43. package/std/encoding/base64.yo +87 -81
  44. package/std/encoding/hex.yo +43 -50
  45. package/std/encoding/html.yo +56 -81
  46. package/std/encoding/html_char_utils.yo +7 -13
  47. package/std/encoding/html_entities.yo +2248 -2253
  48. package/std/encoding/json.yo +316 -224
  49. package/std/encoding/punycode.yo +86 -116
  50. package/std/encoding/toml.yo +67 -66
  51. package/std/encoding/utf16.yo +37 -44
  52. package/std/env.yo +62 -91
  53. package/std/error.yo +7 -15
  54. package/std/fmt/display.yo +5 -9
  55. package/std/fmt/index.yo +8 -14
  56. package/std/fmt/to_string.yo +330 -315
  57. package/std/fmt/writer.yo +58 -87
  58. package/std/fs/dir.yo +83 -102
  59. package/std/fs/file.yo +147 -180
  60. package/std/fs/metadata.yo +45 -78
  61. package/std/fs/temp.yo +55 -65
  62. package/std/fs/types.yo +27 -40
  63. package/std/fs/walker.yo +53 -68
  64. package/std/gc.yo +5 -8
  65. package/std/glob.yo +30 -43
  66. package/std/http/client.yo +107 -120
  67. package/std/http/http.yo +106 -96
  68. package/std/http/index.yo +4 -6
  69. package/std/imm/list.yo +88 -93
  70. package/std/imm/map.yo +528 -464
  71. package/std/imm/set.yo +52 -57
  72. package/std/imm/sorted_map.yo +340 -286
  73. package/std/imm/sorted_set.yo +57 -63
  74. package/std/imm/string.yo +404 -345
  75. package/std/imm/vec.yo +173 -181
  76. package/std/io/reader.yo +3 -6
  77. package/std/io/writer.yo +4 -8
  78. package/std/libc/assert.yo +5 -9
  79. package/std/libc/ctype.yo +32 -22
  80. package/std/libc/dirent.yo +26 -25
  81. package/std/libc/errno.yo +164 -90
  82. package/std/libc/fcntl.yo +52 -45
  83. package/std/libc/float.yo +66 -44
  84. package/std/libc/limits.yo +42 -33
  85. package/std/libc/math.yo +53 -82
  86. package/std/libc/signal.yo +72 -47
  87. package/std/libc/stdatomic.yo +217 -188
  88. package/std/libc/stdint.yo +5 -29
  89. package/std/libc/stdio.yo +5 -29
  90. package/std/libc/stdlib.yo +32 -39
  91. package/std/libc/string.yo +5 -23
  92. package/std/libc/sys/stat.yo +58 -56
  93. package/std/libc/time.yo +5 -19
  94. package/std/libc/unistd.yo +5 -20
  95. package/std/libc/wctype.yo +6 -9
  96. package/std/libc/windows.yo +26 -30
  97. package/std/log.yo +41 -55
  98. package/std/net/addr.yo +102 -97
  99. package/std/net/dns.yo +27 -28
  100. package/std/net/errors.yo +50 -49
  101. package/std/net/tcp.yo +113 -124
  102. package/std/net/udp.yo +55 -66
  103. package/std/os/env.yo +35 -33
  104. package/std/os/signal.yo +15 -25
  105. package/std/path.yo +276 -311
  106. package/std/prelude.yo +6304 -4315
  107. package/std/process/command.yo +87 -103
  108. package/std/process/index.yo +12 -31
  109. package/std/regex/compiler.yo +196 -95
  110. package/std/regex/flags.yo +58 -39
  111. package/std/regex/index.yo +157 -173
  112. package/std/regex/match.yo +20 -31
  113. package/std/regex/node.yo +134 -152
  114. package/std/regex/parser.yo +283 -259
  115. package/std/regex/unicode.yo +172 -202
  116. package/std/regex/vm.yo +155 -171
  117. package/std/string/index.yo +5 -7
  118. package/std/string/rune.yo +45 -55
  119. package/std/string/string.yo +937 -964
  120. package/std/string/string_builder.yo +94 -104
  121. package/std/string/unicode.yo +46 -64
  122. package/std/sync/channel.yo +72 -73
  123. package/std/sync/cond.yo +31 -36
  124. package/std/sync/mutex.yo +30 -32
  125. package/std/sync/once.yo +13 -16
  126. package/std/sync/rwlock.yo +26 -31
  127. package/std/sync/waitgroup.yo +20 -25
  128. package/std/sys/advise.yo +16 -24
  129. package/std/sys/bufio/buf_reader.yo +77 -93
  130. package/std/sys/bufio/buf_writer.yo +52 -65
  131. package/std/sys/clock.yo +4 -9
  132. package/std/sys/constants.yo +77 -61
  133. package/std/sys/copy.yo +4 -10
  134. package/std/sys/dir.yo +26 -43
  135. package/std/sys/dns.yo +41 -61
  136. package/std/sys/errors.yo +95 -103
  137. package/std/sys/events.yo +45 -57
  138. package/std/sys/externs.yo +319 -267
  139. package/std/sys/fallocate.yo +7 -11
  140. package/std/sys/fcntl.yo +14 -22
  141. package/std/sys/file.yo +26 -40
  142. package/std/sys/future.yo +5 -8
  143. package/std/sys/iov.yo +12 -25
  144. package/std/sys/lock.yo +12 -13
  145. package/std/sys/mmap.yo +38 -43
  146. package/std/sys/path.yo +3 -8
  147. package/std/sys/perm.yo +7 -21
  148. package/std/sys/pipe.yo +5 -12
  149. package/std/sys/process.yo +23 -29
  150. package/std/sys/seek.yo +10 -12
  151. package/std/sys/signal.yo +7 -13
  152. package/std/sys/signals.yo +52 -35
  153. package/std/sys/socket.yo +63 -58
  154. package/std/sys/socketpair.yo +3 -6
  155. package/std/sys/sockinfo.yo +11 -20
  156. package/std/sys/statfs.yo +11 -34
  157. package/std/sys/statx.yo +25 -52
  158. package/std/sys/sysinfo.yo +15 -20
  159. package/std/sys/tcp.yo +62 -92
  160. package/std/sys/temp.yo +5 -9
  161. package/std/sys/time.yo +5 -15
  162. package/std/sys/timer.yo +6 -11
  163. package/std/sys/tty.yo +10 -18
  164. package/std/sys/udp.yo +22 -39
  165. package/std/sys/umask.yo +3 -6
  166. package/std/sys/unix.yo +33 -52
  167. package/std/testing/bench.yo +49 -52
  168. package/std/thread.yo +10 -15
  169. package/std/time/datetime.yo +105 -89
  170. package/std/time/duration.yo +43 -56
  171. package/std/time/instant.yo +13 -18
  172. package/std/time/sleep.yo +5 -9
  173. package/std/url/index.yo +184 -209
  174. package/std/worker.yo +6 -10
@@ -1,11 +1,9 @@
1
1
  //! String and Unicode types.
2
-
3
- _rune :: import "./rune.yo";
4
- _string :: import "./string.yo";
5
- _string_builder :: import "./string_builder.yo";
6
-
7
- export
2
+ _rune :: import("./rune.yo");
3
+ _string :: import("./string.yo");
4
+ _string_builder :: import("./string_builder.yo");
5
+ export(
8
6
  ...(_rune),
9
7
  ...(_string),
10
8
  ...(_string_builder)
11
- ;
9
+ );
@@ -1,83 +1,73 @@
1
1
  //! Unicode code point type (`rune`) for representing individual characters.
2
-
3
2
  /// Unicode code point (U+0000 to U+10FFFF, excluding surrogates).
4
3
  /// Similar to Go's `rune` or Rust's `char`.
5
4
  rune :: newtype(
6
5
  /// The raw Unicode code point value.
7
6
  char : u32
8
7
  );
9
- impl(rune,
8
+ impl(
9
+ rune,
10
10
  /// Create a rune from a `u32` value, returning `None` if the value is not a valid Unicode code point.
11
- from_u32 : (fn(value: u32) -> Option(Self))(
11
+ from_u32 : (fn(value : u32) -> Option(Self))(
12
12
  cond(
13
- ((value <= u32(0x10FFFF)) && (((value < 0xD800) || (value > 0xDFFF)))) => .Some(Self(value)),
14
- true => .None
13
+ ((value <= u32(0x10FFFF)) && ((value < 0xD800) || (value > 0xDFFF))) =>.Some(Self(value)),
14
+ true =>.None
15
15
  )
16
16
  ),
17
-
18
17
  /// Return the raw `u32` code point value.
19
- to_u32 : (fn(self: Self) -> u32)(
18
+ to_u32 : (fn(self : Self) -> u32)(
20
19
  self.char
21
20
  ),
22
-
23
21
  /// Check if this is an ASCII character (U+0000 to U+007F).
24
- is_ascii : (fn(self: Self) -> bool)(
25
- (self.char <= 0x7F)
22
+ is_ascii : (fn(self : Self) -> bool)(
23
+ self.char <= 0x7F
26
24
  ),
27
-
28
25
  /// Check if this is a whitespace character (space, tab, newline, or carriage return).
29
- is_whitespace : (fn(self: Self) -> bool)(
30
- (((self.char == 0x20) || (self.char == 0x09)) || ((self.char == 0x0A) || (self.char == 0x0D)))
26
+ is_whitespace : (fn(self : Self) -> bool)(
27
+ ((self.char == 0x20) || (self.char == 0x09)) || ((self.char == 0x0A) || (self.char == 0x0D))
31
28
  ),
32
-
33
29
  /// Check if this is an ASCII digit ('0' to '9').
34
- is_digit : (fn(self: Self) -> bool)(
35
- ((self.char >= 0x30) && (self.char <= 0x39))
30
+ is_digit : (fn(self : Self) -> bool)(
31
+ (self.char >= 0x30) && (self.char <= 0x39)
36
32
  ),
37
-
38
33
  /// Check if this is an ASCII letter ('A'-'Z' or 'a'-'z').
39
- is_alphabetic : (fn(self: Self) -> bool)(
40
- (((self.char >= 0x41) && (self.char <= 0x5A)) || ((self.char >= 0x61) && (self.char <= 0x7A)))
34
+ is_alphabetic : (fn(self : Self) -> bool)(
35
+ ((self.char >= 0x41) && (self.char <= 0x5A)) || ((self.char >= 0x61) && (self.char <= 0x7A))
41
36
  ),
42
-
43
37
  /// Check if this is an ASCII uppercase letter ('A'-'Z').
44
- is_uppercase : (fn(self: Self) -> bool)(
45
- ((self.char >= 0x41) && (self.char <= 0x5A))
38
+ is_uppercase : (fn(self : Self) -> bool)(
39
+ (self.char >= 0x41) && (self.char <= 0x5A)
46
40
  ),
47
-
48
41
  /// Check if this is an ASCII lowercase letter ('a'-'z').
49
- is_lowercase : (fn(self: Self) -> bool)(
50
- ((self.char >= 0x61) && (self.char <= 0x7A))
42
+ is_lowercase : (fn(self : Self) -> bool)(
43
+ (self.char >= 0x61) && (self.char <= 0x7A)
51
44
  ),
52
-
53
45
  /// Convert to lowercase. Only affects ASCII uppercase letters.
54
- to_lowercase : (fn(self: Self) -> Self)(
46
+ to_lowercase : (fn(self : Self) -> Self)(
55
47
  cond(
56
- is_uppercase(self) => Self((self.char + 32)),
48
+ is_uppercase(self) => Self(self.char + 32),
57
49
  true => self
58
50
  )
59
51
  ),
60
-
61
52
  /// Convert to uppercase. Only affects ASCII lowercase letters.
62
- to_uppercase : (fn(self: Self) -> Self)(
53
+ to_uppercase : (fn(self : Self) -> Self)(
63
54
  cond(
64
- is_lowercase(self) => Self((self.char - 32)),
55
+ is_lowercase(self) => Self(self.char - 32),
65
56
  true => self
66
57
  )
67
58
  ),
68
-
69
59
  /// Null character (U+0000).
70
- NUL : Self(0x00),
60
+ NUL : Self(0x00),
71
61
  /// Horizontal tab (U+0009).
72
- TAB : Self(0x09),
62
+ TAB : Self(0x09),
73
63
  /// Line feed / newline (U+000A).
74
- NEWLINE : Self(0x0A),
64
+ NEWLINE : Self(0x0A),
75
65
  /// Space (U+0020).
76
- SPACE : Self(0x20),
66
+ SPACE : Self(0x20),
77
67
  /// Digit zero '0' (U+0030).
78
- ZERO : Self(0x30),
68
+ ZERO : Self(0x30),
79
69
  /// Digit nine '9' (U+0039).
80
- NINE : Self(0x39),
70
+ NINE : Self(0x39),
81
71
  /// Uppercase 'A' (U+0041).
82
72
  UPPERCASE_A : Self(0x41),
83
73
  /// Uppercase 'Z' (U+005A).
@@ -87,21 +77,21 @@ impl(rune,
87
77
  /// Lowercase 'z' (U+007A).
88
78
  LOWERCASE_Z : Self(0x7A)
89
79
  );
90
-
91
- impl(rune, Eq(rune)(
92
- (==) : ((a, b) -> (a.char == b.char)),
93
- (!=) : ((a, b) -> (a.char != b.char))
94
- ));
95
-
96
- impl(rune, Ord(rune)(
97
- (<) : ((a, b) -> (a.char < b.char)),
98
- (<=) : ((a, b) -> (a.char <= b.char)),
99
- (>) : ((a, b) -> (a.char > b.char)),
100
- (>=) : ((a, b) -> (a.char >= b.char))
101
- ));
102
-
80
+ impl(
81
+ rune,
82
+ Eq(rune)(
83
+ (==) : ((a, b) -> (a.char == b.char)),
84
+ (!=) : ((a, b) -> (a.char != b.char))
85
+ )
86
+ );
87
+ impl(
88
+ rune,
89
+ Ord(rune)(
90
+ (<) : ((a, b) -> (a.char < b.char)),
91
+ (<=) : ((a, b) -> (a.char <= b.char)),
92
+ (>) : ((a, b) -> (a.char > b.char)),
93
+ (>=) : ((a, b) -> (a.char >= b.char))
94
+ )
95
+ );
103
96
  impl(rune, Send());
104
-
105
- export
106
- rune
107
- ;
97
+ export(rune);