feat: rename IO.write to IO.print and add Unicode escape support in strings

Rename the IO.write method to IO.print, which now prints without a trailing newline, and add a new IO.print method that appends a newline after output. Update all benchmark, example, and test files to use IO.print instead of IO.write. Additionally, implement Unicode escape sequence parsing in the compiler's string tokenizer, supporting \uXXXX and \u{...} syntax with proper UTF-8 encoding for code points up to U+10FFFF.
This commit is contained in:
Bob Nystrom
2014-01-05 20:27:12 +00:00
parent e23e0ce6a3
commit c72db7d594
159 changed files with 1690 additions and 1599 deletions
+6 -6
View File
@@ -1,12 +1,12 @@
var inclusive = 2..5
IO.write(inclusive is Range) // expect: true
IO.write(inclusive.min) // expect: 2
IO.write(inclusive.max) // expect: 5
IO.print(inclusive is Range) // expect: true
IO.print(inclusive.min) // expect: 2
IO.print(inclusive.max) // expect: 5
var exclusive = 2...5
IO.write(exclusive is Range) // expect: true
IO.write(exclusive.min) // expect: 2
IO.write(exclusive.max) // expect: 4
IO.print(exclusive is Range) // expect: true
IO.print(exclusive.min) // expect: 2
IO.print(exclusive.max) // expect: 4
// TODO: Non-number RHS.
// TODO: Non-integer RHS.