diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2019-01-22 15:59:36 -0500 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2019-01-22 15:59:36 -0500 |
commit | 0d195cefa618717be036667d8c49c457ac7c523f (patch) | |
tree | 001955fd441e828c7f399834ba02cce462d22fbb /mesonbuild/interpreter.py | |
parent | 90d1f38d8e23667059ae9b32b2925f5e2a230881 (diff) | |
download | meson-0d195cefa618717be036667d8c49c457ac7c523f.zip meson-0d195cefa618717be036667d8c49c457ac7c523f.tar.gz meson-0d195cefa618717be036667d8c49c457ac7c523f.tar.bz2 |
Interpreter: Add current_node to 'state' passed to module methods
The current node is useful to pass as location to mlog.warning().
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index d2c1ffe..9e2cddf 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -1597,7 +1597,7 @@ ModuleState = namedtuple('ModuleState', [ 'build_to_src', 'subproject', 'subdir', 'current_lineno', 'environment', 'project_name', 'project_version', 'backend', 'compilers', 'targets', 'data', 'headers', 'man', 'global_args', 'project_args', 'build_machine', - 'host_machine', 'target_machine']) + 'host_machine', 'target_machine', 'current_node']) class ModuleHolder(InterpreterObject, ObjectHolder): def __init__(self, modname, module, interpreter): @@ -1640,6 +1640,7 @@ class ModuleHolder(InterpreterObject, ObjectHolder): build_machine=self.interpreter.builtin['build_machine'].held_object, host_machine=self.interpreter.builtin['host_machine'].held_object, target_machine=self.interpreter.builtin['target_machine'].held_object, + current_node=self.current_node ) if self.held_object.is_snippet(method_name): value = fn(self.interpreter, state, args, kwargs) |