From 1d3f4c6665eb32a555be4c189368a7f5363cf917 Mon Sep 17 00:00:00 2001 From: David Nolen Date: Thu, 16 Feb 2012 10:18:29 -0500 Subject: [PATCH] * src/clj/cljs/compiler.clj: avoid emitting unicode chars for \uFDD0 and \FDD1 --- src/clj/cljs/compiler.clj | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/clj/cljs/compiler.clj b/src/clj/cljs/compiler.clj index 033a00b..3b49ce6 100644 --- a/src/clj/cljs/compiler.clj +++ b/src/clj/cljs/compiler.clj @@ -159,23 +159,29 @@ (defmethod emit-constant Double [x] (print x)) (defmethod emit-constant String [x] (pr x)) (defmethod emit-constant Boolean [x] (print (if x "true" "false"))) -(defmethod emit-constant Character [x] (pr (str x))) +(defmethod emit-constant Character [x] + (case x + \uFDD0 (print "\"\\uFDD0\"") + \uFDD1 (print "\"\\uFDD1\"") + (pr (str x)))) (defmethod emit-constant java.util.regex.Pattern [x] (let [[_ flags pattern] (re-find #"^(?:\(\?([idmsux]*)\))?(.*)" (str x))] (print (str \/ (.replaceAll (re-matcher #"/" pattern) "\\\\/") \/ flags)))) (defmethod emit-constant clojure.lang.Keyword [x] - (pr (str \uFDD0 \' - (if (namespace x) - (str (namespace x) "/") "") - (name x)))) + (print (str \" "\\uFDD0" \' + (if (namespace x) + (str (namespace x) "/") "") + (name x) + \"))) (defmethod emit-constant clojure.lang.Symbol [x] - (pr (str \uFDD1 \' + (print (str \" "\\uFDD1" \' (if (namespace x) (str (namespace x) "/") "") - (name x)))) + (name x) + \"))) (defn- emit-meta-constant [x string] (if (meta x) -- 1.7.4.4