ckirkendall / kioo

Enlive/Enfocus style templating for Facebook's React and Om in ClojureScript.
Eclipse Public License 1.0
404 stars 39 forks source link

Fixes compilation of predicates that nest another predicates. #43

Closed jaen closed 8 years ago

jaen commented 9 years ago

Right now using a selector like this

[[:div (has [[:div (attr= :a "b"]])]]

results in a compilation error during macro expansion (example: https://gist.github.com/jaen/ca61d108e20194009338) due to the inner predicate symbol not being resolved to an appropriate enlive var like the outer predicate symbol is.

I changed symbol resolution in predicate expressions inside the selectors to be recursive to fix this issue.

I've added some tests for this issue, but I'm not sure if it's the best way to test for it.
Since the issue manifests itself during macro expansion you won't get a test failure but a test error. Probably the best way would be to test if kioo.core/eval-selector leaves any non-resolved symbols in it's output or not. I can add such a test later if you think it's important to test this before merging, though some pointers how to do it would be appreciated.