Skip to content

Commit

Permalink
Accept non-Haskell QuasiQuotes
Browse files Browse the repository at this point in the history
Rather than throwing an error (thus making it impossible to use shm in a
function that has a QQ somewhere in it), instead just gracefully fail.

Ideally, the contents of the QuasiQuote would be one context contained
within the overall QQ, but I couldn't figure out how to do that.

Closes projectional-haskell#116.
  • Loading branch information
ivan-m committed Nov 9, 2015
1 parent 2f41350 commit 461667b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ post mode x =
Just (QuasiQuote (base :: SrcSpanInfo) qname content) ->
case parseExpWithMode mode content of
ParseOk ex -> genHSE mode (fmap (redelta qname base) ex)
ParseFailed _ e -> error e
ParseFailed _ _ -> []
_ -> []

-- | Apply a delta to the positions in the given span from the base.
Expand Down

0 comments on commit 461667b

Please sign in to comment.