Skip to content

Commit

Permalink
Added top-level try optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mie6 committed Aug 13, 2021
1 parent c8cb116 commit 370d741
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion parsley/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@

## 1.0.0.1 -- 2021-06-29

* Improved implementation of `oneOf` and `noneOf` to use ranges and not exhaustive character search
* Improved implementation of `oneOf` and `noneOf` to use ranges and not exhaustive character search

## 1.0.0.2 -- 2021-08-13

* Added small optimisation to accomodate new core changes: added `try` for all top-level parsers.
2 changes: 1 addition & 1 deletion parsley/src/ghc/Parsley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ the compilation pipeline when "Parsley.Internal.Verbose" is imported.
runParser :: (Trace, Input input)
=> Parser a -- ^ The parser to be compiled
-> Code (input -> Maybe a) -- ^ The generated parsing function
runParser p = [||\input -> $$(eval [||input||] (compile p codeGen))||]
runParser p = [||\input -> $$(eval [||input||] (compile (try p) codeGen))||]

{-|
This function generates a function that reads input from a file
Expand Down

0 comments on commit 370d741

Please sign in to comment.