Make this varaiable/keyword work

This commit is contained in:
Nathan Braswell
2016-01-24 01:02:56 -05:00
parent 23cad3ad1b
commit c022758b9c
5 changed files with 30 additions and 9 deletions

View File

@@ -1,10 +1,13 @@
import to_import: simple_print, a, b
import to_import: simple_print, a, b, string_id
obj Something (ObjectTrait) {
var member: int
fun method(a: int):int {
return 5+a+member
}
fun return_this(): *Something {
return this;
}
}
/*fun some_function(): int return 0;*/
@@ -46,6 +49,10 @@ fun main(): int {
simple_print("\n")
simple_print(an_obj.method(1))
simple_print("\n")
simple_print(string_id("WoooopsEee\n"))
var with_ptr = an_obj.return_this()
simple_print(with_ptr->method(2))
simple_print("\n")
return 0
}