mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-23 08:03:11 -06:00
No spaces after newlines in JavaScript pretty-printer.
This commit is contained in:
1 parent
979a54af35
commit
780d0b2c42
1 file changed
+2
-2
@@ -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