rewrite-clj

lread 2024-06-28T15:32:15.738629Z

I stumbled upon some strangeness with character handling.

user=> (require '[rewrite-clj.parser :as p])
user=> (-> "\newline" p/parse-string-all :children)
( )
I would have expected \newline to be stored in a single node. It doesn't have rewriting repercussions because both nodes are written:
user=> (-> "\newline" p/parse-string-all str)
"\newline"
But it would not be great for analysis. Do you remember addressing this in your clj-kondo rewrite-clj fork, @borkdude?

lread 2024-06-28T15:38:05.542059Z

Oh stupid me. Forgot that I had to escape in string!

1
😂 1
lread 2024-06-28T15:38:38.457929Z

user=> (-> "\\newline" p/parse-string-all :children)
(<token: \newline>)

lread 2024-06-28T15:43:56.745549Z

I would delete the above messages... but I'd rather stay humble and oh so fallible. simple_smile

❤️ 1
teodorlu 2024-06-29T15:42:42.167739Z

I celebrate humility and fallibility! 😊 I'd say it works better in practice than the alternatives.

borkdude 2024-06-28T15:47:51.272999Z

@lee glad you solved it duckie

❤️ 1