Commit Graph

74 Commits

Author SHA1 Message Date
mrkkrp
10c3d7b6cf Update per-argument docs of ‘tokens’
[skip ci]
2017-08-26 20:57:05 +07:00
Mark Karpov
e2abc9ee5d Use ‘eok’ continuation in ‘tokens’ when matching empty chunk (#246) 2017-08-14 17:46:59 +07:00
Mark Karpov
aac10c8bee Add hint erasing when try backtracks consuming (#243) 2017-08-08 16:36:47 +07:00
Profpatsch
c8ed8d0112 Clarify the difference between ‘pure’ and ‘empty’ 2017-08-08 15:05:38 +07:00
mrkkrp
390560f177 Add a note about ‘Control.Applicative.Combinators.NonEmpty’ 2017-07-30 23:14:08 +07:00
mrkkrp
dbc7f52daa Add a note about the ‘ParseError’ type 2017-07-28 11:28:16 +07:00
mrkkrp
a745b27f36 Documentation corrections and improvements 2017-07-25 16:45:15 +07:00
Mark Karpov
7cbab7c2ea Implement rendering of parse error context (#236) 2017-07-25 14:36:40 +07:00
Mark Karpov
214d1f2c18 Speed-up numeric parsers (#232) 2017-07-10 00:12:23 +07:00
mrkkrp
9e7b9aa7d5 Rename ‘Text.Megaparsec.Lexer’ to ‘Text.Megaparsec.Char.Lexer’
Also numerous documentation improvements and some inlineable pragmas.
2017-07-04 17:12:35 +07:00
mrkkrp
dfdabe54e1 Add ‘takeP’, ‘takeRest’, and ‘atEnd’ 2017-07-03 23:10:22 +07:00
Mark Karpov
3b9812bf76 Char and byte modules (#230) 2017-07-03 18:34:00 +07:00
Mark Karpov
45f30ae7e1 Extending stream (#229) 2017-07-02 23:56:01 +07:00
Mark Karpov
785d006f02 Documentation improvements (#228)
[skip ci]
2017-06-30 00:16:24 +07:00
Roman Cheplyaka
0919338c4b Add a MonadFix ParsecT instance (#225) 2017-06-29 20:23:03 +07:00
Mark Karpov
cec0987264 Separate trivial and fancy parse errors (#223) 2017-06-29 12:13:22 +07:00
Mark Karpov
5ed815fde4 Refactor pos and error modules (#222) 2017-06-28 14:08:26 +07:00
Mark Karpov
3ec48d12b9 Reorganize modules (#217) 2017-06-15 02:12:18 +07:00
Mark Karpov
d35cdd2e33 Drop per-stream type modules (#215) 2017-06-13 23:14:31 +07:00
mrkkrp
5a8d8f181a Update location of the tutorials 2017-06-08 17:33:14 +07:00
mrkkrp
ce7228346a Improve the documentation 2017-05-25 19:52:34 +07:00
mrkkrp
e651e689c3 Update my email address
[skip ci]
2017-05-24 19:30:10 +07:00
Mark Karpov
15b645f08e Add ‘getNextTokenPosition’ (#202) 2017-04-29 16:40:04 +03:00
mrkkrp
95f99774dc Various minor corrections to the docs 2017-04-02 21:52:04 +03:00
Mark Karpov
8ed11716e7 Add the ‘region’ combinator (#192)
Close #187.
2017-03-03 03:45:38 +04:00
Mark Karpov
e809c56b45 Implement the ‘match’ combinator (#184) 2017-02-06 22:31:10 +04:00
Mark Karpov
b307ba2342 Implement counting of processed tokens (#180) 2017-01-31 15:17:54 +04:00
mrkkrp
9459c8038b Include 2017 into copyright years range 2017-01-01 14:38:59 +03:00
mrkkrp
5aff6e3986 Mention ambiguous type variables and type signatures
Close #157.
2016-12-26 13:45:31 +03:00
mrkkrp
d1649b63ad Export ‘observing’ from ‘Text.Megaparsec’ 2016-10-04 10:07:06 +03:00
mrkkrp
01f828e5dd Add debugging primitive ‘dbg’ 2016-09-30 13:34:58 +03:00
mrkkrp
be4478b840 Clarify behavior of ‘many’ and ‘some’
See #141.
2016-09-18 14:34:27 +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
2062354709 Various corrections in ‘README.md’ and docs 2016-05-14 16:59:18 +07:00
mrkkrp
1094408b96 Add ‘pushPosition’ and ‘popPosition’
Close #83.
2016-04-27 00:04:56 +07:00
mrkkrp
f22cd69ff7 Cosmetic polishing 2016-04-26 00:37:06 +07:00
mrkkrp
17a6bb2baa Remove ‘MonadThrow’ instance, add ‘Dec’
‘Dec’ stands for “default error component”. We need this because
‘String’ looses information and thus we cannot write good enough tests
with it.
2016-04-22 19:48:34 +07:00
mrkkrp
84038a4fab Export ‘parseErrorPretty’ from ‘Text.Megaparsec’ 2016-04-18 20:48:31 +07:00
mrkkrp
acbae63a21 First attempt to outline Megaparsec 5.0.0
This is rather a sketch, we need to work on documentation, tests, and
perhaps on performance, but it should show the direction Megaparsec
5.0.0 is taking.
2016-04-17 20:08:13 +07:00
mrkkrp
b0124d1ea2 Remove ‘parseFromFile’ and ‘StorableStream’
Removed ‘parseFromFile’ and ‘StorableStream’ type-class that was
necessary for it. The reason for removal is that reading from file and
then parsing its contents is trivial for every instance of ‘Stream’ and
this function provides no way to use newer methods for running a parser,
such as ‘runParser'’. So, simply put, it adds little value and was
included in 4.x versions for compatibility purposes.
2016-02-22 19:52:57 +06:00
mrkkrp
52b41d4992 Add the ‘eitherP’ combinator
Close #85.
2016-02-18 14:46:55 +06:00
mrkkrp
3edbe9f54a Implement the recovery feature
Close #80.
2016-02-09 13:59:21 +06:00
mrkkrp
e5508941c8 Add year 2016 to copyright notices 2016-01-09 18:56:33 +06:00
mrkkrp
c7ed5fe909 after some consulting, it should be “FreeBSD”
What Parsec used is called “FreeBSD” or “BSD 2 clause”. Addition of the
third clause may require contacting all the authors. To hell with it,
let it be “FreeBSD” (which is anyway better than “BSD-like”), I'm a
hacker, not a lawyer (tm).
2015-10-30 17:26:45 +06:00
mrkkrp
503a1db4be clarify used license and add missing clause
This commit clarifies license of the software replacing “BSD3” with more
conventional “BSD 3 clause”.

Another change is addition of the third clause originally missing in
license of Parsec (which is licensed under BSD 2 clause license). The
addition of the third clause in form:

* Neither the names of the copyright holders nor the names of
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

does not violate original BSD 2 clause license effectively making it BSD
3 clause license (which I find preferable).
2015-10-30 13:52:30 +06:00
mrkkrp
6aedfdbc79 removed deprecated combinators
Expression parser should be improved a bit now before 4.2.0 is released,
see #64.
2015-10-26 18:54:02 +06:00
mrkkrp
354760202e introduced ‘failure’ method of ‘MonadParsec’
Close #43.

The method allows to fail with arbitrary collection of
messages. ‘unexpected’ is not defined in terms of ‘failure’. One
consequence of this design decision is that ‘failure’ is now method of
‘MonadParsec’, while ‘unexpected’ is not.
2015-10-26 13:52:21 +06:00
mrkkrp
a5819c6d00 allow to supply and extract parser state
Close #47, close #57.

This commit introduces ‘runParser'’ and ‘runParserT'’ functions that
take and return parser state. This makes it possible to partially parse
input, resume parsing, specify non-standard initial textual position,
etc.

Internal changes involve some refactoring to make ‘Reply’ more
readable and facilitate extraction of complete parser state on failure
as well as success.

The commit adds basic tests for the new functionality as well.
2015-10-26 02:13:39 +06:00
mrkkrp
7043a6fbc0 move ‘parseFromFile’ to ‘Text.Megaparsec.Prim’
Close #65.

Previously we had 5 nearly identical definitions of the function,
varying only in type-specific ‘readFile’ function. Now the problem is
solved by introduction of ‘StorableStream’ type class. All supported
stream types are instances of the class out of box and thus we have
polymorphic version of ‘parseFromFile’.
2015-10-22 15:32:33 +06:00
mrkkrp
f3be336ebe fix implementation of ‘sepEndBy’ and ‘sepEndBy1’
Fixes #63.

Deprecation notes were removed and new tests written.
2015-10-20 16:37:24 +06:00