Commit Graph

17 Commits

Author SHA1 Message Date
mrkkrp
e5508941c8 Add year 2016 to copyright notices 2016-01-09 18:56:33 +06:00
mrkkrp
ac62addce8 cosmetic improvements 2015-11-07 16:24:45 +06:00
mrkkrp
f129683dca new tests for ‘Text.Megaparsec.Expr’
These check error messages in some cases.
2015-11-03 17:42:01 +06:00
mrkkrp
60910b520f don't parse row of prefix/postfix operators
After some thinking I decided that this may be not desirable in some
cases, so we should not enable it by default. I've edited documentation
of ‘makeExprParser’ to explain why this doesn't work by default and how
to make it work.
2015-11-03 16:09:35 +06:00
mrkkrp
d595562e88 allow to parse rows of prefix/postfix operators
Close #64.

‘makeExprParser’ now generates parser that can handle several
occurrences of the same prefix or postfix operator in a row. This allows
to parse something like C pointers (for example ‘**i’) without resorting
to hacks.

The feature is experimental, I'm not entirely sure it's not
buggy. Upcoming additional tests for ‘Text.Megaparsec.Expr’ will show
whether it behaves correctly in all cases and doesn't have adverse
effects. For now, I've edited existing test to generate data with
repeating prefix negations and postfix factorials. Current code-base
passes the test.
2015-11-03 01:55:18 +06:00
mrkkrp
f7f3b02e45 uppercase disclaimer in license
Otherwise it may look like “fine print” for some. Crazy…
2015-10-30 19:43:34 +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
aad1702589 use ‘if’ instead of ‘bool’
This should make maintenance a bit easier. After all ‘if’ looks even
better than ‘bool’ in many cases.
2015-10-22 14:34:25 +06:00
mrkkrp
2b6df377ef a minor cosmetic change in ‘tests/Expr.hs’ 2015-10-16 00:01:15 +06:00
mrkkrp
f0874ae8ad a couple of cosmetic corrections 2015-10-05 00:27:34 +06:00
Benjamin Kaestner
3078c04f8f Add #if for bool in tests 2015-10-03 17:00:29 +02:00
Benjamin Kaestner
d97398a016 Add compatibility to base-4.7.0.x
This patch introduces compatibility to base-4.7.0.x. It was tested
on Win 8.1 x86_64, using GHC 7.8.4. It mainly consists of a bunch
of #if !MIN_VERSION(4,8,0) ... #endif additions and a lower bound
on base in the cabal file as well as a general introduction of the
CPP extension via default-extensions.

It also removes a potential error source in tests/Util.hs, since
the backslash in /=\ can lead to strange quirks on certain systems
(backslash and newline only separated by whitespace).

Other, squashed commits:

- Remove 'recent version of base' from Readme

- Change necessary version of GHC
2015-09-30 20:18:25 +02:00
mrkkrp
5242b8d5fd minor changes in tests to make them compile
Recent changes (mainly eliminating of built-in backtracking user state)
require some changes in the tests.
2015-09-18 15:41:18 +06:00
mrkkrp
2ca6316f33 renamed ‘Text.Megaparsec.Token’ module
Now it's called ‘Text.Megaparsec.Lexer’. This commit contains other
cosmetic changes as well.
2015-08-30 16:00:07 +06:00
mrkkrp
b35ecbc31f added tests for ‘Text.Megaparsec.Expr’
The single test covers 100 % of the module's code. However it doesn't
check quality of error messages, so we still have room for improvement.

Manual tests show that error messages are good.
2015-08-29 22:24:55 +06:00
mrkkrp
866bcdec58 some tests written 2015-08-03 13:19:23 +06:00