From a75255bc4ce992721bf9f94c3d64ee10c77d7191 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Sat, 7 Dec 2019 19:18:26 +0100 Subject: types: Annotate the AST visitors --- mesonbuild/mparser.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mesonbuild/mparser.py') diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 84b686ec3..ad871f044 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -232,6 +232,11 @@ class BaseNode: self.end_lineno = end_lineno if end_lineno is not None else self.lineno self.end_colno = end_colno if end_colno is not None else self.colno + # Attributes for the visitors + self.level = 0 # type: int + self.ast_id = '' # type: str + self.condition_level = 0 # type: int + def accept(self, visitor: 'AstVisitor') -> None: fname = 'visit_{}'.format(type(self).__name__) if hasattr(visitor, fname): -- cgit v1.2.3