on master help sign in
Rename someSpace back
commit90ae69bd6d5d4034bc9e73cb955e3413a44f9b0f authorJason Felice <jason.m.felice@gmail.com> dateWed 1 Nov 2017, 22:17 (9 years ago) parentbd9ce0c
2 files changed+11−11
src/Idris/Package/Parser.hs+5−5 src/Idris/Parser/Helpers.hs+6−6
src/Idris/Package/Parser.hs+5−5
@@ -13,7 +13,7 @@ import Idris.Imports
1313import Idris.Package.Common
1414import Idris.Parser.Helpers (IdrisInnerParser, MonadicParsing, eol, iName, identifier, isEol,
1515 lchar, packageName, parseErrorDoc, reserved,
16− runparser, someSpace', stringLiteral)
16+ runparser, someSpace, stringLiteral)
1717
1818import Control.Applicative
1919import Control.Monad.State.Strict
@@ -48,7 +48,7 @@ pPkg :: PParser PkgDesc
4848pPkg = do
4949 reserved "package"
5050 p <- pPkgName
51− someSpace'
51+ someSpace
5252 modify $ \st -> st { pkgname = p }
5353 some pClause
5454 st <- get
@@ -99,10 +99,10 @@ filename = (do
9999 "filename must contain no directory component"
100100
101101textUntilEol :: MonadicParsing m => m String
102−textUntilEol = many (P.satisfy (not . isEol)) <* eol <* someSpace'
102+textUntilEol = many (P.satisfy (not . isEol)) <* eol <* someSpace
103103
104104clause :: String -> PParser a -> (PkgDesc -> a -> PkgDesc) -> PParser ()
105−clause name p f = do value <- reserved name *> lchar '=' *> p <* someSpace'
105+clause name p f = do value <- reserved name *> lchar '=' *> p <* someSpace
106106 modify $ \st -> f st value
107107
108108commaSep :: MonadicParsing m => m a -> m [a]
@@ -113,7 +113,7 @@ pClause = clause "executable" filename (\st v -> st { execout = Just v })
113113 <|> clause "main" (fst <$> iName []) (\st v -> st { idris_main = Just v })
114114 <|> clause "sourcedir" (fst <$> identifier) (\st v -> st { sourcedir = v })
115115 <|> clause "opts" (pureArgParser . words . fst <$> stringLiteral) (\st v -> st { idris_opts = v ++ idris_opts st })
116− <|> clause "pkgs" (commaSep (pPkgName <* someSpace')) (\st ps ->
116+ <|> clause "pkgs" (commaSep (pPkgName <* someSpace)) (\st ps ->
117117 let pkgs = pureArgParser $ concatMap (\x -> ["-p", show x]) ps
118118 in st { pkgdeps = ps `union` pkgdeps st
119119 , idris_opts = pkgs ++ idris_opts st })
src/Idris/Parser/Helpers.hs+6−6
@@ -52,8 +52,8 @@ parseErrorDoc = PP.string . parseErrorPretty
5252-- | Generalized monadic parsing constraint type
5353type MonadicParsing m = (P.MonadParsec Void String m)
5454
55−someSpace' :: MonadicParsing m => m ()
56−someSpace' = many (simpleWhiteSpace <|> singleLineComment <|> multiLineComment) *> pure ()
55+someSpace :: MonadicParsing m => m ()
56+someSpace = many (simpleWhiteSpace <|> singleLineComment <|> multiLineComment) *> pure ()
5757
5858tokenFC :: MonadicParsing m => m a -> m (a, FC)
5959tokenFC p = do (FC fn (sl, sc) _) <- getFC --TODO: Update after fixing getFC
@@ -186,7 +186,7 @@ docComment = do dc <- pushIndent *> docCommentLine
186186 contents <- P.option "" (do first <- P.satisfy (\c -> not (isEol c || c == '@'))
187187 res <- many (P.satisfy (not . isEol))
188188 return $ first:res)
189− eol ; someSpace'
189+ eol ; someSpace
190190 return contents
191191
192192 argDocCommentLine :: IdrisParser (Name, String)
@@ -197,12 +197,12 @@ docComment = do dc <- pushIndent *> docCommentLine
197197 n <- fst <$> name
198198 P.many (P.satisfy isSpace)
199199 docs <- P.many (P.satisfy (not . isEol))
200− P.eol ; someSpace'
200+ P.eol ; someSpace
201201 return (n, docs)
202202
203203-- | Parses some white space
204204whiteSpace :: MonadicParsing m => m ()
205−whiteSpace = someSpace' <|> pure ()
205+whiteSpace = someSpace <|> pure ()
206206
207207-- | Parses a string literal
208208stringLiteral :: MonadicParsing m => m (String, FC)
@@ -258,7 +258,7 @@ lcharFC ch = do (FC file (l, c) _) <- getFC
258258 return $ FC file (l, c) (l, c+1)
259259
260260symbol :: MonadicParsing m => String -> m ()
261−symbol = void . P.symbol someSpace'
261+symbol = void . P.symbol someSpace
262262
263263symbolFC :: MonadicParsing m => String -> m FC
264264symbolFC str = do (FC file (l, c) _) <- getFC