aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/target/r.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/target/r.lux')
-rw-r--r--stdlib/source/library/lux/target/r.lux17
1 files changed, 11 insertions, 6 deletions
diff --git a/stdlib/source/library/lux/target/r.lux b/stdlib/source/library/lux/target/r.lux
index ca5d7ea31..f4c3588ce 100644
--- a/stdlib/source/library/lux/target/r.lux
+++ b/stdlib/source/library/lux/target/r.lux
@@ -70,24 +70,29 @@
(:abstraction
(format "(" code ")")))
+ ... Added the carriage return for better Windows compatibility.
+ (def: \n+
+ Text
+ (format text.carriage_return text.new_line))
+
(def: nested_new_line
(format text.new_line text.tab))
(def: nested
(-> Text Text)
(|>> (text.replaced text.new_line ..nested_new_line)
- (format ..nested_new_line)))
+ (format text.carriage_return ..nested_new_line)))
(def: (_block expression)
(-> Text Text)
- (format "{" (nested expression) text.new_line "}"))
+ (format "{" (nested expression) \n+ "}"))
(def: .public (block expression)
(-> Expression Expression)
(:abstraction
(format "{"
(..nested (:representation expression))
- text.new_line "}")))
+ \n+ "}")))
(template [<name> <r>]
[(def: .public <name>
@@ -173,7 +178,7 @@
(format func "("
(|> args
(list#each ..code)
- (text.interposed (format "," text.new_line))
+ (text.interposed (format "," \n+))
..nested)
")"))))
@@ -258,7 +263,7 @@
(:abstraction
(format "if(" (:representation test) ") {"
(.._block (:representation then))
- text.new_line "}")))
+ \n+ "}")))
(def: .public (cond clauses else)
(-> (List [Expression Expression]) Expression Expression)
@@ -381,6 +386,6 @@
(-> Expression Expression Expression)
(:abstraction
(format (:representation pre)
- text.new_line
+ \n+
(:representation post))))
)