From 435d310c2bc69a8e993076ac6150c014609a2aba Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 3 Sep 2017 22:19:48 +0200 Subject: [PATCH] More general overhaul of the documentation. --- docs/docs/usage.rst | 3 +-- parso/grammar.py | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/docs/usage.rst b/docs/docs/usage.rst index a9fb7ff..fea99f8 100644 --- a/docs/docs/usage.rst +++ b/docs/docs/usage.rst @@ -40,10 +40,9 @@ issues in it: Utility ------- -There are some utility functions that +|parso| also offers some utility functions that can be really useful: .. autofunction:: parso.parse - .. autofunction:: parso.split_lines .. autofunction:: parso.python_bytes_to_unicode diff --git a/parso/grammar.py b/parso/grammar.py index d0ee007..11731d1 100644 --- a/parso/grammar.py +++ b/parso/grammar.py @@ -67,7 +67,8 @@ class Grammar(object): directory. If not given, defaults to the default cache places on each platform. - :return: A subclass of :py:class:`parso.tree.Node`. Typically a module. + :return: A subclass of :py:class:`parso.tree.NodeOrLeaf`. Typically a + :py:class:`parso.python.tree.Module`. """ if 'start_pos' in kwargs: raise TypeError("parse() got an unexpected keyworda argument.") @@ -155,6 +156,11 @@ class Grammar(object): return ns def iter_errors(self, node): + """ + Given a :py:class:`parso.tree.NodeOrLeaf` returns a generator of + :py:class:`parso.normalizer.Issue` objects. For Python this is + a list of syntax/indentation errors. + """ if self._error_normalizer_config is None: raise ValueError("No error normalizer specified for this grammar.")