diff --git a/docs/docs/usage.rst b/docs/docs/usage.rst index fea99f8..fdda3c9 100644 --- a/docs/docs/usage.rst +++ b/docs/docs/usage.rst @@ -25,7 +25,6 @@ Typically if you want to work with one specific Python version, use: .. autofunction:: parso.load_grammar - Grammar methods --------------- @@ -37,6 +36,17 @@ issues in it: :undoc-members: +Error Retrieval +--------------- + +|parso| is able to find multiple errors in your source code. Iterating through +those errors yields the following instances: + +.. autoclass:: parso.normalizer.Issue + :members: + :undoc-members: + + Utility ------- diff --git a/parso/normalizer.py b/parso/normalizer.py index 0a0e6b7..9a3e82e 100644 --- a/parso/normalizer.py +++ b/parso/normalizer.py @@ -121,8 +121,18 @@ class Issue(object): def __init__(self, node, code, message): self._node = node self.code = code + """ + An integer code that stands for the type of error. + """ self.message = message + """ + A message (string) for the issue. + """ self.start_pos = node.start_pos + """ + The start position position of the error as a tuple (line, column). As + always in |parso| the first line is 1 and the first column 0. + """ def __eq__(self, other): return self.start_pos == other.start_pos and self.code == other.code