1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 08:25:19 +03:00

if option is specified, print no-color

This commit is contained in:
Ayman Nadeem 2019-10-18 17:20:31 -04:00
parent bd7a16a52f
commit 7dcec7538b

View File

@ -51,8 +51,11 @@ generateAST (SemanticAST format color source) = do
pure $ Data.ByteString.Char8.pack source
ast <- parseByteString @TreeSitter.Python.AST.Module @(Range, Span) tree_sitter_python bytestring
case format of
Show -> print ast
Show -> print ast
Pretty -> pPrint ast
case color of
Prelude.True -> pPrintNoColor ast
Prelude.False -> pPrint ast
opts :: ParserInfo SemanticAST
opts = info (parseAST <**> helper)