Kawaii-Parser 5.0.0 → 5.1.0
raw patch · 3 files changed
+5/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Parser.Files: Failed_to_find_the_file :: FilePath -> File_error
+ Parser.Files: Failed_to_find_file :: FilePath -> File_error
- Parser.Parser: filter_parser :: (Eq token, Monoid output) => (t -> Bool) -> (Location -> error) -> Parser token output error t -> Parser token output error t
+ Parser.Parser: filter_parser :: (Eq token, Monoid output) => (t -> Bool) -> (t -> Location -> error) -> Parser token output error t -> Parser token output error t
Files
- Kawaii-Parser.cabal +1/−1
- Parser/Files.hs +2/−2
- Parser/Parser.hs +2/−2
Kawaii-Parser.cabal view
@@ -11,7 +11,7 @@ maintainer: liisikerik@hotmail.com name: Kawaii-Parser synopsis: A simple parsing library and some additional utilities.-version: 5.0.0+version: 5.1.0 library build-depends: base < 4.22, containers, directory, mtl, transformers default-extensions: FlexibleContexts, ScopedTypeVariables, StandaloneDeriving
Parser/Files.hs view
@@ -31,7 +31,7 @@ -- | Relative directory. data Directory = Directory [Back] [String] -- | Errors.- data File_error = Failed_to_find_the_file FilePath | Invalid_file_path | Unexpected_extension Ext+ data File_error = Failed_to_find_file FilePath | Invalid_file_path | Unexpected_extension Ext -- | File extensions. type Ext = String -- | Relative file path.@@ -144,7 +144,7 @@ let file_path' = write_file_path file_path file_exits <- liftIO (doesPathExist file_path') case file_exits of- False -> throwError (Failed_to_find_the_file file_path')+ False -> throwError (Failed_to_find_file file_path') True -> liftIO (read_file' file_path')) tokenise :: Tokeniser () tokenise = void (parse_many tokenise_1)
Parser/Parser.hs view
@@ -109,12 +109,12 @@ filter_error err = Parser (\ tokens -> return (Just (Just (Left err), tokens))) -- | Filter parse results - for example, restrict an integer parser to positive numbers. You also have to provide an error. filter_parser :: (Eq token, Monoid output) =>- (t -> Bool) -> (Location -> error) -> Parser token output error t -> Parser token output error t+ (t -> Bool) -> (t -> Location -> error) -> Parser token output error t -> Parser token output error t filter_parser f err = fmap_filter_parser (\ x -> do- check err (f x)+ check (err x) (f x) Right x) -- | Filter and transform the parse results in one operation. You also have to provide an error. fmap_filter_parser :: (Eq token, Monoid output) =>