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:
Bob Nystrom
2014-01-05 12:27:12 -08:00
parent 870f3b8b93
commit b979272305
159 changed files with 1690 additions and 1599 deletions
+4 -4
View File
@@ -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)
}
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ var f = null
{
var local = "local"
f = fn {
IO.write(local)
IO.print(local)
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ var foo = null
var local = "local"
class Foo {
method {
IO.write(local)
IO.print(local)
}
}
+3 -3
View File
@@ -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 -1
View File
@@ -1,6 +1,6 @@
{
var local = "local"
fn {
IO.write(local) // expect: local
IO.print(local) // expect: local
}.call
}
+1 -1
View File
@@ -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)
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
{
var a = "a"
f = fn IO.write(a)
f = fn IO.print(a)
}
{
+1 -1
View File
@@ -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
+2 -2
View File
@@ -3,11 +3,11 @@ var global = "global"
class Foo {
method {
IO.write(global)
IO.print(global)
}
static classMethod {
IO.write(global)
IO.print(global)
}
}