Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser error in Windows #26

Closed
akashenfelter opened this issue Feb 25, 2016 · 4 comments
Closed

parser error in Windows #26

akashenfelter opened this issue Feb 25, 2016 · 4 comments
Labels

Comments

@akashenfelter
Copy link

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.

@csummers csummers added the bug label Feb 25, 2016
@csummers
Copy link
Member

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)

@akashenfelter
Copy link
Author

Wonderful, thank you!

@csummers
Copy link
Member

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

@akashenfelter
Copy link
Author

Yes, that fixed it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants