strings.parser: allow "\u{snowman}" or "\u{2603}".

locals-and-roots
John Benediktsson 2016-04-05 10:19:43 -07:00
parent 96336d2f6c
commit 1bc99066a7
1 changed files with 7 additions and 3 deletions

View File

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