ndmitchell / record-dot-preprocessor

A preprocessor for a Haskell record syntax using dot
Other
129 stars 19 forks source link

Problematic edge case with QuasiQuotes #46

Closed torgeirsh closed 2 years ago

torgeirsh commented 2 years ago

Using Text.URI.QQ from the modern-uri package, [uri|test.com|] works as expected, but [uri|test.com/|] fails to compile:

  |
1 | (Z.getField @"com" test)/
  |            ^
unexpected space
expecting '#', '%', '/', ':', '?', '@', end of input, sub-delimiter, or unreserved character

    • In the quasi-quotation: [uri|(Z.getField @"com" test)/|]

It seems like the trailing slash prevents the preprocessor from detecting the quasi-quote.

ndmitchell commented 2 years ago

Thanks for the report. I've pushed a fix - can you confirm that does it for you? I had to do this one sight unseen, because my compiler is currently screwed. If it appears to work for you I'll make a release.

torgeirsh commented 2 years ago

I've done a quick test, and it does indeed seem to work. Thank you!

ndmitchell commented 2 years ago

Thanks for testing - released as 0.2.13