layerware/hugsql

parser error in Windows

akashenfelter opened this issue · 4 comments

On a Mac, if I run(println (keys (hugsql/map-of-db-fns "hugsql/sql/test.sql"))), I get 34 keys, but if I run it on a Windows machine I only get one. I think this might have something to do with how the parser is treating newlines, but I haven't been able to isolate it.

This is definitely a bug based on Windows newline endings of \r\n vs \n.

I'll get a fix for this into the next patch release. Thank you for the report!

user=> (keys (hugsql/map-of-db-fns-from-string "-- :snip one\nselect *\n-- :snip two\nfrom test"))
(:one :two)
user=> (keys (hugsql/map-of-db-fns-from-string "-- :snip one\r\nselect *\r\n-- :snip two\r\nfrom test"))
(:one)

Wonderful, thank you!

This is released in 0.4.3. Please confirm this fixes the issue. Thanks!

Yes, that fixed it. Thank you!