It's been about a month since my last update, so I thought I would share
the progress since then. It's not much, mostly analysis, because I've
been rather busy with interviews and other related job stuff.
I've determined that the quote form will need to be created from
scratch, because tools.analyzer has an actual quote node and cljs just
sets a flag in the environment. It's not particularly complicated of a
form, though.
Let, loop, and recur are a bit messy, because loop and let are the same
form with some extra info (loop target) stored for loop. It looks like
the :info map contains the same info as the parent node, so it should
maybe be changed the way :children has been. (I only seem to have one,
unlabeled ast form for loop in my notes, so I'll have to see what
changes need to happen.)
>>>>>> <
https://github.com/AnOctopus/clojurescript/commit/07e553bd54945238c819795c4164a9f65d0ca23f>.
>>>>>>>>>>>> <
http://clojure.github.io/tools.analyzer.js/spec/quickref.html#throw>. The
>>>>>>>>>>>> diff is below. Let me know if this is right or of I'm way off.
>>>>>>>>>>>>
>>>>>>>>>>>> ---
>>>>>>>>>>>> diff --git a/src/main/clojure/cljs/analyzer.cljc
>>>>>>>>>>>> b/src/main/clojure/cljs/analyzer.cljc
>>>>>>>>>>>> index 437c8a0..6eb5b6b 100644
>>>>>>>>>>>> --- a/src/main/clojure/cljs/analyzer.cljc
>>>>>>>>>>>> +++ b/src/main/clojure/cljs/analyzer.cljc
>>>>>>>>>>>> @@ -994,8 +994,8 @@
>>>>>>>>>>>> [op env [_ throw :as form] name _]
>>>>>>>>>>>> (let [throw-expr (disallowing-recur (analyze (assoc env
>>>>>>>>>>>> :context :expr) throw))]
>>>>>>>>>>>> {:env env :op :throw :form form
>>>>>>>>>>>> - :throw throw-expr
>>>>>>>>>>>> - :children [throw-expr]}))
>>>>>>>>>>>> + :exception throw-expr
>>>>>>>>>>>> + :children [:exception]}))
>>>>>>>>>>>>
>>>>>>>>>>>> (defmethod parse 'try
>>>>>>>>>>>> [op env [_ & body :as form] name _]
>>>>>>>>>>>>
>>>>>>>>>>>> On Sunday, November 29, 2015 at 2:53:46 PM UTC-8, Ambrose
>>>>>>>>>>>> Bonnaire-Sergeant wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Vincent,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Awesome!
>>>>>>>>>>>>>
>>>>>>>>>>>>> This issue <
http://dev.clojure.org/jira/browse/CLJS-1461>
>>>>>>>>>>>>> needs to be resolved.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Here's what to do.
>>>>>>>>>>>>>
>>>>>>>>>>>>> 1. Look over the tools.analyzer.js AST format
>>>>>>>>>>>>> <
http://clojure.github.io/tools.analyzer.js/spec/quickref.html>
>>>>>>>>>>>>> 2. Notice how the implementation of tools.analyzer.js conforms
>>>>>>>>>>>>> to this spec.
>>>>>>>>>>>>> eg. case*
>>>>>>>>>>>>> <
https://github.com/clojure/tools.analyzer.js/blob/eec5e3dd3fbeb306511aa8cdbeb663bac94392f9/src/main/clojure/clojure/tools/analyzer/js.clj#L290-L325>,
>>>>>>>>>>>>> or delegates to tools.analyzer, eg. try
>>>>>>>>>>>>> <
https://github.com/clojure/tools.analyzer/blob/f5d959f4e9e12a0a9d3d74293d9ff2ca0ad65ad4/src/main/clojure/clojure/tools/analyzer.clj#L373-L404>
>>>>>>>>>>>>> 3. Compare this spec to the actual ClojureScript analyzer.
>>>>>>>>>>>>> eg. try
>>>>>>>>>>>>> <
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer.cljc#L1000-L1059>
>>>>>>>>>>>>> 4. Note any differences between the specs.
>>>>>>>>>>>>> eg. :catch in ClojureScript
>>>>>>>>>>>>> <
https://github.com/clojure/clojurescript/blob/3e1af212e114a9968c6f69719b0346df12bd6d0e/src/main/clojure/cljs/analyzer.cljc#L1058> :try
>>>>>>>>>>>>> node, vs :catches vector in tools.analyzer
>>>>>>>>>>>>> <
https://github.com/clojure/tools.analyzer/blob/1c8693b30e8459ad3fbdb21871164ba82afb7b43/src/main/clojure/clojure/tools/analyzer.clj#L400>
>>>>>>>>>>>>> :try node.
>>>>>>>>>>>>> 5. Prepare a patch for the ClojureScript analyzer that updates
>>>>>>>>>>>>> the AST to conform to tools.analyzer.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm available to video chat over the week if that helps.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>> Ambrose
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sun, Nov 29, 2015 at 4:55 PM, Vincent Heuken <
>>>>>>>>>>>>>
vhe...@gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> I recently made an issue on the typed clojurescript sample
>>>>>>>>>>>>>> project's github
>>>>>>>>>>>>>> <
https://github.com/frenchy64/typed-clojurescript-play/issues/1> regarding