1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-16 00:07:40 +00:00

Address #306 - Add unicode escapes.

Unicode escapes have the same syntax as go - \uXXXX or \UXXXXXXXX.
This commit is contained in:
Calvin Rose
2020-04-04 21:46:08 -05:00
parent 081d132538
commit ae70a03383
3 changed files with 46 additions and 2 deletions

View File

@@ -206,6 +206,10 @@
(def 🐮 :cow)
(assert (= (string "🐼" 🦊 🐮) "🐼foxcow") "emojis 🙉 :)")
(assert (not= 🦊 "🦊") "utf8 strings are not symbols and vice versa")
(assert (= "\U0001F637" "😷") "unicode escape 1")
(assert (= "\u2623" "\U00002623" "") "unicode escape 2")
(assert (= "\u24c2" "\U000024c2" "") "unicode escape 3")
(assert (= "\u0061" "a") "unicode escape 4")
# Symbols with @ character