Commit Graph

9 Commits

Author SHA1 Message Date
Albert Netymk
189106f001 Remove try in float parser.
According to this post
(http://blog.ezyang.com/2014/05/parsec-try-a-or-b-considered-harmful/),
the error message could be confusing if using `try`. `"3.a"` is one case
to expose this behavior.
2015-07-31 23:45:42 +02:00
mrkkrp
1ce541aaba remove word ‘unsigned’ from descriptions 2015-08-01 01:31:31 +06:00
mrkkrp
7c0341af72 the grammars overlap so there should be a ‘try’ 2015-07-31 20:31:38 +06:00
mrkkrp
c5bcdfb220 rewritten parsing of numbers, fixes #2 and #3
Changed how numbers are parsed because they were parsed in a naïf and
hairy way. Added tests for #2 and #3 (in old Parsec project these are
number 35 and 39 respectively).

* Since Haskell report doesn't say anything about sign, I've made
  ‘integer’ and ‘float’ parse numbers without sign.

* Removed ‘natural’ parser, it's equal to new ‘integer’ now.

* Renamed ‘naturalOrFloat’ → ‘number’ — this doesn't parse sign too.

* Added new combinator ‘signed’ to parse all sorts of signed numbers.

* For the sake of convenience I've added ‘integer'’, ‘float'’, and
 ‘number'’ combinators that also can parse signed numbers out of box.
2015-07-31 17:30:38 +06:00
mrkkrp
b936e3c3a9 improved documentation, fixes #1 2015-07-31 00:36:54 +06:00
mrkkrp
773e9ccabe cosmetic changes in copyright (headers) 2015-07-30 22:20:37 +06:00
mrkkrp
e6f2379b22 refactoring, phase 3 2015-07-30 21:45:06 +06:00
mrkkrp
137ce0a521 refactoring, phase 2 2015-07-29 14:44:58 +06:00
mrkkrp
227667f829 refactoring, phase 1 2015-07-28 19:32:19 +06:00