]> gitweb.factorcode.org Git - factor.git/commitdiff
strings.parser: simplify next-escape.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Jun 2014 04:04:05 +0000 (21:04 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Jun 2014 04:04:05 +0000 (21:04 -0700)
core/strings/parser/parser.factor

index cdf95244bf68e0b38c768d4a836326f16239ea05..1d01cf8c569e25dfce41cdecc13d66e22268d4cc 100644 (file)
@@ -43,10 +43,10 @@ name>char-hook [
     ] if ;
 
 : next-escape ( str -- ch str' )
-    dup first {
-        { CHAR: u [ rest-slice unicode-escape ] }
-        { CHAR: x [ rest-slice hex-escape ] }
-        [ drop unclip-slice escape swap ]
+    unclip-slice {
+        { CHAR: u [ unicode-escape ] }
+        { CHAR: x [ hex-escape ] }
+        [ escape swap ]
     } case ;
 
 <PRIVATE