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:
@@ -1,7 +1,7 @@
|
||||
var Nonlocal = "before"
|
||||
IO.print(Nonlocal) // expect: before
|
||||
System.print(Nonlocal) // expect: before
|
||||
Nonlocal = "after"
|
||||
IO.print(Nonlocal) // expect: after
|
||||
System.print(Nonlocal) // expect: after
|
||||
|
||||
class Foo {
|
||||
static method {
|
||||
@@ -10,9 +10,9 @@ class Foo {
|
||||
}
|
||||
|
||||
Foo.method
|
||||
IO.print(Nonlocal) // expect: method
|
||||
System.print(Nonlocal) // expect: method
|
||||
|
||||
Fn.new {
|
||||
Nonlocal = "fn"
|
||||
}.call()
|
||||
IO.print(Nonlocal) // expect: fn
|
||||
System.print(Nonlocal) // expect: fn
|
||||
|
||||
@@ -2,7 +2,7 @@ var Nonlocal = "outer"
|
||||
|
||||
{
|
||||
var Nonlocal = "inner"
|
||||
IO.print(Nonlocal) // expect: inner
|
||||
System.print(Nonlocal) // expect: inner
|
||||
}
|
||||
|
||||
IO.print(Nonlocal) // expect: outer
|
||||
System.print(Nonlocal) // expect: outer
|
||||
|
||||
@@ -8,5 +8,5 @@ class Bar {
|
||||
static foo { Foo.new() }
|
||||
}
|
||||
|
||||
IO.print(Foo.bar) // expect: instance of Bar
|
||||
IO.print(Bar.foo) // expect: instance of Foo
|
||||
System.print(Foo.bar) // expect: instance of Bar
|
||||
System.print(Bar.foo) // expect: instance of Foo
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
var A = A == null
|
||||
IO.print(A) // expect: true
|
||||
System.print(A) // expect: true
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
var A
|
||||
IO.print(A) // expect: null
|
||||
System.print(A) // expect: null
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
IO.print(Foo) // expect: null
|
||||
System.print(Foo) // expect: null
|
||||
var Foo = "value"
|
||||
IO.print(Foo) // expect: value
|
||||
System.print(Foo) // expect: value
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
var fn = Fn.new {
|
||||
IO.print(Foo)
|
||||
IO.print(Bar)
|
||||
System.print(Foo)
|
||||
System.print(Bar)
|
||||
}
|
||||
|
||||
// expect error line 6
|
||||
@@ -1,5 +1,5 @@
|
||||
var Global = "global"
|
||||
|
||||
Fn.new {
|
||||
IO.print(Global) // expect: global
|
||||
System.print(Global) // expect: global
|
||||
}.call()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var f = Fn.new {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
var Global = "global"
|
||||
|
||||
@@ -4,11 +4,11 @@ class Foo {
|
||||
construct new() {}
|
||||
|
||||
method {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ class Foo {
|
||||
construct new() {}
|
||||
|
||||
method {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
System.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user