I agree that tools.reader is probably the best way to go.

The following note is off the top of my head without double-checking the
details, so please take it with a bit of "needs verification of details"
thought.

Even with tools.reader, I believe you either need to eval ns forms, or do
your own parsing of ns forms to be able to read things like ::om/pass, with
namespace aliases in the keywords.  e.g. see documentation for *alias-map*
http://clojure.github.io/tools.reader/#clojure.tools.reader/*alias-map*

Andy


On Thu, Jan 15, 2015 at 3:21 PM, Thomas Heller <th.hel...@gmail.com> wrote:

> https://github.com/clojure/tools.reader is probably your best bet.
>
>
> On Friday, January 16, 2015 at 12:13:22 AM UTC+1, zirkonit wrote:
>>
>> I'm thoroughly confused. If I want to parse clojure code from string
>> without evaluating or caring a lot about its context, I'm out of luck.
>>
>> EDN tools choke on reader macros ( #(blah % blah) is not valid EDN ), yet
>> more context-aware tools like read-string with *read-eval* set to false
>> choke on namespace-specific tokens like ::om/pass.
>>
>> What would be a best choice to parse Clojure code into analyzable data
>> structure while both parsing all of it (so, not just clojure.edn/read),
>> _and_ not going the entire namespaces/shadowing/etc dance?
>>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to