on master help sign in
HLint fixes
commit076fb5534750aa3e758099088991e12b4068c7cd authorNeil Mitchell <ndmitchell@gmail.com> dateThu 30 Nov 2017, 21:02 (9 years ago) parentb144949
2 files changed+5−5
gen/Lib.hs+1−1 gen/Parser.hs+4−4
gen/Lib.hs+1−1
@@ -100,7 +100,7 @@ instance Show CharSet where
100100-- | Given we know the first argument are all true, can the second argument ever be False
101101implies :: [CharSet] -> CharSet -> Bool
102102implies known x = all (fromCharSet x) poss
103− where poss = filter (\c -> all (\k -> fromCharSet k c) known) chars
103+ where poss = filter (\c -> all (`fromCharSet` c) known) chars
104104
105105charSetC :: [CharSet] -> ([String], CharSet -> String)
106106charSetC sets =
gen/Parser.hs+4−4
@@ -12,8 +12,9 @@ data Out
1212 | TagComment | TagOpen | TagClose | TagOpenClose
1313 deriving Show
1414
15−isName1 x = x == ':' || x == '_' || (x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')
16−isName x = isName1 x || x == '-' || (x >= '0' && x <= '9')
15+is lower upper x = x >= lower && x <= upper
16+isName1 x = x == ':' || x == '_' || is 'a' 'z' x || is 'A' 'Z' x
17+isName x = isName1 x || x == '-' || is '0' '9' x
1718isSpace x = x == ' ' || x == '\t' || x == '\r' || x == '\n'
1819
1920whitespace = many $ match isSpace
@@ -52,8 +53,7 @@ tag = do
5253 let name_ = name `choice` abort "Missing tag name"
5354 choices
5455 [do lit "!--"
55− many $ do
56− lit "-->" -- FIXME: Not correct!!!
56+ many $ lit "-->" -- FIXME: Not correct!!!
5757 out TagComment
5858 ,do lit "?"
5959 name_