mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
case over Format
This commit is contained in:
parent
1537f43fde
commit
67760145e8
@ -12,6 +12,7 @@ import Data.ByteString (pack, readFile, ByteString)
|
||||
import System.IO (FilePath)
|
||||
import Options.Applicative hiding (style)
|
||||
import Data.Semigroup ((<>))
|
||||
import Text.Pretty.Simple (pPrint)
|
||||
|
||||
data SemanticAST = SemanticAST
|
||||
{ format :: Format
|
||||
@ -46,7 +47,7 @@ generateAST (SemanticAST format source) = do
|
||||
ast <- parseByteString @TreeSitter.Python.AST.Module @(Range, Span) tree_sitter_python bytestring
|
||||
case format of
|
||||
Show -> print ast
|
||||
|
||||
Pretty -> pPrint ast
|
||||
|
||||
opts :: ParserInfo SemanticAST
|
||||
opts = info (parseAST <**> helper)
|
||||
|
Loading…
Reference in New Issue
Block a user