From 7dcec7538bb2a706997811fb223f438e6498ab27 Mon Sep 17 00:00:00 2001 From: Ayman Nadeem Date: Fri, 18 Oct 2019 17:20:31 -0400 Subject: [PATCH] if option is specified, print no-color --- semantic-ast/src/Main.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/semantic-ast/src/Main.hs b/semantic-ast/src/Main.hs index 224241957..f735c635f 100644 --- a/semantic-ast/src/Main.hs +++ b/semantic-ast/src/Main.hs @@ -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)