mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
cln: hlint: Rename pattern variables to avoid hlint parsing errors.
This commit is contained in:
parent
03db46cc81
commit
063aaf35b5
@ -50,8 +50,6 @@
|
||||
- ignore: {name: "Use second"}
|
||||
- ignore: {name: "Use fromRight"}
|
||||
- ignore: {name: "Use fromLeft"}
|
||||
- ignore: {name: "Parse error: on input `$*'"}
|
||||
- ignore: {name: "Parse error: on input `pattern'"}
|
||||
- ignore: {name: "Redundant bang pattern"}
|
||||
- ignore: {name: "Use zipWith"}
|
||||
- ignore: {name: "Replace case with maybe"}
|
||||
|
@ -199,7 +199,7 @@ words'' :: [T.Text] -> T.Text -> [T.Text]
|
||||
words'' prefixes = fromparse . parsewith maybeprefixedquotedphrases -- XXX
|
||||
where
|
||||
maybeprefixedquotedphrases :: SimpleTextParser [T.Text]
|
||||
maybeprefixedquotedphrases = choice' [prefixedQuotedPattern, singleQuotedPattern, doubleQuotedPattern, pattern] `sepBy` skipNonNewlineSpaces1
|
||||
maybeprefixedquotedphrases = choice' [prefixedQuotedPattern, singleQuotedPattern, doubleQuotedPattern, patterns] `sepBy` skipNonNewlineSpaces1
|
||||
prefixedQuotedPattern :: SimpleTextParser T.Text
|
||||
prefixedQuotedPattern = do
|
||||
not' <- fromMaybe "" `fmap` (optional $ string "not:")
|
||||
@ -214,8 +214,8 @@ words'' prefixes = fromparse . parsewith maybeprefixedquotedphrases -- XXX
|
||||
singleQuotedPattern = between (char '\'') (char '\'') (many $ noneOf ("'" :: [Char])) >>= return . stripquotes . T.pack
|
||||
doubleQuotedPattern :: SimpleTextParser T.Text
|
||||
doubleQuotedPattern = between (char '"') (char '"') (many $ noneOf ("\"" :: [Char])) >>= return . stripquotes . T.pack
|
||||
pattern :: SimpleTextParser T.Text
|
||||
pattern = fmap T.pack $ many (noneOf (" \n\r" :: [Char]))
|
||||
patterns :: SimpleTextParser T.Text
|
||||
patterns = fmap T.pack $ many (noneOf (" \n\r" :: [Char]))
|
||||
|
||||
-- XXX
|
||||
-- keep synced with patterns below, excluding "not"
|
||||
|
@ -134,10 +134,10 @@ words' :: String -> [String]
|
||||
words' "" = []
|
||||
words' s = map stripquotes $ fromparse $ parsewithString p s
|
||||
where
|
||||
p = do ss <- (singleQuotedPattern <|> doubleQuotedPattern <|> pattern) `sepBy` skipNonNewlineSpaces1
|
||||
p = do ss <- (singleQuotedPattern <|> doubleQuotedPattern <|> patterns) `sepBy` skipNonNewlineSpaces1
|
||||
-- eof
|
||||
return ss
|
||||
pattern = many (noneOf whitespacechars)
|
||||
patterns = many (noneOf whitespacechars)
|
||||
singleQuotedPattern = between (char '\'') (char '\'') (many $ noneOf "'")
|
||||
doubleQuotedPattern = between (char '"') (char '"') (many $ noneOf "\"")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user