aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEduardo Julian2015-08-31 12:35:50 -0400
committerEduardo Julian2015-08-31 12:35:50 -0400
commit1857af8628216353c4fa0b75a921d66b266aa0b9 (patch)
tree6af36b174c90a19bc1d63f09dc5006ebaa4d10a2 /src
parenta0533814cbc3b4b59850f97e9e72abc8bb83ff57 (diff)
- Found a compromise with the issue of certain definitions clashing with each other when saving the class files in case-insensitive file-systems (https://github.com/LuxLang/lux/issues/8). The names of certain definitions were changed slightly to avoid clashes and the compiler throws an error if the names end up clashing prior to saving the .class file.
Diffstat (limited to 'src')
-rw-r--r--src/lux/compiler/base.clj9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lux/compiler/base.clj b/src/lux/compiler/base.clj
index b6efaada8..edb1441ca 100644
--- a/src/lux/compiler/base.clj
+++ b/src/lux/compiler/base.clj
@@ -46,9 +46,12 @@
(def tag-group-separator "\n")
;; [Utils]
-(defn ^:private write-file [^String file ^bytes data]
- (with-open [stream (BufferedOutputStream. (FileOutputStream. file))]
- (.write stream data)))
+(defn ^:private write-file [^String file-name ^bytes data]
+ (let [;; file-name (.toLowerCase file-name)
+ ]
+ (do (assert (not (.exists (File. file-name))) (str "Can't overwrite file: " file-name))
+ (with-open [stream (BufferedOutputStream. (FileOutputStream. file-name))]
+ (.write stream data)))))
(defn ^:private write-output [module name data]
(let [module* (&host/->module-class module)