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:
@@ -4,15 +4,15 @@ var g = null
|
||||
{
|
||||
var local = "local"
|
||||
f = fn {
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
local = "after f"
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
}
|
||||
|
||||
g = fn {
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
local = "after g"
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ var f = null
|
||||
|
||||
fn(param) {
|
||||
f = fn {
|
||||
IO.write(param)
|
||||
IO.print(param)
|
||||
}
|
||||
}.call("param")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ var f = null
|
||||
class Foo {
|
||||
method(param) {
|
||||
f = fn {
|
||||
IO.write(param)
|
||||
IO.print(param)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ var f = null
|
||||
{
|
||||
var local = "local"
|
||||
f = fn {
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ var foo = null
|
||||
var local = "local"
|
||||
class Foo {
|
||||
method {
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ fn {
|
||||
fn {
|
||||
var c = "c"
|
||||
f = fn {
|
||||
IO.write(a)
|
||||
IO.write(b)
|
||||
IO.write(c)
|
||||
IO.print(a)
|
||||
IO.print(b)
|
||||
IO.print(c)
|
||||
}
|
||||
}.call
|
||||
}.call
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
var local = "local"
|
||||
fn {
|
||||
IO.write(local) // expect: local
|
||||
IO.print(local) // expect: local
|
||||
}.call
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
var local = "local"
|
||||
class Foo {
|
||||
method {
|
||||
IO.write(local)
|
||||
IO.print(local)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ var f = null
|
||||
{
|
||||
var a = "a"
|
||||
f = fn {
|
||||
IO.write(a)
|
||||
IO.write(a)
|
||||
IO.print(a)
|
||||
IO.print(a)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
var a = "a"
|
||||
f = fn IO.write(a)
|
||||
f = fn IO.print(a)
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -2,5 +2,5 @@ var global = "global"
|
||||
// TODO: Forward reference to global declared after use.
|
||||
|
||||
fn {
|
||||
IO.write(global) // expect: global
|
||||
IO.print(global) // expect: global
|
||||
}.call
|
||||
|
||||
@@ -3,11 +3,11 @@ var global = "global"
|
||||
|
||||
class Foo {
|
||||
method {
|
||||
IO.write(global)
|
||||
IO.print(global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.write(global)
|
||||
IO.print(global)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user