Skip to content

Commit

Permalink
Support multi-line strings in C++ codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
jeaye committed Dec 25, 2016
1 parent a9b4133 commit 6177206
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/jank/codegen/c++.clj
Expand Up @@ -192,7 +192,9 @@
(defmethod codegen-impl :string
[current]
(str "\""
(clojure.string/replace (:value current) #"\"" "\\\\\"")
(-> (:value current)
(clojure.string/replace #"\"" "\\\\\"")
(clojure.string/replace #"\n" "\\\\n"))
"\""))

(defmethod codegen-impl :passthrough
Expand Down

0 comments on commit 6177206

Please sign in to comment.