1
1
mirror of https://github.com/github/semantic.git synced 2025-01-02 04:10:29 +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) data DiffMode = DiffStdin | DiffPaths (FilePath, Maybe Language) (FilePath, Maybe Language)
deriving Show deriving Show
data ParseMode = ParseStdin | ParsePaths [(FilePath, Maybe Language)]
deriving Show

View File

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