From 780d0b2c423249a4f5890fb18a7df3de70b9264f Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 23 Jan 2007 16:31:44 +0000 Subject: [PATCH] No spaces after newlines in JavaScript pretty-printer. --- src/GF/JavaScript/PrintJS.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GF/JavaScript/PrintJS.hs b/src/GF/JavaScript/PrintJS.hs index f901a62df..9f85a58e9 100644 --- a/src/GF/JavaScript/PrintJS.hs +++ b/src/GF/JavaScript/PrintJS.hs @@ -26,10 +26,10 @@ render d = rend 0 (map ($ "") $ d []) "" where space t = showString t . (\s -> if null s then "" else (' ':s)) spaceAfter :: String -> Bool -spaceAfter = (`notElem` [".","(","["]) +spaceAfter = (`notElem` [".","(","[","\n"]) spaceBefore :: String -> Bool -spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}"]) +spaceBefore = (`notElem` [",",".",":",";","(",")","[","]","{","}","\n"]) parenth :: Doc -> Doc parenth ss = doc (showChar '(') . ss . doc (showChar ')')