diff options
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/ast/interpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/ast/introspection.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py index 0e490ab..13c717b 100644 --- a/mesonbuild/ast/interpreter.py +++ b/mesonbuild/ast/interpreter.py @@ -325,7 +325,7 @@ class AstInterpreter(interpreterbase.InterpreterBase): for key, val in kwargs.items(): if isinstance(val, ElementaryNode): flattend_kwargs[key] = val.value - elif isinstance(val, (ArrayNode, ArgumentNode)): + elif isinstance(val, (ArrayNode, ArgumentNode, ArithmeticNode, MethodNode)): flattend_kwargs[key] = self.flatten_args(val, include_unknown_args) elif isinstance(val, (str, bool, int, float)) or include_unknown_args: flattend_kwargs[key] = val diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 617b140..aeb0400 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -158,16 +158,20 @@ class IntrospectionInterpreter(AstInterpreter): args = self.flatten_args(args) if not args or not isinstance(args[0], str): return - kwargs = self.flatten_kwargs(kwargs, True) name = args[0] srcqueue = [node] + + # Process the soruces BEFORE flattening the kwargs, to preserve the original nodes if 'sources' in kwargs: - srcqueue += kwargs['sources'] + srcqueue += mesonlib.listify(kwargs['sources']) + + kwargs = self.flatten_kwargs(kwargs, True) source_nodes = [] while srcqueue: curr = srcqueue.pop(0) arg_node = None + assert(isinstance(curr, BaseNode)) if isinstance(curr, FunctionNode): arg_node = curr.args elif isinstance(curr, ArrayNode): |