forked from GitHub/gf-core
No spaces after newlines in JavaScript pretty-printer.
This commit is contained in:
@@ -26,10 +26,10 @@ render d = rend 0 (map ($ "") $ d []) "" where
|
|||||||
space t = showString t . (\s -> if null s then "" else (' ':s))
|
space t = showString t . (\s -> if null s then "" else (' ':s))
|
||||||
|
|
||||||
spaceAfter :: String -> Bool
|
spaceAfter :: String -> Bool
|
||||||
spaceAfter = (`notElem` [".","(","["])
|
spaceAfter = (`notElem` [".","(","[","\n"])
|
||||||
|
|
||||||
spaceBefore :: String -> Bool
|
spaceBefore :: String -> Bool
|
||||||
spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}"])
|
spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}","\n"])
|
||||||
|
|
||||||
parenth :: Doc -> Doc
|
parenth :: Doc -> Doc
|
||||||
parenth ss = doc (showChar '(') . ss . doc (showChar ')')
|
parenth ss = doc (showChar '(') . ss . doc (showChar ')')
|
||||||
|
|||||||
Reference in New Issue
Block a user