Skip to content

Commit 1a4dce6

Browse files
committed
Docs fixes
1 parent 664f3a9 commit 1a4dce6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

docs/howto/other_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A full parser for JSON. (This will not be competitive in terms of performance
2525
with other implementations!)
2626

2727
This demonstrates the use of :class:`forward_declaration`, needed due to the
28-
circular definition of ``value``.
28+
circular definition of ``json_value``.
2929

3030
.. literalinclude:: ../../examples/json.py
3131
:language: python

docs/overview.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)