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
@@ -1,2 +1,2 @@
var a
IO.print(a) // expect: null
System.print(a) // expect: null
@@ -1,4 +1,4 @@
{
var a = a + 1 // expect error
IO.print(a)
System.print(a)
}
@@ -3,13 +3,13 @@ class Foo {
bar {
var a = "a"
IO.print(a) // expect: a
System.print(a) // expect: a
var b = a + " b"
IO.print(b) // expect: a b
System.print(b) // expect: a b
var c = a + " c"
IO.print(c) // expect: a c
System.print(c) // expect: a c
var d = b + " d"
IO.print(d) // expect: a b d
System.print(d) // expect: a b d
}
}
@@ -1,6 +1,6 @@
{
var a = "outer"
{
IO.print(a) // expect: outer
System.print(a) // expect: outer
}
}
@@ -1,4 +1,4 @@
{
var a
IO.print(a) // expect: null
System.print(a) // expect: null
}
+1 -1
View File
@@ -255,5 +255,5 @@
var a253 = a252
var a254 = a253
var a255 = a254
IO.print(a255) // expect: value
System.print(a255) // expect: value
}
@@ -259,7 +259,7 @@
var a253 = a252
var a254 = a253
var a255 = a254
IO.print(a255) // expect: value a
System.print(a255) // expect: value a
}
{
@@ -519,6 +519,6 @@
var b253 = b252
var b254 = b253
var b255 = b254
IO.print(b255) // expect: value b
System.print(b255) // expect: value b
}
}
+2 -2
View File
@@ -6,13 +6,13 @@ class Foo {
foo { "method" }
method {
IO.print(foo)
System.print(foo)
}
static foo { "class method" }
static classMethod {
IO.print(foo)
System.print(foo)
}
}
+2 -2
View File
@@ -3,11 +3,11 @@ var a = "out"
if (true) {
var a = "in"
}
IO.print(a) // expect: out
System.print(a) // expect: out
// Create a local scope for the 'else' expression.
var b = "out"
if (false) "dummy" else {
var b = "in"
}
IO.print(b) // expect: out
System.print(b) // expect: out
@@ -1,9 +1,9 @@
{
var a = "first"
IO.print(a) // expect: first
System.print(a) // expect: first
}
{
var a = "second"
IO.print(a) // expect: second
System.print(a) // expect: second
}
+1 -1
View File
@@ -4,4 +4,4 @@ var i = 0
while ((i = i + 1) <= 1) {
var a = "inner"
}
IO.print(a) // expect: outer
System.print(a) // expect: outer
+2 -2
View File
@@ -1,8 +1,8 @@
{
var a = "outer"
{
IO.print(a) // expect: outer
System.print(a) // expect: outer
var a = "inner"
IO.print(a) // expect: inner
System.print(a) // expect: inner
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
var a = "global"
{
var a = "shadow"
IO.print(a) // expect: shadow
System.print(a) // expect: shadow
}
IO.print(a) // expect: global
System.print(a) // expect: global
@@ -2,6 +2,6 @@
var a = "outer"
{
var a = a + " inner"
IO.print(a) // expect: outer inner
System.print(a) // expect: outer inner
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
var a = "local"
{
var a = "shadow"
IO.print(a) // expect: shadow
System.print(a) // expect: shadow
}
IO.print(a) // expect: local
System.print(a) // expect: local
}
+1 -1
View File
@@ -1 +1 @@
IO.print(notDefined) // expect error
System.print(notDefined) // expect error
+1 -1
View File
@@ -1,3 +1,3 @@
Fn.new {
IO.print(notDefined) // expect error
System.print(notDefined) // expect error
}.call()