lbradstreet / instaparse-cljs

Port of Instaparse to Clojurescript
89 stars 4 forks source link

Transform don't touch FlattenOnDemandVector #14

Closed sadchi closed 8 years ago

sadchi commented 8 years ago

After using parser i got a tree with some FlattenOnDemandVector. Nodes with such vectors are not processed with transform function.

  1. Let s say we have tree [:doc [:row "test string] #object[instaparse.auto-flatten-seq.FlattenOnDemandVector]]. FlattenOnDemandVector also contains row.
  2. Apply (intaparse/transform {:row str} tree)
  3. The first row is transformed, the second is not How to solve this?
aengelberg commented 8 years ago

Looks like FlattenOnDemandVector does not implement ISequential.

sadchi commented 8 years ago

I was able to make workaround by using clojure.walk/postwalk identity before applying transform. It would be better to do transform w/o extra steps.

lbradstreet commented 8 years ago

aengelberg is right. I will try to get this done when I have time. If anyone wants to provide a PR that would be good too.

On 30 Jan 2016, at 5:29 AM, aengelberg notifications@github.com wrote:

Looks like FlattenOnDemandVector does not implement ISequential.

— Reply to this email directly or view it on GitHub.

superstructor commented 8 years ago

@lbradstreet #15 fixes this issue. Tested and working for me.

lbradstreet commented 8 years ago

Thank you @superstructor. I'll merge and cut you a new release

lbradstreet commented 8 years ago

Thank you again. Released in 1.4.1.1