feat: replace IO class with System class and remove separate IO module

- Delete wren_io.c, wren_io.h, and io.wren source files
- Remove multi-arity print overloads and IO.read/IO.time methods
- Add System class with print, printAll, write, writeAll methods to core.wren
- Update all documentation examples and README to use System.print instead of IO.print
This commit is contained in:
Bob Nystrom
2015-09-15 14:46:09 +00:00
parent f12581a674
commit aa72900a9e
491 changed files with 3285 additions and 3544 deletions
+2 -2
View File
@@ -11,6 +11,6 @@ class Foo {
}
var foo = Foo.new()
IO.print(foo.closeOverGet.call()) // expect: Foo field
System.print(foo.closeOverGet.call()) // expect: Foo field
foo.closeOverSet.call()
IO.print(foo.closeOverGet.call()) // expect: new value
System.print(foo.closeOverGet.call()) // expect: new value
+1 -1
View File
@@ -1,6 +1,6 @@
class Foo {
construct new() {}
write { IO.print(_field) }
write { System.print(_field) }
}
Foo.new().write // expect: null
+5 -5
View File
@@ -10,11 +10,11 @@ class Foo {
}
write {
IO.print(_a)
IO.print(_b)
IO.print(_c)
IO.print(_d)
IO.print(_e)
System.print(_a)
System.print(_b)
System.print(_c)
System.print(_d)
System.print(_e)
}
}
+3 -3
View File
@@ -3,19 +3,19 @@ class Outer {
method {
_field = "outer"
IO.print(_field) // expect: outer
System.print(_field) // expect: outer
class Inner {
construct new() {}
method {
_field = "inner"
IO.print(_field) // expect: inner
System.print(_field) // expect: inner
}
}
Inner.new().method
IO.print(_field) // expect: outer
System.print(_field) // expect: outer
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ class Node {
_left.write()
}
IO.print(_value)
System.print(_value)
if (_right is Node) {
_right.write()
+1 -1
View File
@@ -1,6 +1,6 @@
class Foo {
construct new() {}
write { IO.print(_field) } // Compile a use of the field...
write { System.print(_field) } // Compile a use of the field...
init { _field = "value" } // ...before an assignment to it.
}