]> gitweb.factorcode.org Git - factor.git/commitdiff
syntax: adding \b \v and \f escape codes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Jun 2014 01:04:51 +0000 (18:04 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Jun 2014 01:04:51 +0000 (18:04 -0700)
core/strings/parser/parser.factor
core/syntax/syntax-docs.factor
core/syntax/syntax.factor

index 236fb8f1ad39075ba379200c9908b020e79fbbd0..cdf95244bf68e0b38c768d4a836326f16239ea05 100644 (file)
@@ -10,11 +10,14 @@ ERROR: bad-escape char ;
 : escape ( escape -- ch )
     H{
         { CHAR: a  CHAR: \a }
+        { CHAR: b  CHAR: \b }
         { CHAR: e  CHAR: \e }
+        { CHAR: f  CHAR: \f }
         { CHAR: n  CHAR: \n }
         { CHAR: r  CHAR: \r }
         { CHAR: t  CHAR: \t }
         { CHAR: s  CHAR: \s }
+        { CHAR: v  CHAR: \v }
         { CHAR: \s CHAR: \s }
         { CHAR: 0  CHAR: \0 }
         { CHAR: \\ CHAR: \\ }
index e3e221feb3abfa010a5b50b5f2b1cfe9d53ba604..a91023f222f7d057c5a8caae6c8598370d6607c1 100644 (file)
@@ -158,6 +158,9 @@ ARTICLE: "escape" "Character escape codes"
     { { $snippet "\\t" } "a tab" }
     { { $snippet "\\n" } "a newline" }
     { { $snippet "\\r" } "a carriage return" }
+    { { $snippet "\\b" } "a backspace (ASCII 8)" }
+    { { $snippet "\\v" } "a vertical tab (ASCII 11)" }
+    { { $snippet "\\f" } "a form feed (ASCII 12)" }
     { { $snippet "\\0" } "a null byte (ASCII 0)" }
     { { $snippet "\\e" } "escape (ASCII 27)" }
     { { $snippet "\\\"" } { $snippet "\"" } }
index 66b2428d6dbf5c3fb9aa60ee5e892832d72af34d..7c6ca987644f612f6f0e9ef20e7251a9aa96d198 100644 (file)
@@ -138,7 +138,7 @@ IN: bootstrap.syntax
         scan-token current-vocab create
         [ fake-definition ] [ set-last-word ] [ undefined-def define ] tri
     ] define-core-syntax
-    
+
     "ALIAS:" [
         scan-new-word scan-word define-alias
     ] define-core-syntax