1
1
mirror of https://github.com/github/semantic.git synced 2024-12-21 05:41:54 +03:00

Move ParseMode into SemanticCmdLine.

This commit is contained in:
Rob Rix 2017-07-19 14:05:23 -04:00
parent 2cd59243a0
commit 4df9192d02
2 changed files with 5 additions and 4 deletions

View File

@ -9,7 +9,3 @@ import Renderer
data DiffMode = DiffStdin | DiffPaths (FilePath, Maybe Language) (FilePath, Maybe Language)
deriving Show
data ParseMode = ParseStdin | ParsePaths [(FilePath, Maybe Language)]
deriving Show

View File

@ -3,6 +3,7 @@ module SemanticCmdLine
( main
-- Testing
, runDiff
, ParseMode
, runParse
) where
@ -13,6 +14,7 @@ import Data.Functor.Both
import Data.List.Split (splitWhen)
import Data.Version (showVersion)
import Development.GitRev
import Language
import Options.Applicative hiding (action)
import Prologue hiding (concurrently, fst, snd, readFile)
import Renderer
@ -44,6 +46,9 @@ runDiff (SomeRenderer diffRenderer) diffMode = do
DiffStdin -> readBlobPairsFromHandle stdin
Task.runTask (Semantic.diffBlobPairs diffRenderer blobs)
data ParseMode = ParseStdin | ParsePaths [(FilePath, Maybe Language)]
deriving Show
runParse :: SomeRenderer TermRenderer -> ParseMode -> IO ByteString
runParse (SomeRenderer parseTreeRenderer) parseMode = do
blobs <- case parseMode of