diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-15 18:45:25 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-22 16:09:34 +0100 |
commit | ccad493e85e46bf0e78cfac8b77b03b7be75a396 (patch) | |
tree | 255ebb2995f3db3a24bdc71bc327bb2f03f106f9 /mesonbuild/mintro.py | |
parent | 72486afd08d66d6323c2113739dcfff74813058b (diff) | |
download | meson-ccad493e85e46bf0e78cfac8b77b03b7be75a396.zip meson-ccad493e85e46bf0e78cfac8b77b03b7be75a396.tar.gz meson-ccad493e85e46bf0e78cfac8b77b03b7be75a396.tar.bz2 |
Basic AST visitor pattern
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r-- | mesonbuild/mintro.py | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 36368af..fca238f 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -23,7 +23,7 @@ import json from . import build, coredata as cdata from . import environment from . import mesonlib -from . import astinterpreter +from .ast import AstInterpreter from . import mparser from . import mlog from . import compilers @@ -158,7 +158,7 @@ class IntrospectionHelper: self.native_file = None self.cmd_line_options = {} -class IntrospectionInterpreter(astinterpreter.AstInterpreter): +class IntrospectionInterpreter(AstInterpreter): # Interpreter to detect the options without a build directory # Most of the code is stolen from interperter.Interpreter def __init__(self, source_root, subdir, backend, cross_file=None, subproject='', subproject_dir='subprojects', env=None): @@ -183,20 +183,6 @@ class IntrospectionInterpreter(astinterpreter.AstInterpreter): 'add_languages': self.func_add_languages }) - def flatten_args(self, args): - # Resolve mparser.ArrayNode if needed - flattend_args = [] - if isinstance(args, mparser.ArrayNode): - args = [x.value for x in args.args.arguments] - for i in args: - if isinstance(i, mparser.ArrayNode): - flattend_args += [x.value for x in i.args.arguments] - elif isinstance(i, str): - flattend_args += [i] - else: - pass - return flattend_args - def func_project(self, node, args, kwargs): if len(args) < 1: raise InvalidArguments('Not enough arguments to project(). Needs at least the project name.') |