Clean up text handling a bit:
- Rename IO.write -> IO.print. - Make IO.write not print a newline. - Support \u Unicode escapes in strings.
This commit is contained in:
@@ -11,6 +11,6 @@ class Foo {
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
IO.write(foo.closeOverGet.call) // expect: Foo field
|
||||
IO.print(foo.closeOverGet.call) // expect: Foo field
|
||||
foo.closeOverSet.call
|
||||
IO.write(foo.closeOverGet.call) // expect: new value
|
||||
IO.print(foo.closeOverGet.call) // expect: new value
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
write { IO.write(_field) }
|
||||
write { IO.print(_field) }
|
||||
}
|
||||
|
||||
(new Foo).write // expect: null
|
||||
|
||||
@@ -8,11 +8,11 @@ class Foo {
|
||||
}
|
||||
|
||||
write {
|
||||
IO.write(_a)
|
||||
IO.write(_b)
|
||||
IO.write(_c)
|
||||
IO.write(_d)
|
||||
IO.write(_e)
|
||||
IO.print(_a)
|
||||
IO.print(_b)
|
||||
IO.print(_c)
|
||||
IO.print(_d)
|
||||
IO.print(_e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
class Outer {
|
||||
method {
|
||||
_field = "outer"
|
||||
IO.write(_field) // expect: outer
|
||||
IO.print(_field) // expect: outer
|
||||
|
||||
class Inner {
|
||||
method {
|
||||
_field = "inner"
|
||||
IO.write(_field) // expect: inner
|
||||
IO.print(_field) // expect: inner
|
||||
}
|
||||
}
|
||||
|
||||
(new Inner).method
|
||||
IO.write(_field) // expect: outer
|
||||
IO.print(_field) // expect: outer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Node {
|
||||
_left.write
|
||||
}
|
||||
|
||||
IO.write(_value)
|
||||
IO.print(_value)
|
||||
|
||||
if (_right is Node) {
|
||||
_right.write
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Foo {
|
||||
write { IO.write(_field) } // Compile a use of the field...
|
||||
write { IO.print(_field) } // Compile a use of the field...
|
||||
init { _field = "value" } // ...before an assignment to it.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user