aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
authorEduardo Julian2017-02-22 17:52:16 -0400
committerEduardo Julian2017-02-22 17:52:16 -0400
commit69c8192026f8cb28daa1d179a0a4c3cd2f3a0e6b (patch)
treec60d99a880240624298397d1d2bebd456bb5a96e /luxc/src
parent34f2995ba2bc86fbd400587b89cc21461ace37fe (diff)
- The lexer can now recognize a escape-character for vertical tabs (\v).
Diffstat (limited to 'luxc/src')
-rw-r--r--luxc/src/lux/lexer.clj4
1 files changed, 4 insertions, 0 deletions
diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj
index 38fa15cd0..2f9c0717e 100644
--- a/luxc/src/lux/lexer.clj
+++ b/luxc/src/lux/lexer.clj
@@ -30,6 +30,7 @@
(defn ^:private escape-char [escaped]
"(-> Text (Lux Text))"
(cond (.equals ^Object escaped "\\t") (return "\t")
+ (.equals ^Object escaped "\\v") (return "\u000B")
(.equals ^Object escaped "\\b") (return "\b")
(.equals ^Object escaped "\\n") (return "\n")
(.equals ^Object escaped "\\r") (return "\r")
@@ -42,6 +43,7 @@
(defn ^:private escape-char* [escaped]
"(-> Text Text)"
(cond (.equals ^Object escaped "\\t") "\t"
+ (.equals ^Object escaped "\\v") "\u000B"
(.equals ^Object escaped "\\b") "\b"
(.equals ^Object escaped "\\n") "\n"
(.equals ^Object escaped "\\r") "\r"
@@ -63,6 +65,8 @@
(case (.charAt raw-line (+ 1 idx))
\t (do (.append buffer "\t")
(recur (+ 2 idx)))
+ \v (do (.append buffer "\u000B")
+ (recur (+ 2 idx)))
\b (do (.append buffer "\b")
(recur (+ 2 idx)))
\n (do (.append buffer "\n")