Add support for OverloadedLabels
`OverloadedLabels` is a simple enough extension to parse and format. It is becoming more common with use of `generic-lens`. Since it can be treated as a `HsVar` its implementation only requires using `docLit`, along with some marshalling for dealing with `FastString`.pull/244/head
parent
56f93ba3bb
commit
907f362ab5
|
@ -130,3 +130,13 @@ func = do
|
||||||
hello
|
hello
|
||||||
|]
|
|]
|
||||||
pure True
|
pure True
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
## OverloadedLabels
|
||||||
|
#test bare label
|
||||||
|
{-# LANGUAGE OverloadedLabels #-}
|
||||||
|
foo = #bar
|
||||||
|
|
||||||
|
#test applied and composed label
|
||||||
|
{-# LANGUAGE OverloadedLabels #-}
|
||||||
|
foo = #bar . #baz $ fmap #foo xs
|
||||||
|
|
|
@ -55,9 +55,9 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
HsRecFld{} -> do
|
HsRecFld{} -> do
|
||||||
-- TODO
|
-- TODO
|
||||||
briDocByExactInlineOnly "HsRecFld" lexpr
|
briDocByExactInlineOnly "HsRecFld" lexpr
|
||||||
HsOverLabel{} -> do
|
HsOverLabel NoExt _reboundFromLabel name ->
|
||||||
-- TODO
|
let label = FastString.unpackFS name
|
||||||
briDocByExactInlineOnly "HsOverLabel{}" lexpr
|
in docLit . Text.pack $ '#' : label
|
||||||
HsIPVar{} -> do
|
HsIPVar{} -> do
|
||||||
-- TODO
|
-- TODO
|
||||||
briDocByExactInlineOnly "HsOverLabel{}" lexpr
|
briDocByExactInlineOnly "HsOverLabel{}" lexpr
|
||||||
|
|
Loading…
Reference in New Issue