Skip to content

Commit

Permalink
[lang] treat all js/* symbols as non-electric
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurC committed Sep 3, 2024
1 parent f154aa8 commit 42e08c2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hyperfiddle/electric/impl/lang_de2.clj
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@
(let [ns (-> env :ns :name), {:keys [line column]} (meta o)]
(str ns ":" line ":" column " " o)))

(defn js-uppercase-sym? [sym] (re-matches #"^js/(Math|String).*$" (str sym)))

(defn electric-sym? [sym]
(let [s (name sym)]
(and (pos? (.length s))
(Character/isUpperCase (.charAt s 0))
(not (re-matches #"G__\d+" s)) ; default gensym generated symbols
(not (js-uppercase-sym? sym))
(not= "js" (namespace sym))
(not= 'RCF__tap sym))))

(defn ?expand-macro [o env caller]
Expand Down

0 comments on commit 42e08c2

Please sign in to comment.