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

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// Create a very long string containing escape sequences.
var s = "1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\n1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890\"1234567890"
IO.write(s)
IO.print(s)
// expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890
// expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890
// expect: 1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890"1234567890

View File

@ -8191,7 +8191,7 @@ var f = fn {
65513; 65514; 65515; 65516; 65517; 65518; 65519; 65520;
65521; 65522; 65523; 65524; 65525; 65526; 65527; 65528;
65529; 65530; 65531; 65532; 65533; 65534; 65535;
IO.write(65536)
IO.print(65536)
}
f.call // expect: 65536