Skip to content

Commit

Permalink
Include render of notes in Diagnostic.render output.
Browse files Browse the repository at this point in the history
whitequark committed May 29, 2015
1 parent d08d510 commit 15ad1e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pythonparser/diagnostic.py
Original file line number Diff line number Diff line change
@@ -62,6 +62,7 @@ def render(self):
the formatted message, the source line corresponding
to ``location`` and a line emphasizing the problematic
locations in the source line using ASCII art, as a list of lines.
Appends the result of calling :meth:`render` on ``notes``, if any.
For example: ::
@@ -85,7 +86,7 @@ def render(self):
"%s: %s: %s" % (str(self.location), self.level, self.message()),
source_line,
highlight_line.decode('utf-8')
]
] + reduce(list.__add__, [note.render() for note in self.notes], [])


class Error(Exception):
@@ -98,8 +99,7 @@ def __init__(self, diagnostic):
self.diagnostic = diagnostic

def __str__(self):
return "\n".join(self.diagnostic.render() +
reduce(list.__add__, map(Diagnostic.render, self.diagnostic.notes), []))
return "\n".join(self.diagnostic.render())

class Engine:
"""

0 comments on commit 15ad1e8

Please sign in to comment.