haskell-suite / haskell-src-exts

Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer
Other
193 stars 94 forks source link

"Parse error: virtual } found" on valid source #275

Open sulami opened 9 years ago

sulami commented 9 years ago

I'm not quite sure how to properly report this, but I'm pretty sure this is a HSE issue.

I get said error when using Hlint on a file that looks like this:

renderSemantic :: Monad m => FormRender m a
renderSemantic aform fragment = do
    (res, views') <- aFormToForm aform
    let views = views' []
    let widget = [whamlet|
$newline never
\#{fragment}
$forall view <- views
    <div .ui .field :fvRequired view:.required :not $ fvRequired view:.optional>
        <label for=#{fvId view}>#{fvLabel view}
        $maybe tt <- fvTooltip view
            <div .tooltip>#{tt}
        ^{fvInput view}
        $maybe err <- fvErrors view
            <div .errors>#{err}
|]
    return (res, widget)

The parse error points to the dollar-sign at $newline never, which is inside this inlined hamlet snippet. GHC compiles this without warnings. I am using HSE 1.16.0.1.

EDIT: Sorry, I accidentally hit return while still writing this

mpickering commented 9 years ago

Please also paste the code which causes the error.