summaryrefslogtreecommitdiff
path: root/mesonbuild/ast
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2025-03-09 16:01:30 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-05-29 09:20:27 -0700
commitcc781cabd848bc984d672738fb3d42e8d8e3e4fa (patch)
tree8af8e608ad7bd1a5727ad880b106c87f914c63a8 /mesonbuild/ast
parent75103efd9f4216084ffb5ca0bf022dede3327e37 (diff)
downloadmeson-cc781cabd848bc984d672738fb3d42e8d8e3e4fa.tar.gz
Refactoring and removal of dead code
Diffstat (limited to 'mesonbuild/ast')
-rw-r--r--mesonbuild/ast/interpreter.py25
-rw-r--r--mesonbuild/ast/introspection.py7
2 files changed, 5 insertions, 27 deletions
diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py
index cd8156a3f..271ad7d6d 100644
--- a/mesonbuild/ast/interpreter.py
+++ b/mesonbuild/ast/interpreter.py
@@ -13,7 +13,6 @@ from .. import mparser, mesonlib
from .. import environment
from ..interpreterbase import (
- MesonInterpreterObject,
InterpreterBase,
InvalidArguments,
BreakRequest,
@@ -60,27 +59,6 @@ if T.TYPE_CHECKING:
UMinusNode,
)
-class DontCareObject(MesonInterpreterObject):
- pass
-
-class MockExecutable(MesonInterpreterObject):
- pass
-
-class MockStaticLibrary(MesonInterpreterObject):
- pass
-
-class MockSharedLibrary(MesonInterpreterObject):
- pass
-
-class MockCustomTarget(MesonInterpreterObject):
- pass
-
-class MockRunTarget(MesonInterpreterObject):
- pass
-
-ADD_SOURCE = 0
-REMOVE_SOURCE = 1
-
_T = T.TypeVar('_T')
_V = T.TypeVar('_V')
@@ -232,9 +210,6 @@ class AstInterpreter(InterpreterBase):
def evaluate_indexing(self, node: IndexNode) -> int:
return 0
- def unknown_function_called(self, func_name: str) -> None:
- pass
-
def reduce_arguments(
self,
args: mparser.ArgumentNode,
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index f2a0c5ae0..2f1572f38 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -43,8 +43,11 @@ class IntrospectionHelper:
return NotImplemented
class IntrospectionInterpreter(AstInterpreter):
- # Interpreter to detect the options without a build directory
- # Most of the code is stolen from interpreter.Interpreter
+ # If you run `meson setup ...` the `Interpreter`-class walks over the AST.
+ # If you run `meson rewrite ...` and `meson introspect meson.build ...`,
+ # the `AstInterpreter`-class walks over the AST.
+ # Works without a build directory.
+ # Most of the code is stolen from interpreter.Interpreter .
def __init__(self,
source_root: str,
subdir: str,