Interpreter: Add current_node to 'state' passed to module methods

The current node is useful to pass as location to mlog.warning().
pull/4818/head
Xavier Claessens 6 years ago
parent 90d1f38d8e
commit 0d195cefa6
  1. 3
      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)

Loading…
Cancel
Save