Commit Graph

141 Commits

Author SHA1 Message Date
mrkkrp
87d425759a Simplify type signatures of ‘reachOffset’ and ‘reachOffsetNoLine’
Changed type signatures of ‘reachOffset’ and ‘reachOffsetNoLine’ methods of
the ‘Stream’ type class. Instead of three-tuple ‘reachOffset’ now returns
two-tuple because ‘SourcePos’ is already contained in the returned
‘PosState’ record.
2019-07-13 17:37:46 +02:00
mrkkrp
42af70a0a0 Drop support for GHC 8.0 2019-07-02 21:06:29 +02:00
mrkkrp
d391a98177 Generalize numeric parsers in lexer modules
It appears that we can relax constraints for ‘decimal’, ‘binary’, ‘octal’,
and ‘hexadecimal’ from ‘Integral’ to ‘Num’ keeping the same implementations.
2019-07-02 19:58:34 +02:00
mrkkrp
570a50e597 Put tests in a separatate package
Separate the test suite into its own package. The reason is that we can
avoid circular dependency on ‘hspec-megaparsec’ and thus avoid keeping
copies of its source files in our test suite, as we had to do before.
Another benefit is that we can export some auxiliary functions in
‘megaparsec-tests’ which can be used by other test suites, for example in
the ‘parser-combinators-tests’ package.

Version of ‘megaparsec-tests’ will be kept in sync with versions of
‘megaparsec’ from now on.
2019-05-01 19:46:04 +02:00
mrkkrp
48cd5aeaa5
Update the changelog for version 7.0.5
[skip ci]
2019-04-30 22:14:14 +02:00
mrkkrp
b200b09830
Numerous documentation corrections 2018-11-07 12:21:00 +07:00
mrkkrp
290dab4f61
Update the changelog for version 7.0.3
[skip ci]
2018-10-31 17:50:00 +07:00
mrkkrp
ddc6256f16
Update the changelog for version 7.0.2
[skip ci]
2018-10-21 17:29:26 +07:00
Mark Karpov
a6985ad98b
Fix a bug in ‘errorBundlePretty’ (#322)
Previously the question sign ‘?’ was erroneously inserted before offending
line in 2nd and later parse errors.
2018-09-15 16:06:02 +07:00
mrkkrp
dd9d7c43dd
Some adjustments to the changelog for version 7.0.0
[skip ci]
2018-09-04 22:26:28 +07:00
mrkkrp
736921b798
Mention the adjustment to the ‘label’ primitive in the changelog
[skip ci]
2018-09-04 22:22:25 +07:00
Mark Karpov
9698fe325c
Implement the ‘attachSourcePos’ function (#320) 2018-09-03 22:16:27 +07:00
Mark Karpov
573bacf721
Use offset in parse errors (#313)
The change allows to speed-up parsers in most cases and re-use the fact that
we're traversing input stream on pretty-printing ‘ParseError’s anyway.
2018-08-20 23:35:10 +07:00
mrkkrp
269ad9091f
Fix a typo in the changelog
[skip ci]
2018-08-16 19:57:58 +07:00
Mark Karpov
65adeb7574
Improve case-insensitive char matching (#310)
Improved case-insensitive character matching in the cases when e.g.
‘isLower’ and ‘isUpper’ both return ‘False’. Functions affected:
‘Text.Megaparsec.Char.char'’.

Also re-implemented ‘Text.Megaparsec.Byte.char'’ without semantic changes.
2018-07-22 14:29:09 +07:00
Mark Karpov
4ea6a01896
Introduce parse error bundle (#306)
* Introduce parse error bundle

* Update the changelog (parse error bundle)
2018-07-15 20:01:35 +07:00
Mark Karpov
6a88c01eb2
Refactoring of stream-specific modules (#305)
Stream specific modules should not import form each other.
2018-07-08 22:11:31 +07:00
Vladislav Zavialov
b804acdf85 Add 'withParsecT' and 'mapParseError' (#303) 2018-07-05 11:00:17 +07:00
Gaith Hallak
f3e26a4223
Add ‘binDigitChar’ and ‘binary’ 2018-06-23 15:40:35 +07:00
mrkkrp
d11bd696d6
Add changelog entry for the ‘charLiteral’ fix and a new test
It appears that 9 is quite enough here.
2018-05-18 23:05:12 +07:00
Mark Karpov
90966cb379
Implement continuous highlighting in parse errors (#296) 2018-05-09 18:37:28 +07:00
Mark Karpov
517fbca634
Drop ‘Text.Megaparsec.Expr’ (#294) 2018-04-28 18:48:17 +07:00
Mark Karpov
8f21659822
Drop ‘Text.Megaparsec.Perm’ (#292)
In favor of ‘Control.Applicative.Premutations’, and so we add tests for that
module.
2018-04-27 17:13:27 +07:00
mrkkrp
7120bae9b2
Drop stacks of source positions 2018-04-20 19:24:05 +07:00
mrkkrp
cdbbe5c3d0
Move ‘dbg’ into a separate module 2018-04-20 14:20:43 +07:00
mrkkrp
2d175cd706
Drop support for GHC 7.8 2018-04-20 13:07:16 +07:00
Mark Karpov
e3ce90bd73 Add ‘Text.Megaparsec.Internal’ (#288) 2018-03-27 22:02:24 +07:00
Mark Karpov
adce847803 Fix backtracking of exponent and fractional parts in numeric helpers (#279)
‘scientific’ now correctly backtracks after attempting to parse fractional
and exponent parts of a number. ‘float’ correctly backtracks after
attempting to parse optional exponent part (when it comes after fractional
part, otherwise it's obligatory).
2018-03-04 20:34:48 +07:00
Mark Karpov
4fac009b48
Move general-enough combinators to ‘Text.Megaparsec’ (#267) 2018-01-08 22:39:39 +07:00
Mark Karpov
c776fc16fb Use parser combinators 0.4.0 (#269) 2017-12-31 16:02:03 +07:00
Mark Karpov
d3e29619cc
Simplify the type of the ‘token’ primitive (#266) 2017-12-17 22:03:03 +07:00
Mark Karpov
aee96cd519
Make ‘atEnd’ not produce hints (#264) 2017-12-17 13:03:56 +07:00
mrkkrp
cd14be5db1 A minor correction in the changelog
[skip ci]
2017-12-15 11:49:55 +07:00
mrkkrp
f4ded98663 There will be no ‘megaparsec-6.2.1’
[skip ci]
2017-12-14 12:06:53 +07:00
Vladislav Zavialov
58ab67759f Add the 'customFailure' combinator (#260) 2017-12-14 11:20:04 +07:00
Vladislav Zavialov
576c29aefd Add an IsString instance and tests for it (#259) 2017-12-13 22:14:22 +07:00
Mark Karpov
b99174d7f1 Make ‘sconcat’ more efficient on ‘ParsecT’ (#253)
* Make ‘sconcat’ more efficient on ‘ParsecT’

* Do the same thing for ‘mconcat’
2017-10-15 16:26:28 +07:00
mrkkrp
07160049a8 Make ‘float’ consume only floating point literals
Now it no longer accepts plain integers, which should be a better behavior.
2017-09-21 22:01:39 +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
Mark Karpov
5b6f6f30cf Fix rendering of offending line with tabs (#241) 2017-08-08 14:59:24 +07:00
mrkkrp
9a065e27b3 Allow ‘parser-combinators-0.2.0’ 2017-07-31 12:22:03 +07:00
mrkkrp
2484ee6a05 Update the changelog
[skip ci]
2017-07-28 11:47:09 +07:00
mrkkrp
1cfec2512a A minor tweak in ‘CHANGELOG.md’
[skip ci]
2017-07-25 16:56:12 +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