funcool/cuerdas

Issue with ClojureScript and advanced compilation

mjmeintjes opened this issue · 2 comments

This issue only happens when advanced compilation is on:

(kebab :start) => "s"
(kebab :end) => "e"
(kebab :startOffset) => "s-se"
(kebab :endOffset) => "e-se"

Without advanced compilation mode, I get the correct results.

Let me know if you need more information.

I did some further investigation into this.

My environment:
I use shadow-cljs to compile ClojureScript.
[funcool/cuerdas "2.0.4"]

The bug seems to happen at calls to (rx/enhace #"PATTERN"). For some reason, during advanced compilation, the backslashes get stripped out.

I've fixed it on my local copy by replace the #"" reader macro with re-pattern function and added an additional slash in front of each slash in the pattern.

I can create a pull request. However, I can't understand why this would be happening, and am wondering whether it is possibly due to something in shadow-cljs.

i don't know if this is an issue of shadow-cljs or is something expected, but please open that PR and i'll will test it on my environments :D