aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2016-12-27 05:52:05 -0400
committerEduardo Julian2016-12-27 05:52:05 -0400
commit0ac6c2ef4d297eed53eb682ca8627a54f41e5ca2 (patch)
tree2d92eeafe98aa127a51c62a7602890bb77c9f223
parent1fb74875f73fdf2fcf12a4a9d927a9a06a7889e5 (diff)
- Added type annotations to eliminate reflection.
-rw-r--r--luxc/src/lux/compiler.clj6
-rw-r--r--luxc/src/lux/compiler/cache.clj8
-rw-r--r--luxc/src/lux/compiler/cache/ann.clj6
-rw-r--r--luxc/src/lux/compiler/cache/type.clj2
4 files changed, 11 insertions, 11 deletions
diff --git a/luxc/src/lux/compiler.clj b/luxc/src/lux/compiler.clj
index 78fe301fd..b9b4e8de0 100644
--- a/luxc/src/lux/compiler.clj
+++ b/luxc/src/lux/compiler.clj
@@ -124,15 +124,15 @@
(defn init!
"(-> (List Text) Null)"
- [resources-dirs target-dir]
+ [resources-dirs ^String target-dir]
(do (reset! &&/!output-dir target-dir)
(&&parallel/setup!)
(reset! !source->last-line {})
- (.mkdirs (java.io.File. target-dir))
+ (.mkdirs (new java.io.File target-dir))
(let [class-loader (ClassLoader/getSystemClassLoader)
addURL (doto (.getDeclaredMethod java.net.URLClassLoader "addURL" (into-array [java.net.URL]))
(.setAccessible true))]
- (doseq [resources-dir (&/->seq resources-dirs)]
+ (doseq [^String resources-dir (&/->seq resources-dirs)]
(.invoke addURL class-loader
(to-array [(->> resources-dir (new java.io.File) .toURI .toURL)]))))))
diff --git a/luxc/src/lux/compiler/cache.clj b/luxc/src/lux/compiler/cache.clj
index 5f0a77c65..e1951c0d5 100644
--- a/luxc/src/lux/compiler/cache.clj
+++ b/luxc/src/lux/compiler/cache.clj
@@ -64,7 +64,7 @@
[^File module]
(->> module
.listFiles
- (filter #(.isDirectory %))
+ (filter #(.isDirectory ^File %))
(map module-dirs)
(apply concat)
(list* module)))
@@ -72,10 +72,10 @@
(defn clean [state]
"(-> Compiler Null)"
(let [needed-modules (->> state (&/get$ &/$modules) &/|keys &/->seq set)
- output-dir-prefix (str (.getAbsolutePath (new File @&&/!output-dir)) "/")
+ output-dir-prefix (str (.getAbsolutePath (new File ^String @&&/!output-dir)) "/")
outdated? #(->> % (contains? needed-modules) not)
- outdated-modules (->> (new File @&&/!output-dir)
- .listFiles (filter #(.isDirectory %))
+ outdated-modules (->> (new File ^String @&&/!output-dir)
+ .listFiles (filter #(.isDirectory ^File %))
(map module-dirs) doall (apply concat)
(map #(-> ^File % .getAbsolutePath (string/replace output-dir-prefix "")))
(filter outdated?))]
diff --git a/luxc/src/lux/compiler/cache/ann.clj b/luxc/src/lux/compiler/cache/ann.clj
index d50c02465..d372876f6 100644
--- a/luxc/src/lux/compiler/cache/ann.clj
+++ b/luxc/src/lux/compiler/cache/ann.clj
@@ -99,17 +99,17 @@
(defn ^:private deserialize-ident* [^String input]
(when (.startsWith input "@")
- (let [[ident* ^String input*] (.split (.substring input 1) stop 2)
+ (let [[^String ident* ^String input*] (.split (.substring input 1) stop 2)
[_module _name] (.split ident* ident-separator 2)]
[(&/T [_module _name]) input*])))
(defn ^:private deserialize-ident [^String input]
(when (.startsWith input "@")
- (let [[ident* ^String input*] (.split (.substring input 1) stop 2)
+ (let [[^String ident* ^String input*] (.split (.substring input 1) stop 2)
[_module _name] (.split ident* ident-separator 2)]
[(&/$IdentM (&/T [_module _name])) input*])))
-(defn ^:private deserialize-seq [deserializer input]
+(defn ^:private deserialize-seq [deserializer ^String input]
(cond (.startsWith input nil-signal)
[&/$Nil (.substring input 1)]
diff --git a/luxc/src/lux/compiler/cache/type.clj b/luxc/src/lux/compiler/cache/type.clj
index 80d3a93d6..eb82e162f 100644
--- a/luxc/src/lux/compiler/cache/type.clj
+++ b/luxc/src/lux/compiler/cache/type.clj
@@ -74,7 +74,7 @@
(declare deserialize-type)
-(defn ^:private deserialize-list [input]
+(defn ^:private deserialize-list [^String input]
(cond (.startsWith input nil-signal)
[&/$Nil (.substring input 1)]