From 4df9192d02f6367955709ac72b8c0d36e9bcab82 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 19 Jul 2017 14:05:23 -0400 Subject: [PATCH] Move ParseMode into SemanticCmdLine. --- src/Arguments.hs | 4 ---- src/SemanticCmdLine.hs | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Arguments.hs b/src/Arguments.hs index 0adb817cf..a0040c5ef 100644 --- a/src/Arguments.hs +++ b/src/Arguments.hs @@ -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 diff --git a/src/SemanticCmdLine.hs b/src/SemanticCmdLine.hs index f39f8cffb..348dbdee3 100644 --- a/src/SemanticCmdLine.hs +++ b/src/SemanticCmdLine.hs @@ -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