Interface based streams. Fix for initializing with a force unwrap inside. Allow $define to take a list. Allow $define to return error on argument type mismatch in call. Fixed broken bit operations on boolean vectors.

This commit is contained in:
Christoffer Lerno
2023-10-30 14:07:37 +01:00
committed by Christoffer Lerno
parent e4c1328ef2
commit 1aa038c92f
42 changed files with 789 additions and 890 deletions

View File

@@ -22,7 +22,7 @@ struct StringData @private
fn void Summary.print(Summary *s, File* out)
{
String title = s.title ? s.title.str_view() : "missing";
out.printf("Summary({ .title = %s, .ok = %s})", title, s.ok);
(void)io::fprintf(out, "Summary({ .title = %s, .ok = %s})", title, s.ok);
}
fn bool contains(String haystack, String needle)

View File

@@ -6,6 +6,6 @@ fn void! main()
defer f.close()!!;
while (!f.eof())
{
@pool() { io::printn(f.treadline()!); };
@pool() { io::printn(io::treadline(&f)!); };
}
}

View File

@@ -13,7 +13,7 @@ fault TokenResult
fn void! main(String[] args)
{
// Grab a string from stdin
String s = io::stdin().readline()!;
String s = io::readline()!;
// Delete it at scope end [defer]
defer s.free();

View File

@@ -7,7 +7,7 @@ fn void! main()
String command = env::WIN32 ? "dir" : "ls";
SubProcess x = process::create({ command }, { .search_user_path = true })!!;
x.join()!;
Stream* stream = &&x.stdout();
InStream* stream = &&x.stdout();
while (try char b = stream.read_byte())
{
io::printf("%c", b);