Rename AllFlags to RawFlags
I just like this new name better
This commit is contained in:
parent
4707e929ef
commit
45ec7d1708
3 changed files with 6 additions and 6 deletions
|
|
@ -18,7 +18,7 @@ module Mima.Flag
|
||||||
, flagChar
|
, flagChar
|
||||||
, Flags(..)
|
, Flags(..)
|
||||||
, rawFlags
|
, rawFlags
|
||||||
, AllFlags
|
, RawFlags
|
||||||
, FlagSpec
|
, FlagSpec
|
||||||
, getFlagSpec
|
, getFlagSpec
|
||||||
, interpretFlagSpec
|
, interpretFlagSpec
|
||||||
|
|
@ -113,10 +113,10 @@ rawFlags = Flags
|
||||||
, flagReadOnly = ReadOnly
|
, flagReadOnly = ReadOnly
|
||||||
}
|
}
|
||||||
|
|
||||||
type AllFlags = Map.Map AddressRange (Set.Set Char)
|
type RawFlags = Map.Map AddressRange (Set.Set Char)
|
||||||
type FlagSpec = Flags AddressSpec
|
type FlagSpec = Flags AddressSpec
|
||||||
|
|
||||||
getFlagSpec :: AllFlags -> FlagSpec
|
getFlagSpec :: RawFlags -> FlagSpec
|
||||||
getFlagSpec af =
|
getFlagSpec af =
|
||||||
let isInSet :: Flag -> Set.Set Char -> Bool
|
let isInSet :: Flag -> Set.Set Char -> Bool
|
||||||
isInSet f s = flagChar f `Set.member` s
|
isInSet f s = flagChar f `Set.member` s
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,5 @@ fRange r
|
||||||
fLine :: (AddressRange, Set.Set Char) -> T.Text
|
fLine :: (AddressRange, Set.Set Char) -> T.Text
|
||||||
fLine (r, s) = fRange r <> ": " <> fFlagSet s <> "\n"
|
fLine (r, s) = fRange r <> ": " <> fFlagSet s <> "\n"
|
||||||
|
|
||||||
formatFlagFile :: AllFlags -> T.Text
|
formatFlagFile :: RawFlags -> T.Text
|
||||||
formatFlagFile = mconcat . map fLine . Map.assocs
|
formatFlagFile = mconcat . map fLine . Map.assocs
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ lLine = do
|
||||||
hidden lNewlines
|
hidden lNewlines
|
||||||
pure (a, f)
|
pure (a, f)
|
||||||
|
|
||||||
parseFlagFile :: Parser AllFlags
|
parseFlagFile :: Parser RawFlags
|
||||||
parseFlagFile = space *> many lNewline *> (Map.fromList <$> many lLine) <* hidden eof
|
parseFlagFile = space *> many lNewline *> (Map.fromList <$> many lLine) <* hidden eof
|
||||||
|
|
||||||
readFlagFile :: FilePath -> T.Text -> Either WeedErrorBundle AllFlags
|
readFlagFile :: FilePath -> T.Text -> Either WeedErrorBundle RawFlags
|
||||||
readFlagFile filename input = parse parseFlagFile filename input
|
readFlagFile filename input = parse parseFlagFile filename input
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue