1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 17:59:10 +03:00

call toJSON if there is an instance, or marshal, print results

This commit is contained in:
Ayman Nadeem 2019-12-19 10:11:36 -05:00
parent 31ed149850
commit 20eb10cf3c

View File

@ -57,7 +57,7 @@ generateAST (SemanticAST format noColor source) =
go = ast >=> display
ast = parseByteString @AST.Module @(Range, Span) Python.tree_sitter_python
display = case format of
Json -> print . toJSON
Json -> print . either toJSON (marshal . fmap (const ()))
Show -> print
Pretty | noColor -> pPrintNoColor
| otherwise -> pPrint