cleanup: drop dead form-char? refer, document an-invoke :wild rule (jolt-xkbo)
analyzer.clj referred jolt.host/form-char? but never called it (form-char? stays live — backend_scheme.clj uses it). Promote numeric.clj an-invoke's :wild operand rule (an integer literal is valid in either fl/fx kind) from an inline comment to the function docstring. Both output-neutral: the seed re-mints byte-identical, gate green.
This commit is contained in:
parent
43a0da4dd0
commit
9b4769f2e5
2 changed files with 8 additions and 2 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
def-node let-node fn-node vector-node map-node set-node
|
def-node let-node fn-node vector-node map-node set-node
|
||||||
quote-node throw-node host-static host-new]]
|
quote-node throw-node host-static host-new]]
|
||||||
[jolt.host :refer [form-sym? form-sym-name form-sym-ns form-list?
|
[jolt.host :refer [form-sym? form-sym-name form-sym-ns form-list?
|
||||||
form-vec? form-map? form-set? form-char?
|
form-vec? form-map? form-set?
|
||||||
form-literal? form-keyword? form-elements form-vec-items
|
form-literal? form-keyword? form-elements form-vec-items
|
||||||
form-map-pairs form-set-items form-special? compile-ns
|
form-map-pairs form-set-items form-special? compile-ns
|
||||||
form-regex? form-regex-source
|
form-regex? form-regex-source
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,13 @@
|
||||||
pe (reduce (fn [e p] (assoc e p (get nh p))) tenv (get a :params))]
|
pe (reduce (fn [e p] (assoc e p (get nh p))) tenv (get a :params))]
|
||||||
(if (get a :rest) (assoc pe (get a :rest) nil) pe)))
|
(if (get a :rest) (assoc pe (get a :rest) nil) pe)))
|
||||||
|
|
||||||
(defn- an-invoke [node tenv]
|
(defn- an-invoke
|
||||||
|
"Annotate an :invoke with its numeric kind. An arithmetic core op specializes to
|
||||||
|
the Chez fl*/fx* op only when every operand is the same kind (:double or :long),
|
||||||
|
except an integer literal is :wild — valid in either — so (+ ^double x 2) stays
|
||||||
|
double. A call to a ^double/^long-returning var yields that kind without lowering
|
||||||
|
the call (its body already coerces the return)."
|
||||||
|
[node tenv]
|
||||||
(let [fnode (get node :fn)
|
(let [fnode (get node :fn)
|
||||||
nm (when (and (= :var (get fnode :op)) (= "clojure.core" (get fnode :ns)))
|
nm (when (and (= :var (get fnode :op)) (= "clojure.core" (get fnode :ns)))
|
||||||
(get fnode :name))
|
(get fnode :name))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue