From 69c8192026f8cb28daa1d179a0a4c3cd2f3a0e6b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 22 Feb 2017 17:52:16 -0400 Subject: - The lexer can now recognize a escape-character for vertical tabs (\v). --- luxc/src/lux/lexer.clj | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'luxc') 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") -- cgit v1.2.3