mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 06:08:41 +01:00
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:
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user