mirror of
https://github.com/github/semantic.git
synced 2025-01-07 07:58:12 +03:00
Newline on end of JSON output, no longer pretty
This commit is contained in:
parent
a62b720dad
commit
58889e1038
@ -3,8 +3,7 @@ module ParseCommand where
|
|||||||
|
|
||||||
import Arguments
|
import Arguments
|
||||||
import Category
|
import Category
|
||||||
import Data.Aeson (ToJSON)
|
import Data.Aeson (ToJSON, encode)
|
||||||
import Data.Aeson.Encode.Pretty
|
|
||||||
import Data.Record
|
import Data.Record
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
@ -44,7 +43,7 @@ parse Arguments{..} = do
|
|||||||
parsers = parserWithSource <$> filePaths
|
parsers = parserWithSource <$> filePaths
|
||||||
toByteString terms = case format of
|
toByteString terms = case format of
|
||||||
SExpression -> printTerms TreeOnly terms
|
SExpression -> printTerms TreeOnly terms
|
||||||
_ -> B.intercalate "\n" (toS . encodePretty . cata algebra <$> terms)
|
_ -> B.intercalate "\n" (toS . encode . cata algebra <$> terms) <> "\n"
|
||||||
|
|
||||||
algebra :: TermF (Syntax leaf) (Record '[SourceText, Range, Category, SourceSpan]) ParseJSON -> ParseJSON
|
algebra :: TermF (Syntax leaf) (Record '[SourceText, Range, Category, SourceSpan]) ParseJSON -> ParseJSON
|
||||||
algebra term = case term of
|
algebra term = case term of
|
||||||
|
Loading…
Reference in New Issue
Block a user