Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datomic reader literal makes Marginalia choke #135

Open
eigenhombre opened this issue Nov 29, 2014 · 4 comments
Open

Datomic reader literal makes Marginalia choke #135

eigenhombre opened this issue Nov 29, 2014 · 4 comments

Comments

@eigenhombre
Copy link

Marginalia chokes on the #db/id literal form in the following -- if I comment that out, document generation for my entire project works fine. Note also that unit tests covering the following form work fine as well.

(defn insert-object [conn a b]
  @(d/transact conn [{:db/id #db/id [:db.part/user]
                      :my-object/field1 a
                      :my-object/field2 b}]))

Stacktrace excerpt follows:

Exception in thread "main" java.lang.RuntimeException: Problem parsing near line 36 <> original reported cause is java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.db/id-literal -- java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.db/id-literal, compiling:(/private/var/folders/v2/yxn9b9h93lzgjsz645mblbt80000gt/T/form-init4190221877881120283.clj:1:124)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Problem parsing near line 36 <> original reported cause is java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.db/id-literal -- java.lang.IllegalStateException: Attempting to call unbound fn: #'datomic.db/id-literal
at clojure.lang.LispReader.read(LispReader.java:218)
at marginalia.parser$parse_STAR_$fn__387$fn__390.invoke(parser.clj:120)
at marginalia.parser$parse_STAR_$fn__387.invoke(parser.clj:119)
at clojure.core$repeatedly$fn__4750.invoke(core.clj:4716)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)

@gdeer81
Copy link
Collaborator

gdeer81 commented Apr 13, 2015

Thanks for reporting this. It seems that every time new literal syntax is introduced marginalia has trouble handling this like when clojurescript introduced js literals. Instead of patching over the problem every time it comes up, we are seriously going to look at how we're parsing.
star

@metasoarous
Copy link

Any progress on this? This particular bug is biting me at the moment.

(Lots of literal mosquitoes are trying to bite me too. But that's probably because I'm on Java. The island...)

@gdeer81
Copy link
Collaborator

gdeer81 commented Apr 12, 2016

This is on my radar for the next release

@gdeer81
Copy link
Collaborator

gdeer81 commented Jan 6, 2017

I'm making the decision to patch over this problem and any other reader literal issues until I can get some time to experiment with using a new parsing library that solves the issue of new literals being added or until I get some time to make our current parser better at handling the extensibility of Clojure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants