Commit Graph

140 Commits

Author SHA1 Message Date
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
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
8f43fdc3f6 Drop support for GHC 7.6 (#166) 2017-02-01 22:01:18 +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
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
4de9da0bbc Fix a typo in the test suite 2016-11-25 18:09:37 +03:00
Mark Karpov
dd2386aafc Add ‘MonadParsec’ instance for ‘RWST’ (#152) 2016-11-21 19:18:27 +04:00
mrkkrp
e6c5c2beed Fix building with QuickCheck older than 2.9.0 2016-10-06 22:37:40 +03:00
mrkkrp
0367967161 Avoid flood of debugging info on testing 2016-10-06 22:30:28 +03:00
mrkkrp
dcf484889d Increase coverage 2016-10-03 12:37:30 +03:00
mrkkrp
3a147e6cde Add tests for the new ‘observing’ primitive 2016-10-02 19:38:50 +03:00
mrkkrp
4e3a36ef93 Add tests for the new ‘dbg’ function 2016-09-30 13:35:02 +03:00
mrkkrp
9fd109d0e8 Improve coverage of some primitives 2016-09-27 11:42:13 +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
mrkkrp
dfbc6f0893 Minor corrections in test suite, improve coverage 2016-09-27 00:23:17 +03: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
82994e45d4 Allow line comments end with end of input
Close #119.
2016-08-13 20:00:49 +03:00
mrkkrp
6a7c41d889 Don't allow very big values of ‘Pos’ in tests
This is unrealistic and leads to false failures.
2016-08-04 09:38:54 +03:00
mrkkrp
7beca0c585 Fix the build with ‘QuickCheck-2.9’ and later 2016-07-24 13:06:52 +03:00
mrkkrp
e39fd663ca Minor corrections and add test for ‘lineFold’ 2016-05-10 22:51:40 +07:00
mrkkrp
a74bcd1499 Add ‘checkCase’ (rename old one to ‘checkCase'’) 2016-05-10 22:51:23 +07:00
mrkkrp
dc63a8f893 Add tests to cover new API for position advancing
Close #102.
2016-05-04 00:53:09 +07:00
mrkkrp
59c01cba67 Improve some existing tests to increase coverage 2016-05-02 21:51:06 +07:00
mrkkrp
2385cf5867 Add a test for ‘parseMaybe’ 2016-04-30 19:02:26 +07:00
mrkkrp
49303f18c4 Add a trivial test for ‘MonadIO’ instance 2016-04-30 18:32:50 +07:00
mrkkrp
2eddd78f0f Tests for ‘updatePos’ (different types of streams) 2016-04-30 18:22:00 +07:00
mrkkrp
3195a97776 Add new tests for ‘showTokens’ and pretty-printing 2016-04-30 17:31:52 +07:00
mrkkrp
1094408b96 Add ‘pushPosition’ and ‘popPosition’
Close #83.
2016-04-27 00:04:56 +07:00
mrkkrp
8e095bab8c A correction to ‘getPosition’ and ‘setPosition’
Make ‘getPosition’ and ‘setPosition’ work with current file, not with
the whole stack.
2016-04-26 23:01:09 +07:00
mrkkrp
f22cd69ff7 Cosmetic polishing 2016-04-26 00:37:06 +07:00
mrkkrp
13578590da Adjustments for compatibility 2016-04-25 19:51:13 +07:00
mrkkrp
f576945a4a Update tests for ‘Text.Megaparsec.Lexer’ 2016-04-24 21:56:45 +07:00
mrkkrp
e11066f07a Update tests for ‘Text.Megaparsec.Expr’ 2016-04-24 21:56:45 +07:00
mrkkrp
98b08b752a Update tests for ‘Text.Megaparsec.Prim’ 2016-04-24 21:56:45 +07:00
mrkkrp
643842ac1e Update tests for ‘Text.Megaparsec.Perm’ 2016-04-24 21:56:45 +07:00
mrkkrp
9089ed3325 Update tests for ‘Text.Megaparsec.Combinator’ 2016-04-24 21:56:45 +07:00
mrkkrp
6f69306515 Update tests for ‘Text.Megaparsec.Char’ 2016-04-24 21:56:45 +07:00
mrkkrp
35dc3a4469 Write tests for the new ‘Text.Megaparsec.Error’ 2016-04-24 21:56:40 +07:00
mrkkrp
14b1aeea8a Write tests for the new ‘Text.Megaparsec.Pos’ 2016-04-24 20:21:36 +07:00
mrkkrp
a1df59221b Update ‘Util’ module in test suite 2016-04-24 20:21:07 +07:00
mrkkrp
a3254f5371 Move language extensions to files
This turns out that it's easier for readers to lookup the list of
extensions in current file than go to Cabal file.
2016-04-10 19:26:54 +07:00
mrkkrp
747993e0bb Add ‘skipBlockCommentNested’ function
Close #96.
2016-03-30 14:50:35 +06:00
mrkkrp
18d192ba70 Use ‘Scientific’ as target type for floats
Close #95.

Here we introduce ‘scientific’ parser that can parse arbitrary big
numbers without error or memory overflow. ‘float’ still returns
‘Double’, but it's defined in terms of ‘scientific’ now. Since
‘Scientific’ type can reliably represent integer values as well as
floating point values, ‘number’ now returns ‘Scientific’ instead of
‘Either Integer Double’ (‘Integer’ or ‘Double’ can be extracted from
‘Scientific’ value anyway). This in turn makes ‘signed’ parser more
natural and general, because we do not need ad-hoc ‘Signed’ type class
anymore.
2016-03-29 16:42:51 +06:00