Commit Graph

438 Commits

Author SHA1 Message Date
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
Simon Shine
a01f655bbb Fixed typo (staring -> 'String') (#300) 2018-05-29 16:53:40 +07:00
mrkkrp
2944d4f2c5
Inline ‘decimal_’
Turns out not doing this is a major performance problem.
2018-05-19 21:25:23 +07:00
Timo von Holtz
0174a5513f Fix charLiteral for long character escape sequences (#297) 2018-05-18 22:03:15 +07:00
Mark Karpov
90966cb379
Implement continuous highlighting in parse errors (#296) 2018-05-09 18:37:28 +07:00
mrkkrp
1a459aa1b8
Simplify ‘Text.Megaparsec.Byte.Lexer.signed’ 2018-05-01 14:57:40 +07:00
mrkkrp
17bb876012
Clean up the signature of ‘Text.Megaparsec.Byte.Lexer.decimal’ 2018-05-01 14:50:01 +07:00
mrkkrp
3d4c22a71c
Inline more 2018-05-01 14:23:52 +07:00
mrkkrp
bde671f068
A whim 2018-05-01 14:20:41 +07:00
mrkkrp
a2175ea6db
Apply hlint recommendations 2018-04-30 21:32:58 +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
f49b9b479b
Fix docs of ‘Text.Megaparsec.Debug’
[skip ci]
2018-04-25 21:45:01 +07:00
mrkkrp
31b3fabd2a
Drop a redundant superclass of ‘MonadParsec’ 2018-04-22 00:28:20 +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
mrkkrp
e1dac29576 Documentation improvements (internal module)
[skip ci]
2018-03-27 23:53:11 +07:00
mrkkrp
5edb5951a8 Fix a typo
[skip ci]
2018-03-27 23:47:15 +07:00
mrkkrp
370f869d64 Add a note about monadic vs applicative combinators 2018-03-27 22:21:31 +07:00
Mark Karpov
e3ce90bd73 Add ‘Text.Megaparsec.Internal’ (#288) 2018-03-27 22:02:24 +07:00
Mark Karpov
fd7f214e54
Enable more warnings (#285) 2018-03-21 17:25:26 +07:00
Mark Karpov
08b6cfcdba Test with GHC 8.4.1 (#281) 2018-03-11 17:51:38 +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
mrkkrp
cb762351d0 Include 2018 into the copyright years range
[skip ci]
2018-01-01 14:04:07 +07:00
mrkkrp
966768acbe Promote ‘Control.Monad.Combinators.NonEmpty’ in the docs
[skip ci]
2017-12-31 16:05:56 +07:00
Mark Karpov
c776fc16fb Use parser combinators 0.4.0 (#269) 2017-12-31 16:02:03 +07:00
mrkkrp
b7fd455ec0 Simplify the definition of ‘signed’ 2017-12-22 22:56:35 +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
3c0d961a7d Add ‘since’ notes to some instance declarations 2017-12-14 12:06:20 +07:00
mrkkrp
9ef762fef8 Minor corrections and a test for the last PR 2017-12-14 11:35:36 +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
mrkkrp
b06b93a678 Add a couple of missing articles
[skip ci]
2017-12-10 16:54:32 +07:00
mrkkrp
a69f955f75 Adjust documentation for the ‘Hints’ type 2017-12-09 11:40:34 +07:00
Nathan Collins
8dc71651cf Improve documentation of lexeme conventions
[skip ci]

Move the discussion of lexeme assumptions from the bottom of the already
very long documentation for ‘space’ to the top-level module documentation,
and bold the key convention that lexeme parsers assume no space before and
consume all space after the lexeme they parse.
2017-11-16 15:44:50 +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
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
Mark Karpov
5b6f6f30cf Fix rendering of offending line with tabs (#241) 2017-08-08 14:59:24 +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
71c5033394 Fix a bug about indentation level of first item with ‘IndentSome’ 2017-07-26 14:48:29 +07:00
mrkkrp
2549544401 Fix a bug in ‘selectLine’ 2017-07-26 13:52:59 +07:00
mrkkrp
2a559aab34 Ensure that space consuming parser is hidden in ‘space’ (lexer) 2017-07-25 20:35:00 +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
9a38f8318e Minor corrections
[skip ci]
2017-07-05 17:58:32 +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
394d3fa456 Fix a bug in ‘char'’ 2017-07-04 13:23:33 +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
bda5fc822a Move error construction helpers into the library (#224) 2017-06-29 18:33:47 +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
ca564d1113 Display control characters in strings nicely (#221) 2017-06-26 23:23:53 +07:00
mrkkrp
432d1722ce Link more functions in ‘Text.Megaparsec.Char’ 2017-06-22 22:37:19 +07:00
mrkkrp
5c27c218b2 Add more safety to the ‘categoryName’ function 2017-06-22 22:08:56 +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
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