diff options
Diffstat (limited to 'mesonbuild/ast/interpreter.py')
-rw-r--r-- | mesonbuild/ast/interpreter.py | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py index 71c7f47..26447ce 100644 --- a/mesonbuild/ast/interpreter.py +++ b/mesonbuild/ast/interpreter.py @@ -16,10 +16,20 @@ # or an interpreter-based tool. from .visitor import AstVisitor -from .. import interpreterbase, mparser, mesonlib +from .. import mparser, mesonlib from .. import environment -from ..interpreterbase import InvalidArguments, BreakRequest, ContinueRequest, TYPE_nvar, TYPE_nkwargs +from ..interpreterbase import ( + MesonInterpreterObject, + InterpreterBase, + InvalidArguments, + BreakRequest, + ContinueRequest, + default_resolve_key, + TYPE_nvar, + TYPE_nkwargs, +) + from ..mparser import ( AndNode, ArgumentNode, @@ -45,28 +55,28 @@ from ..mparser import ( import os, sys import typing as T -class DontCareObject(interpreterbase.InterpreterObject): +class DontCareObject(MesonInterpreterObject): pass -class MockExecutable(interpreterbase.InterpreterObject): +class MockExecutable(MesonInterpreterObject): pass -class MockStaticLibrary(interpreterbase.InterpreterObject): +class MockStaticLibrary(MesonInterpreterObject): pass -class MockSharedLibrary(interpreterbase.InterpreterObject): +class MockSharedLibrary(MesonInterpreterObject): pass -class MockCustomTarget(interpreterbase.InterpreterObject): +class MockCustomTarget(MesonInterpreterObject): pass -class MockRunTarget(interpreterbase.InterpreterObject): +class MockRunTarget(MesonInterpreterObject): pass ADD_SOURCE = 0 REMOVE_SOURCE = 1 -class AstInterpreter(interpreterbase.InterpreterBase): +class AstInterpreter(InterpreterBase): def __init__(self, source_root: str, subdir: str, subproject: str, visitors: T.Optional[T.List[AstVisitor]] = None): super().__init__(source_root, subdir, subproject) self.visitors = visitors if visitors is not None else [] @@ -224,7 +234,7 @@ class AstInterpreter(interpreterbase.InterpreterBase): def reduce_arguments( self, args: mparser.ArgumentNode, - key_resolver: T.Callable[[mparser.BaseNode], str] = interpreterbase.default_resolve_key, + key_resolver: T.Callable[[mparser.BaseNode], str] = default_resolve_key, duplicate_key_error: T.Optional[str] = None, ) -> T.Tuple[T.List[TYPE_nvar], TYPE_nkwargs]: if isinstance(args, ArgumentNode): |