Mercurial > lbo > hg > pcombinators
changeset 19:8072bf66cba3 draft
Add elementary documetation.
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Sun, 19 May 2019 21:26:37 +0200 |
parents | 55a0151ea8bd |
children | 91026ea6211d |
files | pcombinators/combinators.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pcombinators/combinators.py Sun May 19 21:20:38 2019 +0200 +++ b/pcombinators/combinators.py Sun May 19 21:26:37 2019 +0200 @@ -7,8 +7,6 @@ by all Parser's parse() method. """ -import re - class Util: def extend_results(a, e): if isinstance(e, list): @@ -27,6 +25,7 @@ _index = 0 def __init__(self, s): + """Create a ParseState object from str s, representing the input to be parsed.""" self._input = s def __repr__(self): @@ -70,6 +69,9 @@ type = None def parse(self, st): + """Call parse() on any class inheriting from this one. It will consume + the ParseState st and return the parse result (depending on the parsers used). + """ return (None, st) def __add__(self, other):