summaryrefslogtreecommitdiff
path: root/giscanner/sourcescanner.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-12-08 18:26:47 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-12-08 22:45:17 +0100
commitf9a873a0881e189a2d20e4904d40bb0c5cbf0d94 (patch)
tree71b78f9ddc8cc45198ce560acded84da90b094cb /giscanner/sourcescanner.py
parent0f4dd5e39a86e9ae749b3b4627488e19d18dd8a5 (diff)
downloadgobject-introspection-f9a873a0881e189a2d20e4904d40bb0c5cbf0d94.tar.gz
sourcescanner: collect error messages and expose them
It just printed errors to stderr and always returns success even if parsing fails. This prevents us to write any tests for it. As a first step collect all lexing/parsing error messages and print them to stderr after the scanner is done. This allows us to add some regression tests for !78. In the future we probably want to raise an exception with those errors if parsing fails.
Diffstat (limited to 'giscanner/sourcescanner.py')
-rw-r--r--giscanner/sourcescanner.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py
index d867a4e9..6a0bace7 100644
--- a/giscanner/sourcescanner.py
+++ b/giscanner/sourcescanner.py
@@ -274,6 +274,9 @@ class SourceScanner(object):
def get_comments(self):
return self._scanner.get_comments()
+ def get_errors(self):
+ return self._scanner.get_errors()
+
def dump(self):
print('-' * 30)
for symbol in self._scanner.get_symbols():