Use printn rather than println. Add string methods for copying.

This commit is contained in:
Christoffer Lerno
2023-02-04 15:38:06 +01:00
committed by Christoffer Lerno
parent 6b928c7a3d
commit dce171670f
39 changed files with 1627 additions and 677 deletions

View File

@@ -45,20 +45,18 @@ fn int main()
define void @foo_Foo_hello(ptr %0) #0 {
entry:
%1 = call i32 @std_io_println(ptr @.str) #1
store ptr @.str, ptr %x, align 8
ret void
}
define void @foo_Bar_hello(ptr %0) #0 {
entry:
%1 = call i32 @std_io_println(ptr @.str.1) #1
ret void
store ptr @.str.1, ptr %x, align 8
}
define void @foo_MyEnum_hello(ptr %0) #0 {
entry:
%1 = call i32 @std_io_println(ptr @.str.2) #1
ret void
store ptr @.str.2, ptr %x, align 8
}
define i32 @main() #0 {
@@ -73,4 +71,4 @@ entry:
call void @foo_Bar_hello(ptr %b)
call void @foo_MyEnum_hello(ptr %a)
ret i32 0
}
}

View File

@@ -11,7 +11,7 @@ import std::io;
fn void foo::Bar.test(Bar *bar)
{
io::println("Inside of baz::Bar.test");
io::printn("Inside of baz::Bar.test");
}
module abc;

View File

@@ -2,7 +2,7 @@ module foo;
fn void Bar.test(Bar *bar)
{
io::println("Inside of baz::Bar.test");
io::printn("Inside of baz::Bar.test");
}
struct Bar
@@ -16,7 +16,7 @@ import std::io;
fn void foo::Bar.test(Bar *bar) // #error: This method is already defined for 'Bar'
{
io::println("Inside of baz::Bar.test");
io::printn("Inside of baz::Bar.test");
}
module abc;

View File

@@ -11,12 +11,12 @@ import std::io;
fn void foo::Bar.test(Bar *bar)
{
io::println("Inside of baz::Bar.test");
io::printn("Inside of baz::Bar.test");
}
fn void Bar.test(Bar *bar) // #error: This method is already defined for
{
io::println("Inside of baz::Bar.test");
io::printn("Inside of baz::Bar.test");
}
module abc;