Merge branch 'dev' into indentpolicyleft
commit
127299b442
|
@ -461,17 +461,16 @@ func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd lakjsdlajsdljas
|
||||||
###
|
###
|
||||||
|
|
||||||
#test left
|
#test left
|
||||||
func = (1+)
|
func = (1 +)
|
||||||
|
|
||||||
#test right
|
#test right
|
||||||
func = (+1)
|
func = (+ 1)
|
||||||
|
|
||||||
#test left inf
|
#test left inf
|
||||||
## TODO: this could be improved..
|
func = (1 `abc`)
|
||||||
func = (1`abc`)
|
|
||||||
|
|
||||||
#test right inf
|
#test right inf
|
||||||
func = (`abc`1)
|
func = (`abc` 1)
|
||||||
|
|
||||||
###
|
###
|
||||||
#group tuples
|
#group tuples
|
||||||
|
|
|
@ -340,17 +340,17 @@ func = fooooooooooooooooooooooooooooooooo + foooooooooooooooooooooooooooooooo
|
||||||
parserPrim =
|
parserPrim =
|
||||||
[ r
|
[ r
|
||||||
| r <-
|
| r <-
|
||||||
[ SGPPrimFloat $ bool id (0-) minus $ readGnok "parserPrim"
|
[ SGPPrimFloat $ bool id (0 -) minus $ readGnok "parserPrim"
|
||||||
(d1 ++ d2 ++ d3 ++ d4)
|
(d1 ++ d2 ++ d3 ++ d4)
|
||||||
| d2 <- string "."
|
| d2 <- string "."
|
||||||
, d3 <- many1 (oneOf "0123456789")
|
, d3 <- many1 (oneOf "0123456789")
|
||||||
, _ <- string "f"
|
, _ <- string "f"
|
||||||
]
|
]
|
||||||
<|> [ SGPPrimFloat $ bool id (0-) minus $ fromIntegral
|
<|> [ SGPPrimFloat $ bool id (0 -) minus $ fromIntegral
|
||||||
(readGnok "parserPrim" d1 :: Integer)
|
(readGnok "parserPrim" d1 :: Integer)
|
||||||
| _ <- string "f"
|
| _ <- string "f"
|
||||||
]
|
]
|
||||||
<|> [ SGPPrimInt $ bool id (0-) minus $ fromIntegral
|
<|> [ SGPPrimInt $ bool id (0 -) minus $ fromIntegral
|
||||||
(readGnok "parserPrim" d1 :: Integer)
|
(readGnok "parserPrim" d1 :: Integer)
|
||||||
| _ <- string "i"
|
| _ <- string "i"
|
||||||
]
|
]
|
||||||
|
@ -502,3 +502,10 @@ func
|
||||||
-> Proxy (str :: [*])
|
-> Proxy (str :: [*])
|
||||||
-> m (Tagged str String)
|
-> m (Tagged str String)
|
||||||
|
|
||||||
|
#test issue 67
|
||||||
|
fmapuv :: U.Unbox a => (a -> b) -> U.Vector a -> V.Vector b
|
||||||
|
fmapuv f xs = G.generate (G.length xs) (f . (xs G.!))
|
||||||
|
|
||||||
|
|
||||||
|
#test parallellistcomp-workaround
|
||||||
|
cs0 = 0 : [ c / Interval n | c <- cs | n <- [1..] ]
|
||||||
|
|
|
@ -486,17 +486,17 @@ func = lakjsdlajsdljasdlkjasldjasldjasldjalsdjlaskjd
|
||||||
###
|
###
|
||||||
|
|
||||||
#test left
|
#test left
|
||||||
func = (1+)
|
func = (1 +)
|
||||||
|
|
||||||
#test right
|
#test right
|
||||||
func = (+1)
|
func = (+ 1)
|
||||||
|
|
||||||
#test left inf
|
#test left inf
|
||||||
## TODO: this could be improved..
|
## TODO: this could be improved..
|
||||||
func = (1`abc`)
|
func = (1 `abc`)
|
||||||
|
|
||||||
#test right inf
|
#test right inf
|
||||||
func = (`abc`1)
|
func = (`abc` 1)
|
||||||
|
|
||||||
###
|
###
|
||||||
#group tuples
|
#group tuples
|
||||||
|
@ -963,18 +963,18 @@ func = fooooooooooooooooooooooooooooooooo + foooooooooooooooooooooooooooooooo
|
||||||
parserPrim =
|
parserPrim =
|
||||||
[ r
|
[ r
|
||||||
| r <-
|
| r <-
|
||||||
[ SGPPrimFloat $ bool id (0-) minus $ readGnok
|
[ SGPPrimFloat $ bool id (0 -) minus $ readGnok
|
||||||
"parserPrim"
|
"parserPrim"
|
||||||
(d1 ++ d2 ++ d3 ++ d4)
|
(d1 ++ d2 ++ d3 ++ d4)
|
||||||
| d2 <- string "."
|
| d2 <- string "."
|
||||||
, d3 <- many1 (oneOf "0123456789")
|
, d3 <- many1 (oneOf "0123456789")
|
||||||
, _ <- string "f"
|
, _ <- string "f"
|
||||||
]
|
]
|
||||||
<|> [ SGPPrimFloat $ bool id (0-) minus $ fromIntegral
|
<|> [ SGPPrimFloat $ bool id (0 -) minus $ fromIntegral
|
||||||
(readGnok "parserPrim" d1 :: Integer)
|
(readGnok "parserPrim" d1 :: Integer)
|
||||||
| _ <- string "f"
|
| _ <- string "f"
|
||||||
]
|
]
|
||||||
<|> [ SGPPrimInt $ bool id (0-) minus $ fromIntegral
|
<|> [ SGPPrimInt $ bool id (0 -) minus $ fromIntegral
|
||||||
(readGnok "parserPrim" d1 :: Integer)
|
(readGnok "parserPrim" d1 :: Integer)
|
||||||
| _ <- string "i"
|
| _ <- string "i"
|
||||||
]
|
]
|
||||||
|
|
|
@ -82,6 +82,8 @@ import ApiAnnotation ( AnnKeywordId(..) )
|
||||||
import Data.Data
|
import Data.Data
|
||||||
import Data.Generics.Schemes
|
import Data.Generics.Schemes
|
||||||
|
|
||||||
|
import qualified Data.Char as Char
|
||||||
|
|
||||||
import DataTreePrint
|
import DataTreePrint
|
||||||
|
|
||||||
import Data.HList.HList
|
import Data.HList.HList
|
||||||
|
@ -154,20 +156,21 @@ briDocByExactInlineOnly infoStr ast = do
|
||||||
let exactPrinted = Text.pack $ ExactPrint.exactPrint ast anns
|
let exactPrinted = Text.pack $ ExactPrint.exactPrint ast anns
|
||||||
fallbackMode <-
|
fallbackMode <-
|
||||||
mAsk <&> _conf_errorHandling .> _econf_ExactPrintFallback .> confUnpack
|
mAsk <&> _conf_errorHandling .> _econf_ExactPrintFallback .> confUnpack
|
||||||
let exactPrintNode = allocateNode $ BDFExternal
|
let exactPrintNode t = allocateNode $ BDFExternal
|
||||||
(ExactPrint.Types.mkAnnKey ast)
|
(ExactPrint.Types.mkAnnKey ast)
|
||||||
(foldedAnnKeys ast)
|
(foldedAnnKeys ast)
|
||||||
False
|
False
|
||||||
exactPrinted
|
t
|
||||||
let
|
let errorAction = do
|
||||||
errorAction = do
|
mTell $ [ErrorUnknownNode infoStr ast]
|
||||||
mTell $ [ErrorUnknownNode infoStr ast]
|
docLit
|
||||||
docLit $ Text.pack "{- BRITTANY ERROR UNHANDLED SYNTACTICAL CONSTRUCT -}"
|
$ Text.pack "{- BRITTANY ERROR UNHANDLED SYNTACTICAL CONSTRUCT -}"
|
||||||
case (fallbackMode, Text.lines exactPrinted) of
|
case (fallbackMode, Text.lines exactPrinted) of
|
||||||
(ExactPrintFallbackModeNever, _ ) -> errorAction
|
(ExactPrintFallbackModeNever, _ ) -> errorAction
|
||||||
(_ , [_]) -> exactPrintNode
|
(_ , [t]) -> exactPrintNode
|
||||||
(ExactPrintFallbackModeRisky, _ ) -> exactPrintNode
|
(Text.dropWhile Char.isSpace . Text.dropWhileEnd Char.isSpace $ t)
|
||||||
_ -> errorAction
|
(ExactPrintFallbackModeRisky, _) -> exactPrintNode exactPrinted
|
||||||
|
_ -> errorAction
|
||||||
|
|
||||||
rdrNameToText :: RdrName -> Text
|
rdrNameToText :: RdrName -> Text
|
||||||
-- rdrNameToText = Text.pack . show . flip runSDoc unsafeGlobalDynFlags . ppr
|
-- rdrNameToText = Text.pack . show . flip runSDoc unsafeGlobalDynFlags . ppr
|
||||||
|
|
|
@ -336,11 +336,11 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
SectionL left op -> do -- TODO: add to testsuite
|
SectionL left op -> do -- TODO: add to testsuite
|
||||||
leftDoc <- docSharedWrapper layoutExpr left
|
leftDoc <- docSharedWrapper layoutExpr left
|
||||||
opDoc <- docSharedWrapper layoutExpr op
|
opDoc <- docSharedWrapper layoutExpr op
|
||||||
docSeq [leftDoc, opDoc]
|
docSeq [leftDoc, docSeparator, opDoc]
|
||||||
SectionR op right -> do -- TODO: add to testsuite
|
SectionR op right -> do -- TODO: add to testsuite
|
||||||
opDoc <- docSharedWrapper layoutExpr op
|
opDoc <- docSharedWrapper layoutExpr op
|
||||||
rightDoc <- docSharedWrapper layoutExpr right
|
rightDoc <- docSharedWrapper layoutExpr right
|
||||||
docSeq [opDoc, rightDoc]
|
docSeq [opDoc, docSeparator, rightDoc]
|
||||||
ExplicitTuple args boxity
|
ExplicitTuple args boxity
|
||||||
| Just argExprs <- args `forM` (\case (L _ (Present e)) -> Just e; _ -> Nothing) -> do
|
| Just argExprs <- args `forM` (\case (L _ (Present e)) -> Just e; _ -> Nothing) -> do
|
||||||
argDocs <- docSharedWrapper layoutExpr `mapM` argExprs
|
argDocs <- docSharedWrapper layoutExpr `mapM` argExprs
|
||||||
|
|
Loading…
Reference in New Issue