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:
@@ -11,6 +11,6 @@ class Foo {
|
||||
}
|
||||
|
||||
Foo.initialize
|
||||
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,5 +1,5 @@
|
||||
class Foo {
|
||||
static write { IO.print(__field) }
|
||||
static write { System.print(__field) }
|
||||
}
|
||||
|
||||
Foo.write // expect: null
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ class Foo {
|
||||
}
|
||||
|
||||
static 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,36 +3,36 @@ class Outer {
|
||||
|
||||
static staticMethod {
|
||||
__field = "outer"
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
construct new() {}
|
||||
|
||||
static staticMethod {
|
||||
__field = "inner"
|
||||
IO.print(__field) // expect: inner
|
||||
System.print(__field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
Inner.staticMethod
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
}
|
||||
|
||||
instanceMethod {
|
||||
__field = "outer"
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
construct new() {}
|
||||
|
||||
instanceMethod {
|
||||
__field = "inner"
|
||||
IO.print(__field) // expect: inner
|
||||
System.print(__field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
Inner.new().instanceMethod
|
||||
IO.print(__field) // expect: outer
|
||||
System.print(__field) // expect: outer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
static write { IO.print(__field) } // Compile a use of the field...
|
||||
static write { System.print(__field) } // Compile a use of the field...
|
||||
static init { __field = "value" } // ...before an assignment to it.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user