Mercurial > lbo > hg > pcombinators
changeset 32:233370104f9d draft
Fix Float/Integer parsers: They need to inherit from Parser
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Wed, 22 May 2019 00:57:28 +0200 |
parents | 084d753d5b6a |
children | 26f8bc28ebfa |
files | pcombinators/primitives.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pcombinators/primitives.py Tue May 21 15:46:41 2019 +0200 +++ b/pcombinators/primitives.py Wed May 22 00:57:28 2019 +0200 @@ -127,7 +127,7 @@ # Optimized parsers -class Float(): +class Float(Parser): """Parses a float like [-]ddd[.ddd]. Float parses floats with more manual code, making it up to 40% faster than @@ -152,7 +152,7 @@ return float(big + '.' + small) * multiplier, st return float(big) * multiplier, st -class Integer(): +class Integer(Parser): """Parser for integers of form [-]dddd[...]. Result is int. This parser is up to twice as fast as CanonicalInteger and thus implemented