diff options
author | Johan Dahlin <johan@gnome.org> | 2010-09-20 17:17:20 -0300 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2010-09-20 17:19:21 -0300 |
commit | 635b6ec35fbb1c2355e9b8b336f1a9164cc44034 (patch) | |
tree | 3b2b1ddfdc620082e5b3125fde1101e243dd4b08 /giscanner/ast.py | |
parent | 84aa7defdb1a3082021bd28a61803a1e140cf8ca (diff) | |
download | gobject-introspection-635b6ec35fbb1c2355e9b8b336f1a9164cc44034.tar.gz |
[scanner] Add a Position class
Add a position class which will make it easier to
send filename/line/column information to the message
class.
Diffstat (limited to 'giscanner/ast.py')
-rw-r--r-- | giscanner/ast.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/giscanner/ast.py b/giscanner/ast.py index 8ff61e1d..08129cb1 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -19,6 +19,7 @@ # Boston, MA 02111-1307, USA. # +from .message import Position from .odict import odict from .utils import to_underscores @@ -487,12 +488,12 @@ GIName. It's possible for nodes to contain or point to other nodes.""" 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_file_position(self, position): + self.file_positions.add(position) def add_symbol_reference(self, symbol): if symbol.source_filename: - self.add_file_position(symbol.source_filename, symbol.line, -1) + self.add_file_position(Position(symbol.source_filename, symbol.line)) def walk(self, callback, chain): res = callback(self, chain) |