From 5a4fa2bf5648d60d9fc0feb69080c9153b2abe02 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 16 Jun 2010 20:34:18 -0400 Subject: Support introspectable=no attribute, add warnings framework This work allows us to move closer to replacing gtk-doc, among other things. We add a generic attribute "introspectable", and inside the typelib compiler if we see "introspectable=no", we don't put it in the typelib. This replaces the hackish pre-filter for varargs with a much more generic mechanism. The varargs is now handled in the scanner, and we emit introspectable=no for them. Add generic metadata to Node with references to file/line/column, which currently comes from symbols. Add scanner options --warn-all and --warn-error. https://bugzilla.gnome.org/show_bug.cgi?id=621570 --- giscanner/ast.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'giscanner/ast.py') diff --git a/giscanner/ast.py b/giscanner/ast.py index 0e9f112d..a70f2d8b 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -173,12 +173,14 @@ class Node(object): def __init__(self, name=None): self.name = name - self.attributes = [] # (key, value)* self.skip = False + self.introspectable = True + self.attributes = [] # (key, value)* self.deprecated = None self.deprecated_version = None self.version = None self.foreign = False + self.file_positions = set() def __cmp__(self, other): return cmp(self.name, other.name) @@ -189,6 +191,16 @@ class Node(object): def remove_matching_children(self, pred): pass + def inherit_file_positions(self, node): + self.file_positions.update(node.file_positions) + + def add_file_position(self, filename, line, column): + self.file_positions.add((filename, line, column)) + + def add_symbol_reference(self, symbol): + if symbol.source_filename: + self.add_file_position(symbol.source_filename, symbol.line, -1) + class Namespace(Node): def __init__(self, name, version): -- cgit v1.2.1