Commit Graph

314 Commits

Author SHA1 Message Date
mrkkrp
e651e689c3 Update my email address
[skip ci]
2017-05-24 19:30:10 +07:00
Mark Karpov
9453b9eda4 Define ‘Semigroup’ and ‘Monoid’ for ‘ParsecT’ (#203) 2017-04-29 23:34:18 +03:00
Mark Karpov
15b645f08e Add ‘getNextTokenPosition’ (#202) 2017-04-29 16:40:04 +03:00
mrkkrp
e87c1e770e Change “rest of” to “the rest of” 2017-04-10 19:59:51 +03:00
mrkkrp
95f99774dc Various minor corrections to the docs 2017-04-02 21:52:04 +03:00
Vladislav Zavialov
ae19a87cbf Make () an error component (#193) 2017-03-05 17:06:47 +04:00
Mark Karpov
8ed11716e7 Add the ‘region’ combinator (#192)
Close #187.
2017-03-03 03:45:38 +04:00
mrkkrp
44b6b960a0 Clarify the result of ‘updatePos’
Close #189.
2017-02-26 14:42:17 +03:00
mrkkrp
f021a86a1f Clarify the example in docs for ‘try’
Close #186.
2017-02-16 17:55:31 +03:00
Mark Karpov
e809c56b45 Implement the ‘match’ combinator (#184) 2017-02-06 22:31:10 +04:00
Mark Karpov
cb978200d5 Fix subtle ‘indentBlock’ bugs, add new tests (#182) 2017-02-01 20:03:02 +04:00
Mark Karpov
b307ba2342 Implement counting of processed tokens (#180) 2017-01-31 15:17:54 +04:00
Mark Karpov
63dcf13c09 Performance tweaks (#179)
* Use default implementation of ‘many’
* Improve ‘count’ and ‘count'’
* Update the ‘CHANGELOG.md’ file
2017-01-29 19:39:21 +04:00
mrkkrp
9459c8038b Include 2017 into copyright years range 2017-01-01 14:38:59 +03:00
Tomáš Janoušek
4147b2b103 Make indentBlock/IndentNone work with many like IndentMany/Some does (#161)
Even though the haddock for ‘Text.Megaparsec.Lexer.space’ says that

    Parsing of white space is an important part of any parser. We
    propose a convention where every lexeme parser assumes no spaces
    before the lexeme and consumes all spaces after the lexeme;

all the indentation-sensitive parsing combinators assume/consume whitespace
_before_ the thing to be parsed. This would normally mean they can't be used
with combinators like ‘many’ and ‘some’ without using ‘try’ (and sacrificing
performance). Fortunately ‘indentBlock’ also consumes whitespace _after_,
but unfortunately it didn't do that in the ‘IndentNone’ case. Now it does
and it works with many and some without try!
2016-12-28 02:12:57 +04:00
Mark Karpov
08d1ae8e61 Allow ‘many’ run parsers that do not consume input (#160) 2016-12-26 16:49:48 +04:00
mrkkrp
5aff6e3986 Mention ambiguous type variables and type signatures
Close #157.
2016-12-26 13:45:31 +03:00
mrkkrp
7505174218 Minor improvements in the docs of ‘Text.Megaparsec.Lexer’ module 2016-12-11 13:23:01 +03:00
mrkkrp
86cca77cf5 Update docs for ‘charLiteral’ to mention ‘\&’
Close #154.
2016-11-24 20:08:54 +03:00
Mark Karpov
dd2386aafc Add ‘MonadParsec’ instance for ‘RWST’ (#152) 2016-11-21 19:18:27 +04:00
Erik de Castro Lopo
56b72c8a68 Remove un-needed unsafeCoerce (#149)
`Pos` is a newtype wrapper around `Word` and the `unsafePos` function
is marked `INLINE`, so `unsafeCoerce` is complete overkill.
2016-10-10 12:29:40 +04:00
mrkkrp
e6c5c2beed Fix building with QuickCheck older than 2.9.0 2016-10-06 22:37:40 +03:00
mrkkrp
d1649b63ad Export ‘observing’ from ‘Text.Megaparsec’ 2016-10-04 10:07:06 +03:00
mrkkrp
97257f3c7f Add the ‘observing’ primitive
Close #145.
2016-10-02 19:38:50 +03:00
mrkkrp
01f828e5dd Add debugging primitive ‘dbg’ 2016-09-30 13:34:58 +03:00
mrkkrp
4bc14d6668 Improve descriptions of backtracking primitives
Close #143.
2016-09-27 10:03:43 +03:00
mrkkrp
6772b88e93 Make ‘try’ truly backtrack parser state
Close #142.

This seemingly has no effect on performance.
2016-09-27 09:41:23 +03:00
Mark Karpov
735776519c Merge pull request #138 from mrkkrp/migrate-to-hspec
Re-write the tests with Hspec and more
2016-09-25 22:07:52 +04:00
mrkkrp
bd07032795 Fix the build 2016-09-25 18:42:21 +03:00
mrkkrp
6da7f86350 Migrate the test suite to Hspec 2016-09-24 19:32:50 +03:00
mrkkrp
be4478b840 Clarify behavior of ‘many’ and ‘some’
See #141.
2016-09-18 14:34:27 +03:00
mrkkrp
e8174d4700 Add some ‘Arbitrary’ instances 2016-09-04 16:44:24 +03:00
mrkkrp
badec4a9df Expose the ‘parseErrorTextPretty’ function
Close #137.
2016-09-04 14:48:40 +03:00
Albert Krewinkel
c234586435 Reflect renaming of alphaNum in docs (#136)
The `alphaNum` parser was renamed to `alphaNumChar`, yet the docs
weren't full updated to reflect this change.
2016-08-27 16:44:55 +04:00
mrkkrp
82994e45d4 Allow line comments end with end of input
Close #119.
2016-08-13 20:00:49 +03:00
mrkkrp
c4e1259cb9 Add a couple of articles into the docs 2016-08-13 19:22:33 +03:00
mrkkrp
38dd2112e3 Mention how to deal with case described in #129
Close #130.
2016-08-01 22:00:36 +03:00
mrkkrp
33098be1ea Define ‘displayException’ for ‘ParseError’ 2016-07-29 21:27:52 +03:00
mrkkrp
2a98741aba Inline ‘initialPos’ 2016-07-11 21:35:57 +03:00
mrkkrp
efe14cfa5f Derive ‘Data’, ‘Typeable’, ‘NFData’, for ‘State’ 2016-07-11 21:35:24 +03:00
mrkkrp
e24a78093f Derive ‘NFData’ for all data types in the library
Close #124.
2016-07-11 17:03:30 +03:00
Devon Hollowood
a803e3c68c Clarify error message for many parser
Close #122.
2016-07-09 13:25:59 +04:00
Daniel S. McCain
62ee63918c Add missing "to" to documentation 2016-06-24 14:00:26 +02:00
mrkkrp
7d47a7b8f9 Derive more ‘Data’ and ‘Typeable’ instances
Close #112. Derive ‘Data’ instance for ‘ParseError’, ‘Data’ and
‘Typeable’ instances for ‘SourcePos’.
2016-06-23 22:52:29 +03:00
mrkkrp
2062354709 Various corrections in ‘README.md’ and docs 2016-05-14 16:59:18 +07:00
mrkkrp
2a07087766 Initial implementation of line folding
Close #87.
2016-05-10 22:50:22 +07:00
mrkkrp
34f1f95294 Fix a typo ‘ManyIndent’ → ‘IndentMany’ 2016-05-04 16:42:10 +07:00
mrkkrp
3af8d25407 Improve handling of custom streams
This improves position reporting/advancing for ‘eof’, ‘token’, and
‘tokens’ combinators. Previously it was slightly incorrect for streams
consisting of custom token as new tests demonstrated.
2016-05-04 01:24:02 +07:00
mrkkrp
ae9ed355aa Inline functions in ‘Text.Megaparsec.Char’
This gives a nice speed up — not too surprising given size of the
functions, although it would be nice if GHC could figure this out by
itself too…
2016-05-02 01:00:59 +07:00
mrkkrp
f4f66222ec Improve performance of ‘(<*>)’
This handwritten version has proved to be more efficient from benchmarks
and profiling.
2016-05-02 00:59:58 +07:00