Commit Graph

27 Commits

Author SHA1 Message Date
mrkkrp
a70e07a408 do not export ‘Consumed’ and ‘Reply’
‘Text.Megaparsec’ and ‘Text.Megaparsec.Prim’ do not export these data
types and their constructors anymore. These data types are rather
low-level implementation detail that should not be visible to
end-user. They are also subject to certain changes in future.
2015-10-06 22:36:59 +06:00
mrkkrp
17ba4fb4ee update changelog (GHC 7.6 is supported now) 2015-10-04 21:09:01 +06:00
mrkkrp
706ff2b964 update changelog 2015-10-01 15:55:38 +06:00
Mario Lang
50d631bdc2 Fix a typo. 2015-09-29 22:41:53 +02:00
mrkkrp
9774ed9de9 rename ‘parse'’ → ‘parseMaybe’ 2015-09-24 17:13:06 +06:00
mrkkrp
d0409a897e implemented flexible tab width
Closes #38.

Now tab width can be manipulated with via the following functions:

* ‘getTabWidth’
* ‘setTabWidth’

Other auxiliary changes were performed, such as updating of
‘updatePosChar’.

This also corrects a bit obsolete descriptions of some functions.
2015-09-23 16:47:17 +06:00
mrkkrp
17bdba05f7 revised ‘CHANGELOG.md’ 2015-09-21 18:53:23 +06:00
mrkkrp
7516ec4f23 added more case-insensitive character parsers
The following parsers are introduced:

* ‘char'’
* ‘oneOf'’
* ‘noneOf'’
2015-09-06 15:17:37 +06:00
mrkkrp
6ac08b0956 added new parser ‘string'’
This is like ‘string’, but is case-insensitive.
2015-09-04 18:12:59 +06:00
mrkkrp
2390f9f753 swap ‘count’ and ‘count'’ 2015-08-25 15:55:57 +06:00
mrkkrp
23b083cea6 deprecate some parsers, close #24
These parsers are considered deprecated:

* ‘chainl’
* ‘chainl1’
* ‘chainr’
* ‘chainr1’
* ‘sepEndBy’
* ‘sepEndBy1’

Apart from this, the commit includes various cosmetic changes in
module ‘Text.Megaparsec.Combinator’.
2015-08-25 02:04:10 +06:00
mrkkrp
b81962e44a added combinator ‘someTill’ 2015-08-23 23:12:45 +06:00
mrkkrp
d6947a901f various cosmetic changes (including renaming)
The following functions and data types have been renamed:

* ‘permute’ → ‘makePermParser’
* ‘buildExpressionParser’ → ‘makeExprParser’
* ‘GenLanguageDef’ → ‘LanguageDef’
* ‘GenTokenParser’ → ‘Lexer’
* ‘makeTokenParser’ → ‘makeLexer’
2015-08-23 21:07:03 +06:00
mrkkrp
6e5735167f flip argument order for ‘label’, close #21 2015-08-22 14:57:16 +06:00
mrkkrp
f9cfe390af various minor changes, renamed functions
Among other changes two functions have been renamed:

* ‘parseMaybe’ → ‘parse'’ (also added to change log)
* ‘putState’ → ‘setState’ (for consistency)
2015-08-20 16:37:52 +06:00
mrkkrp
110859b9c2 added new primitive combinator ‘hidden’
Added new primitive combinator ‘hidden p’ which hides “expected” tokens
in error message when parser ‘p’ fails.
2015-08-20 01:38:00 +06:00
mrkkrp
455bfa3076 major improvements of ‘Text.Megaparsec.Prim’
* Removed ‘optionMaybe’ parser, because ‘optional’ from
  ‘Control.Applicative’ does the same thing.

* Renamed ‘tokenPrim’ → ‘token’, removed old ‘token’, because
  ‘tokenPrim’ is more general and ‘token’ is little used.

* Fixed bug with ‘notFollowedBy’ always succeeded with parsers that
  don't consume input, see #6.

* Hint system introduced that greatly improved quality of error messages
  and made code of ‘Text.Megaparsec.Prim’ a lot clearer.

The improvements affected other modules too:

* Some parsers from ‘Text.Megaparsec.Combinators’ now live in
  ‘Text.Megaparsec.Prim’.

* Hint system improved error messages, so I needed to rewrite test for
  ‘Text.Megaparsec.Char.eol’, since it's error messages are very
  intelligent now and cannot be emulated by ‘newline’ and ‘crlf’ parsers
  used separately.

* Test for Bug9 from old-tests is passed successfully again.
2015-08-17 21:58:59 +06:00
mrkkrp
65fbedee1c added more powerful ‘count’ parser, close #17
This parser can be told to parse from ‘m’ to ‘n’ occurrences of some
thing. Old parser ‘count’ is now named ‘count’' and defined in terms of
that more powerful one.

This commit also reorders functions in module
‘Text.Megaparsec.Combinator’ and everywhere where the functions are
listed. The same order is used everywhere.
2015-08-13 01:02:33 +06:00
mrkkrp
77a54394b5 extend collection of character parsers, close #16
Added new character parsers in ‘Text.Megaparsec.Char’:

* ‘controlChar’
* ‘printChar’
* ‘markChar’
* ‘numberChar’
* ‘punctuationChar’
* ‘symbolChar’
* ‘separatorChar’
* ‘asciiChar’
* ‘latin1Char’
* ‘charCategory’

Renamed some parsers:

‘spaces’   → ‘space’
‘space’    → ‘spaceChar’
‘lower’    → ‘lowerChar’
‘upper’    → ‘upperChar’
‘letter’   → ‘letterChar’
‘alphaNum’ → ‘alphaNumChar’
‘digit’    → ‘digitChar’
‘octDigit’ → ‘octDigitChar’
‘hexDigit’ → ‘hexDigitChar’

Descriptions of old parsers have been updated to accent some
Unicode-specific moments. For example, old description of ‘letter’
stated that it parses letters from “a” to “z” and from “A” to “Z”. This
is wrong, since it used ‘Data.Char.isAlpha’ predicate internally and
thus parsed many more characters.
2015-08-12 23:00:03 +06:00
mrkkrp
08f2d0b3bd extend change log 2015-08-12 18:41:44 +06:00
mrkkrp
c4350dca37 further cosmetic changes in ‘Text.Megaparsec.Char’ 2015-08-09 00:37:51 +06:00
mrkkrp
3daa70f15a representation of tokens in error messages, fixed #12
* Type class ‘ShowToken’ introduced to pretty-print tokens.

* For now, we have defined instances for ‘String’ and ‘Char’.
2015-08-06 16:37:08 +06:00
mrkkrp
3ef5e5e621 renamed ‘MegaParsec’ → ‘Megaparsec’, close #10 2015-08-01 22:24:45 +06:00
mrkkrp
3c69bc8f48 re-export ‘(<|>)’, ‘many’, ‘some’, and ‘optional’, fixes #9
These functions are now re-exported from ‘Control.Applicative’
module. ‘many’ and ‘some’ are now part of ‘Alternative’ instance of
‘ParsecT’.

Note that these functions are re-exported only in ‘Text.MegaParsec’
module, but not in ‘Text.MegaParsec.Prim’ to avoid duplication of
floating doc-strings. Others internal modules now just casually import
‘Control.Applicative’ for their needs.

Note that ‘many1’ was renamed to ‘some’, the same is done for other
parsers that had ‘many1’ part in their names (for consistency).
2015-08-01 20:49:45 +06:00
mrkkrp
181bad13ec updated changelog 2015-07-31 20:13:38 +06:00
mrkkrp
227667f829 refactoring, phase 1 2015-07-28 19:32:19 +06:00
mrkkrp
d020e8e1f6 preparatory changes 2015-07-27 15:03:58 +06:00