Add Support for \U Style Unicode Escapes

This allows fuky things such as ๐Ÿš€ and ๐Ÿ˜€ to be Direclty encoded in
Wren strings.
This commit is contained in:
Will Speak
2015-10-17 10:35:46 +01:00
parent 49601e67c5
commit d45c0d7f82
4 changed files with 17 additions and 6 deletions
@@ -0,0 +1,2 @@
// expect error line 2
"\U01F603"
+8 -1
View File
@@ -14,4 +14,11 @@ System.print("\u0b83") // expect: เฎƒ
System.print("\u00B6") // expect: ยถ
System.print("\u00DE") // expect: รž
// TODO: Syntax for Unicode escapes > 0xffff?
// Big escapes:
var smile = "\U0001F603"
var byteSmile = "\xf0\x9f\x98\x83"
System.print(byteSmile == smile) // expect: true
System.print("<\U0001F64A>") // expect: <๐Ÿ™Š>
System.print("<\U0001F680>") // expect: <๐Ÿš€>
System.print("<\U00010318>") // expect: <๐Œ˜>
@@ -0,0 +1,2 @@
// expect error line 2
"\U0060"