@@ -22,6 +22,8 @@ Parsy differentiates itself from other solutions with the following:
2222* it is not a parser generator, but a combinator based parsing library.
2323* a very clean implementation, only a few hundred lines, that borrows
2424 from the best of recent combinator libraries.
25+ * it produces fairly terse code, with an embedded DSL feel — not too far from
26+ things like EBNF notation or Haskell’s parsec.
2527* free, good quality documentation, all in one place. (Please raise an issue on
2628 GitHub if you have any problems, or find the documentation lacking in any
2729 way).
@@ -44,16 +46,16 @@ Example 1 - parsing a set of alternatives:
4446.. code-block :: python
4547
4648 >> > from parsy import string
47- >> > parser = (string(' Dr.' ) | string(' Mr.' ) | string(' Mrs.' )).desc(" title" )
48- >> > parser .parse(' Mrs.' )
49+ >> > title = (string(' Dr.' ) | string(' Mr.' ) | string(' Mrs.' )).desc(" title" )
50+ >> > title .parse(' Mrs.' )
4951 ' Mrs.'
50- >> > parser .parse(' Mr.' )
52+ >> > title .parse(' Mr.' )
5153 ' Mr.'
5254
53- >> > parser .parse(' Joe' )
55+ >> > title .parse(' Joe' )
5456 ParseError: expected title at 0 :0
5557
56- >> > parser .parse_partial(' Dr. Who' )
58+ >> > title .parse_partial(' Dr. Who' )
5759 (' Dr.' , ' Who' )
5860
5961 Example 2 - Parsing a dd-mm-yy date:
@@ -68,6 +70,8 @@ Example 2 - Parsing a dd-mm-yy date:
6870 datetime.date(2014 , 5 , 6 )
6971
7072
73+
74+
7175 To learn how to use parsy, you should continue with:
7276
7377* the :doc: `tutorial </tutorial >`, especially if you are not familiar with this
0 commit comments