mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
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:
committed by
Christoffer Lerno
parent
e4c1328ef2
commit
1aa038c92f
@@ -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)
|
||||
|
||||
@@ -6,6 +6,6 @@ fn void! main()
|
||||
defer f.close()!!;
|
||||
while (!f.eof())
|
||||
{
|
||||
@pool() { io::printn(f.treadline()!); };
|
||||
@pool() { io::printn(io::treadline(&f)!); };
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user