]> gitweb.factorcode.org Git - factor.git/commitdiff
strings.parser: allow "\u{snowman}" or "\u{2603}".
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 Apr 2016 17:19:43 +0000 (10:19 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 5 Apr 2016 17:19:43 +0000 (10:19 -0700)
core/strings/parser/parser.factor

index e70f9498ff999bd916baec64addc2e1554b1fd2b..056d6527c41069a78cdc67e795161e88abb901f6 100644 (file)
@@ -35,9 +35,13 @@ name>char-hook [
 
 : unicode-escape ( str -- ch str' )
     "{" ?head-slice [
-        CHAR: } over index cut-slice
-        [ >string name>char-hook get call( name -- char ) ] dip
-        rest-slice
+        CHAR: } over index cut-slice [
+            dup hex> [
+                nip
+            ] [
+                >string name>char-hook get call( name -- char )
+            ] if*
+        ] dip rest-slice
     ] [
         6 cut-slice [ hex> ] dip
     ] if ;