{-# OPTIONS_GHC -Wwarn #-}
module Ide.Plugin.Eval.Parse.Option (
langOptions,
) where
import Control.Monad.Combinators (many)
import Ide.Plugin.Eval.Parse.Parser (
Parser,
letterChar,
runParser,
space,
string,
)
langOptions :: [Char] -> Either String [[Char]]
langOptions :: [Char] -> Either [Char] [[Char]]
langOptions = Parser Char [[Char]] -> [Char] -> Either [Char] [[Char]]
forall t a. Show t => Parser t a -> [t] -> Either [Char] a
runParser (Parser Char Char -> Parser Char [Char]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
many Parser Char Char
space Parser Char [Char] -> Parser Char [[Char]] -> Parser Char [[Char]]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> Parser Char [[Char]]
languageOpts Parser Char [[Char]] -> Parser Char [Char] -> Parser Char [[Char]]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* Parser Char Char -> Parser Char [Char]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
many Parser Char Char
space)
languageOpts :: Parser Char [[Char]]
languageOpts :: Parser Char [[Char]]
languageOpts = [Char] -> Parser Char [Char]
string [Char]
":set" Parser Char [Char] -> Parser Char [[Char]] -> Parser Char [[Char]]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> Parser Char [Char] -> Parser Char [[Char]]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
many (Parser Char Char -> Parser Char [Char]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
many Parser Char Char
space Parser Char [Char] -> Parser Char [Char] -> Parser Char [Char]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> [Char] -> Parser Char [Char]
string [Char]
"-X" Parser Char [Char] -> Parser Char [Char] -> Parser Char [Char]
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> (Parser Char Char -> Parser Char [Char]
forall (m :: * -> *) a. MonadPlus m => m a -> m [a]
many Parser Char Char
letterChar))