@shd101wyy/yo 0.0.29 → 0.0.30

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 (38) hide show
  1. package/README.md +19 -0
  2. package/out/cjs/index.cjs +7554 -7826
  3. package/out/cjs/yo-cli.cjs +7604 -7876
  4. package/out/esm/index.mjs +7453 -7725
  5. package/out/types/src/codegen/async/runtime-core.d.ts +2 -1
  6. package/out/types/src/codegen/async/runtime-io-common.d.ts +3 -1
  7. package/out/types/src/codegen/async/runtime-io-linux.d.ts +1 -0
  8. package/out/types/src/codegen/async/runtime-io-macos.d.ts +1 -0
  9. package/out/types/src/codegen/async/runtime-io-windows.d.ts +1 -0
  10. package/out/types/src/codegen/async/runtime.d.ts +2 -1
  11. package/out/types/src/codegen/async/state-machine.d.ts +18 -2
  12. package/out/types/src/codegen/functions/context.d.ts +5 -0
  13. package/out/types/src/codegen/parallelism/runtime.d.ts +2 -1
  14. package/out/types/src/codegen/utils/index.d.ts +2 -0
  15. package/out/types/src/target.d.ts +1 -0
  16. package/out/types/tsconfig.tsbuildinfo +1 -1
  17. package/package.json +1 -1
  18. package/std/cli/arg_parser.yo +365 -0
  19. package/std/collections/array_list.yo +108 -0
  20. package/std/collections/hash_map.yo +1 -1
  21. package/std/collections/hash_set.yo +7 -7
  22. package/std/collections/linked_list.yo +1 -1
  23. package/std/encoding/base64.yo +73 -0
  24. package/std/fs/file.yo +113 -6
  25. package/std/fs/types.yo +21 -0
  26. package/std/glob/glob.yo +206 -0
  27. package/std/http/http.yo +196 -0
  28. package/std/io/reader.yo +17 -0
  29. package/std/io/writer.yo +19 -0
  30. package/std/net/tcp.yo +1 -1
  31. package/std/prelude.yo +69 -0
  32. package/std/string/string.yo +398 -4
  33. package/std/sync/cond.yo +19 -19
  34. package/std/sync/mutex.yo +16 -16
  35. package/std/sys/bufio/buf_reader.yo +2 -2
  36. package/std/sys/future.yo +3 -3
  37. package/std/toml/toml.yo +179 -0
  38. package/std/testing/assert.yo +0 -173
@@ -478,9 +478,9 @@ impl(String,
478
478
  ),
479
479
 
480
480
  /**
481
- * Check if the string contains a substring (like JavaScript includes)
481
+ * Check if the string contains a substring
482
482
  */
483
- includes : (fn(self: Self, substr: Self, (from_index : usize) ?= 0) -> bool)(
483
+ contains : (fn(self: Self, substr: Self, (from_index : usize) ?= 0) -> bool)(
484
484
  match(self.index_of(substr, from_index),
485
485
  .Some(_) => true,
486
486
  .None => false
@@ -1070,7 +1070,7 @@ impl(String,
1070
1070
  * Convert ASCII lowercase letters to uppercase (like JavaScript toUpperCase)
1071
1071
  * Note: Only handles ASCII a-z, not full Unicode case mapping
1072
1072
  */
1073
- to_upper_case : (fn(self: Self) -> Self)({
1073
+ to_uppercase : (fn(self: Self) -> Self)({
1074
1074
  new_bytes := ArrayList(u8).with_capacity(self._bytes.len());
1075
1075
 
1076
1076
  i := usize(0);
@@ -1098,7 +1098,7 @@ impl(String,
1098
1098
  * Convert ASCII uppercase letters to lowercase (like JavaScript toLowerCase)
1099
1099
  * Note: Only handles ASCII A-Z, not full Unicode case mapping
1100
1100
  */
1101
- to_lower_case : (fn(self: Self) -> Self)({
1101
+ to_lowercase : (fn(self: Self) -> Self)({
1102
1102
  new_bytes := ArrayList(u8).with_capacity(self._bytes.len());
1103
1103
 
1104
1104
  i := usize(0);
@@ -1356,6 +1356,27 @@ impl(String, Eq(String)(
1356
1356
  })
1357
1357
  ));
1358
1358
 
1359
+ impl(String, Hash(
1360
+ (hash): (fn(self: *(Self)) -> u64)({
1361
+ // FNV-1a hash over the bytes
1362
+ h := u64(14695981039346656037);
1363
+ i := usize(0);
1364
+ len := self.*._bytes.len();
1365
+ while ((i < len)),
1366
+ (i = (i + usize(1))),
1367
+ {
1368
+ match(self.*._bytes.get(i),
1369
+ .Some(b) => {
1370
+ h = (h ^ u64(b));
1371
+ h = (h * u64(1099511628211));
1372
+ },
1373
+ .None => ()
1374
+ );
1375
+ };
1376
+ h
1377
+ })
1378
+ ));
1379
+
1359
1380
  // === Iterator support ===
1360
1381
 
1361
1382
  /**
@@ -1441,6 +1462,379 @@ impl(String,
1441
1462
  )
1442
1463
  );
1443
1464
 
1465
+ // === Numeric parsing methods ===
1466
+
1467
+ impl(String,
1468
+ /**
1469
+ * Helper: check if a byte is an ASCII digit '0'-'9'
1470
+ */
1471
+ _is_digit_byte : (fn(byte: u8) -> bool)(
1472
+ ((byte >= u8(48)) && (byte <= u8(57)))
1473
+ ),
1474
+
1475
+ /**
1476
+ * Parse the string as a signed 32-bit integer.
1477
+ * Returns .Some(value) on success, .None on failure (empty, invalid chars, overflow).
1478
+ */
1479
+ parse_i32 : (fn(self: Self) -> Option(i32))({
1480
+ total_bytes := self._bytes.len();
1481
+ cond(
1482
+ (total_bytes == usize(0)) => {
1483
+ return .None;
1484
+ },
1485
+ true => ()
1486
+ );
1487
+
1488
+ idx := usize(0);
1489
+
1490
+ // Check for sign
1491
+ is_negative := false;
1492
+ first_byte_opt := self._bytes.get(usize(0));
1493
+ match(first_byte_opt,
1494
+ .Some(first_byte) => {
1495
+ cond(
1496
+ (first_byte == u8(45)) => {
1497
+ is_negative = true;
1498
+ idx = usize(1);
1499
+ },
1500
+ (first_byte == u8(43)) => {
1501
+ idx = usize(1);
1502
+ },
1503
+ true => ()
1504
+ );
1505
+ },
1506
+ .None => {
1507
+ return .None;
1508
+ }
1509
+ );
1510
+
1511
+ // Must have at least one digit after sign
1512
+ cond(
1513
+ (idx >= total_bytes) => {
1514
+ return .None;
1515
+ },
1516
+ true => ()
1517
+ );
1518
+
1519
+ result := i64(0);
1520
+ has_digit := false;
1521
+
1522
+ while ((idx < total_bytes)),
1523
+ (idx = (idx + usize(1))),
1524
+ {
1525
+ byte_opt := self._bytes.get(idx);
1526
+ match(byte_opt,
1527
+ .Some(byte) => {
1528
+ cond(
1529
+ Self._is_digit_byte(byte) => {
1530
+ digit := i64((byte - u8(48)));
1531
+ result = ((result * i64(10)) + digit);
1532
+ has_digit = true;
1533
+ },
1534
+ true => {
1535
+ return .None;
1536
+ }
1537
+ );
1538
+ },
1539
+ .None => {
1540
+ return .None;
1541
+ }
1542
+ );
1543
+ };
1544
+
1545
+ cond(
1546
+ (!(has_digit)) => {
1547
+ return .None;
1548
+ },
1549
+ true => ()
1550
+ );
1551
+
1552
+ final_val := cond(
1553
+ is_negative => (i64(0) - result),
1554
+ true => result
1555
+ );
1556
+
1557
+ // Check i32 range: -2147483648 to 2147483647
1558
+ cond(
1559
+ ((final_val < i64(-2147483648)) || (final_val > i64(2147483647))) => .None,
1560
+ true => .Some(i32(final_val))
1561
+ )
1562
+ }),
1563
+
1564
+ /**
1565
+ * Parse the string as a signed 64-bit integer.
1566
+ * Returns .Some(value) on success, .None on failure.
1567
+ * Note: does not detect i64 overflow during accumulation.
1568
+ */
1569
+ parse_i64 : (fn(self: Self) -> Option(i64))({
1570
+ total_bytes := self._bytes.len();
1571
+ cond(
1572
+ (total_bytes == usize(0)) => {
1573
+ return .None;
1574
+ },
1575
+ true => ()
1576
+ );
1577
+
1578
+ idx := usize(0);
1579
+
1580
+ is_negative := false;
1581
+ first_byte_opt := self._bytes.get(usize(0));
1582
+ match(first_byte_opt,
1583
+ .Some(first_byte) => {
1584
+ cond(
1585
+ (first_byte == u8(45)) => {
1586
+ is_negative = true;
1587
+ idx = usize(1);
1588
+ },
1589
+ (first_byte == u8(43)) => {
1590
+ idx = usize(1);
1591
+ },
1592
+ true => ()
1593
+ );
1594
+ },
1595
+ .None => {
1596
+ return .None;
1597
+ }
1598
+ );
1599
+
1600
+ cond(
1601
+ (idx >= total_bytes) => {
1602
+ return .None;
1603
+ },
1604
+ true => ()
1605
+ );
1606
+
1607
+ result := i64(0);
1608
+ has_digit := false;
1609
+
1610
+ while ((idx < total_bytes)),
1611
+ (idx = (idx + usize(1))),
1612
+ {
1613
+ byte_opt := self._bytes.get(idx);
1614
+ match(byte_opt,
1615
+ .Some(byte) => {
1616
+ cond(
1617
+ Self._is_digit_byte(byte) => {
1618
+ digit := i64((byte - u8(48)));
1619
+ result = ((result * i64(10)) + digit);
1620
+ has_digit = true;
1621
+ },
1622
+ true => {
1623
+ return .None;
1624
+ }
1625
+ );
1626
+ },
1627
+ .None => {
1628
+ return .None;
1629
+ }
1630
+ );
1631
+ };
1632
+
1633
+ cond(
1634
+ (!(has_digit)) => .None,
1635
+ true => {
1636
+ final_val := cond(
1637
+ is_negative => (i64(0) - result),
1638
+ true => result
1639
+ );
1640
+ return .Some(final_val);
1641
+ }
1642
+ )
1643
+ }),
1644
+
1645
+ /**
1646
+ * Parse the string as an unsigned 32-bit integer.
1647
+ * Returns .Some(value) on success, .None on failure (empty, invalid chars, overflow, negative sign).
1648
+ */
1649
+ parse_u32 : (fn(self: Self) -> Option(u32))({
1650
+ total_bytes := self._bytes.len();
1651
+ cond(
1652
+ (total_bytes == usize(0)) => {
1653
+ return .None;
1654
+ },
1655
+ true => ()
1656
+ );
1657
+
1658
+ idx := usize(0);
1659
+
1660
+ // Optional '+' sign, but '-' is invalid for unsigned
1661
+ first_byte_opt := self._bytes.get(usize(0));
1662
+ match(first_byte_opt,
1663
+ .Some(first_byte) => {
1664
+ cond(
1665
+ (first_byte == u8(45)) => {
1666
+ return .None;
1667
+ },
1668
+ (first_byte == u8(43)) => {
1669
+ idx = usize(1);
1670
+ },
1671
+ true => ()
1672
+ );
1673
+ },
1674
+ .None => {
1675
+ return .None;
1676
+ }
1677
+ );
1678
+
1679
+ cond(
1680
+ (idx >= total_bytes) => {
1681
+ return .None;
1682
+ },
1683
+ true => ()
1684
+ );
1685
+
1686
+ result := u64(0);
1687
+ has_digit := false;
1688
+
1689
+ while ((idx < total_bytes)),
1690
+ (idx = (idx + usize(1))),
1691
+ {
1692
+ byte_opt := self._bytes.get(idx);
1693
+ match(byte_opt,
1694
+ .Some(byte) => {
1695
+ cond(
1696
+ Self._is_digit_byte(byte) => {
1697
+ digit := u64((byte - u8(48)));
1698
+ result = ((result * u64(10)) + digit);
1699
+ has_digit = true;
1700
+ },
1701
+ true => {
1702
+ return .None;
1703
+ }
1704
+ );
1705
+ },
1706
+ .None => {
1707
+ return .None;
1708
+ }
1709
+ );
1710
+ };
1711
+
1712
+ cond(
1713
+ (!(has_digit)) => .None,
1714
+ true => {
1715
+ // Check u32 range: 0 to 4294967295
1716
+ cond(
1717
+ (result > u64(4294967295)) => {
1718
+ return .None;
1719
+ },
1720
+ true => {
1721
+ return .Some(u32(result));
1722
+ }
1723
+ );
1724
+ }
1725
+ )
1726
+ }),
1727
+
1728
+ /**
1729
+ * Parse the string as an unsigned 64-bit integer.
1730
+ * Returns .Some(value) on success, .None on failure.
1731
+ * Note: does not detect u64 overflow during accumulation.
1732
+ */
1733
+ parse_u64 : (fn(self: Self) -> Option(u64))({
1734
+ total_bytes := self._bytes.len();
1735
+ cond(
1736
+ (total_bytes == usize(0)) => {
1737
+ return .None;
1738
+ },
1739
+ true => ()
1740
+ );
1741
+
1742
+ idx := usize(0);
1743
+
1744
+ first_byte_opt := self._bytes.get(usize(0));
1745
+ match(first_byte_opt,
1746
+ .Some(first_byte) => {
1747
+ cond(
1748
+ (first_byte == u8(45)) => {
1749
+ return .None;
1750
+ },
1751
+ (first_byte == u8(43)) => {
1752
+ idx = usize(1);
1753
+ },
1754
+ true => ()
1755
+ );
1756
+ },
1757
+ .None => {
1758
+ return .None;
1759
+ }
1760
+ );
1761
+
1762
+ cond(
1763
+ (idx >= total_bytes) => {
1764
+ return .None;
1765
+ },
1766
+ true => ()
1767
+ );
1768
+
1769
+ result := u64(0);
1770
+ has_digit := false;
1771
+
1772
+ while ((idx < total_bytes)),
1773
+ (idx = (idx + usize(1))),
1774
+ {
1775
+ byte_opt := self._bytes.get(idx);
1776
+ match(byte_opt,
1777
+ .Some(byte) => {
1778
+ cond(
1779
+ Self._is_digit_byte(byte) => {
1780
+ digit := u64((byte - u8(48)));
1781
+ result = ((result * u64(10)) + digit);
1782
+ has_digit = true;
1783
+ },
1784
+ true => {
1785
+ return .None;
1786
+ }
1787
+ );
1788
+ },
1789
+ .None => {
1790
+ return .None;
1791
+ }
1792
+ );
1793
+ };
1794
+
1795
+ cond(
1796
+ (!(has_digit)) => .None,
1797
+ true => .Some(result)
1798
+ )
1799
+ }),
1800
+
1801
+ /**
1802
+ * Parse the string as a boolean.
1803
+ * Returns .Some(true) for "true", .Some(false) for "false", .None for anything else.
1804
+ */
1805
+ parse_bool : (fn(self: Self) -> Option(bool))({
1806
+ total_bytes := self._bytes.len();
1807
+ // "true" = 4 bytes: 116(t), 114(r), 117(u), 101(e)
1808
+ // "false" = 5 bytes: 102(f), 97(a), 108(l), 115(s), 101(e)
1809
+ cond(
1810
+ (total_bytes == usize(4)) => {
1811
+ b0 := self._bytes.get(usize(0)).unwrap_or(u8(0));
1812
+ b1 := self._bytes.get(usize(1)).unwrap_or(u8(0));
1813
+ b2 := self._bytes.get(usize(2)).unwrap_or(u8(0));
1814
+ b3 := self._bytes.get(usize(3)).unwrap_or(u8(0));
1815
+ cond(
1816
+ ((b0 == u8(116)) && ((b1 == u8(114)) && ((b2 == u8(117)) && (b3 == u8(101))))) =>
1817
+ .Some(true),
1818
+ true => .None
1819
+ )
1820
+ },
1821
+ (total_bytes == usize(5)) => {
1822
+ b0 := self._bytes.get(usize(0)).unwrap_or(u8(0));
1823
+ b1 := self._bytes.get(usize(1)).unwrap_or(u8(0));
1824
+ b2 := self._bytes.get(usize(2)).unwrap_or(u8(0));
1825
+ b3 := self._bytes.get(usize(3)).unwrap_or(u8(0));
1826
+ b4 := self._bytes.get(usize(4)).unwrap_or(u8(0));
1827
+ cond(
1828
+ ((b0 == u8(102)) && ((b1 == u8(97)) && ((b2 == u8(108)) && ((b3 == u8(115)) && (b4 == u8(101)))))) =>
1829
+ .Some(false),
1830
+ true => .None
1831
+ )
1832
+ },
1833
+ true => .None
1834
+ )
1835
+ })
1836
+ );
1837
+
1444
1838
  export
1445
1839
  String,
1446
1840
  StringError,
package/std/sync/cond.yo CHANGED
@@ -1,62 +1,62 @@
1
- { YO_THREAD_SYNC_TYPE, mutex_t, Mutex } :: import "./mutex";
1
+ { __YO_THREAD_SYNC_TYPE, mutex_t, Mutex } :: import "./mutex";
2
2
 
3
3
  extern "Yo",
4
- YO_COND_TYPE : Type,
5
- yo_cond_create : (fn() -> YO_COND_TYPE),
6
- yo_cond_wait : (fn(cv : *(YO_COND_TYPE), mutex : *(YO_THREAD_SYNC_TYPE)) -> unit),
7
- yo_cond_signal : (fn(cv : *(YO_COND_TYPE)) -> unit),
8
- yo_cond_broadcast : (fn(cv : *(YO_COND_TYPE)) -> unit),
9
- yo_cond_destroy : (fn(cv : *(YO_COND_TYPE)) -> unit)
4
+ __YO_COND_TYPE : Type,
5
+ __yo_cond_create : (fn() -> __YO_COND_TYPE),
6
+ __yo_cond_wait : (fn(cv : *(__YO_COND_TYPE), mutex : *(__YO_THREAD_SYNC_TYPE)) -> unit),
7
+ __yo_cond_signal : (fn(cv : *(__YO_COND_TYPE)) -> unit),
8
+ __yo_cond_broadcast : (fn(cv : *(__YO_COND_TYPE)) -> unit),
9
+ __yo_cond_destroy : (fn(cv : *(__YO_COND_TYPE)) -> unit)
10
10
  ;
11
11
 
12
12
  cond_t :: newtype(
13
- cv : YO_COND_TYPE
13
+ cv : __YO_COND_TYPE
14
14
  );
15
15
  impl(cond_t,
16
16
  new : (fn() -> Self)({
17
- return Self(yo_cond_create());
17
+ return Self(__yo_cond_create());
18
18
  }),
19
19
 
20
20
  wait : (fn(self : *(Self), mutex : *(mutex_t)) -> unit)({
21
- return yo_cond_wait(&(self.cv), &(mutex.mutex));
21
+ return __yo_cond_wait(&(self.cv), &(mutex.mutex));
22
22
  }),
23
23
 
24
24
  signal : (fn(self : *(Self)) -> unit)({
25
- return yo_cond_signal(&(self.cv));
25
+ return __yo_cond_signal(&(self.cv));
26
26
  }),
27
27
 
28
28
  broadcast : (fn(self : *(Self)) -> unit)({
29
- return yo_cond_broadcast(&(self.cv));
29
+ return __yo_cond_broadcast(&(self.cv));
30
30
  }),
31
31
 
32
32
  destroy : (fn(self : *(Self)) -> unit)({
33
- return yo_cond_destroy(&(self.cv));
33
+ return __yo_cond_destroy(&(self.cv));
34
34
  })
35
35
  );
36
36
 
37
37
  Cond :: object(
38
- cv : YO_COND_TYPE
38
+ cv : __YO_COND_TYPE
39
39
  );
40
40
  impl(Cond,
41
41
  new : (fn() -> Self)({
42
- return Self(yo_cond_create());
42
+ return Self(__yo_cond_create());
43
43
  }),
44
44
 
45
45
  wait : (fn(self : Self, mutex : Mutex) -> unit)({
46
- return yo_cond_wait(&(self.cv), &(mutex.mutex));
46
+ return __yo_cond_wait(&(self.cv), &(mutex.mutex));
47
47
  }),
48
48
 
49
49
  signal : (fn(self : Self) -> unit)({
50
- return yo_cond_signal(&(self.cv));
50
+ return __yo_cond_signal(&(self.cv));
51
51
  }),
52
52
 
53
53
  broadcast : (fn(self : Self) -> unit)({
54
- return yo_cond_broadcast(&(self.cv));
54
+ return __yo_cond_broadcast(&(self.cv));
55
55
  })
56
56
  );
57
57
  impl(Cond, Dispose(
58
58
  dispose : (fn(self : Self) -> unit)({
59
- return yo_cond_destroy(&(self.cv));
59
+ return __yo_cond_destroy(&(self.cv));
60
60
  })
61
61
  ));
62
62
 
package/std/sync/mutex.yo CHANGED
@@ -1,57 +1,57 @@
1
1
  extern "Yo",
2
- YO_THREAD_SYNC_TYPE : Type,
3
- yo_mutex_create : (fn() -> YO_THREAD_SYNC_TYPE),
4
- yo_mutex_lock : (fn(mutex : *(YO_THREAD_SYNC_TYPE)) -> unit),
5
- yo_mutex_unlock : (fn(mutex : *(YO_THREAD_SYNC_TYPE)) -> unit),
6
- yo_mutex_destroy : (fn(mutex : *(YO_THREAD_SYNC_TYPE)) -> unit)
2
+ __YO_THREAD_SYNC_TYPE : Type,
3
+ __yo_mutex_create : (fn() -> __YO_THREAD_SYNC_TYPE),
4
+ __yo_mutex_lock : (fn(mutex : *(__YO_THREAD_SYNC_TYPE)) -> unit),
5
+ __yo_mutex_unlock : (fn(mutex : *(__YO_THREAD_SYNC_TYPE)) -> unit),
6
+ __yo_mutex_destroy : (fn(mutex : *(__YO_THREAD_SYNC_TYPE)) -> unit)
7
7
  ;
8
8
 
9
9
  mutex_t :: newtype(
10
- mutex : YO_THREAD_SYNC_TYPE
10
+ mutex : __YO_THREAD_SYNC_TYPE
11
11
  );
12
12
  impl(mutex_t,
13
13
  new : (fn() -> Self)({
14
- return Self(yo_mutex_create());
14
+ return Self(__yo_mutex_create());
15
15
  }),
16
16
 
17
17
  lock : (fn(self : *(Self))-> unit)({
18
- return yo_mutex_lock(&(self.mutex));
18
+ return __yo_mutex_lock(&(self.mutex));
19
19
  }),
20
20
 
21
21
  unlock : (fn(self : *(Self)) -> unit)({
22
- return yo_mutex_unlock(&(self.mutex));
22
+ return __yo_mutex_unlock(&(self.mutex));
23
23
  }),
24
24
 
25
25
  destroy : (fn(self : *(Self)) -> unit)({
26
- return yo_mutex_destroy(&(self.mutex));
26
+ return __yo_mutex_destroy(&(self.mutex));
27
27
  })
28
28
  );
29
29
 
30
30
  // GC managed
31
31
  Mutex :: object(
32
- mutex : YO_THREAD_SYNC_TYPE
32
+ mutex : __YO_THREAD_SYNC_TYPE
33
33
  );
34
34
  impl(Mutex,
35
35
  new : (fn() -> Self)({
36
- return Self(yo_mutex_create());
36
+ return Self(__yo_mutex_create());
37
37
  }),
38
38
 
39
39
  lock : (fn(self : Self)-> unit)({
40
- return yo_mutex_lock(&(self.mutex));
40
+ return __yo_mutex_lock(&(self.mutex));
41
41
  }),
42
42
 
43
43
  unlock : (fn(self : Self) -> unit)({
44
- return yo_mutex_unlock(&(self.mutex));
44
+ return __yo_mutex_unlock(&(self.mutex));
45
45
  })
46
46
  );
47
47
  impl(Mutex, Dispose(
48
48
  dispose : (fn(self : Self) -> unit)({
49
- return yo_mutex_destroy(&(self.mutex));
49
+ return __yo_mutex_destroy(&(self.mutex));
50
50
  })
51
51
  ));
52
52
 
53
53
  export
54
- YO_THREAD_SYNC_TYPE,
54
+ __YO_THREAD_SYNC_TYPE,
55
55
  mutex_t,
56
56
  Mutex
57
57
  ;
@@ -238,7 +238,7 @@ impl(BufReader,
238
238
  }),
239
239
 
240
240
  // Read all remaining data into an ArrayList of bytes.
241
- read_all : (fn(self: Self, using(io : IO)) -> Impl(Future(Result(ArrayList(u8), IOError), IO)))({
241
+ read_bytes : (fn(self: Self, using(io : IO)) -> Impl(Future(Result(ArrayList(u8), IOError), IO)))({
242
242
  the_fd := self._fd;
243
243
  io.async((using(io : IO)) => {
244
244
  result := ArrayList(u8).new();
@@ -288,7 +288,7 @@ impl(BufReader,
288
288
  // Read all remaining data as a String.
289
289
  read_to_string : (fn(self: Self, using(io : IO)) -> Impl(Future(Result(String, IOError), IO)))(
290
290
  io.async((using(io : IO)) => {
291
- bytes_result := io.await(self.read_all(using(io)));
291
+ bytes_result := io.await(self.read_bytes(using(io)));
292
292
  match(bytes_result,
293
293
  .Ok(bytes) => .Ok(String.from_bytes(bytes)),
294
294
  .Err(e) => .Err(e)
package/std/sys/future.yo CHANGED
@@ -7,12 +7,12 @@
7
7
  // ============================================================================
8
8
 
9
9
  extern "Yo",
10
- yo_io_future_t : Type
10
+ __yo_io_future_t : Type
11
11
  ;
12
12
 
13
- IOFuture :: Impl(Concrete(yo_io_future_t), Future(i32));
13
+ IOFuture :: Impl(Concrete(__yo_io_future_t), Future(i32));
14
14
 
15
15
  export
16
- yo_io_future_t,
16
+ __yo_io_future_t,
17
17
  IOFuture
18
18
  ;