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:
parent
31ed149850
commit
20eb10cf3c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user