aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/ast
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-05-26 09:34:23 -0700
committerEli Schwartz <eschwartz93@gmail.com>2022-06-01 22:49:10 -0400
commit2a0082b13a19833ad3e09589df51a1535b925cf6 (patch)
tree006afc1e59241f23c5b6c79726d3a1b32704b4e5 /mesonbuild/ast
parent3260c0ebdb47f2836b78204806114e7ddb84c51f (diff)
downloadmeson-2a0082b13a19833ad3e09589df51a1535b925cf6.zip
meson-2a0082b13a19833ad3e09589df51a1535b925cf6.tar.gz
meson-2a0082b13a19833ad3e09589df51a1535b925cf6.tar.bz2
ast: rename module constant to match PEP8 style
Diffstat (limited to 'mesonbuild/ast')
-rw-r--r--mesonbuild/ast/__init__.py4
-rw-r--r--mesonbuild/ast/introspection.py9
2 files changed, 9 insertions, 4 deletions
diff --git a/mesonbuild/ast/__init__.py b/mesonbuild/ast/__init__.py
index 4fb56cb..d14620f 100644
--- a/mesonbuild/ast/__init__.py
+++ b/mesonbuild/ast/__init__.py
@@ -24,11 +24,11 @@ __all__ = [
'AstVisitor',
'AstPrinter',
'IntrospectionInterpreter',
- 'build_target_functions',
+ 'BUILD_TARGET_FUNCTIONS',
]
from .interpreter import AstInterpreter
-from .introspection import IntrospectionInterpreter, build_target_functions
+from .introspection import IntrospectionInterpreter, BUILD_TARGET_FUNCTIONS
from .visitor import AstVisitor
from .postprocess import AstConditionLevel, AstIDGenerator, AstIndentationGenerator
from .printer import AstPrinter, AstJSONPrinter
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index 135ce05..f7d3e20 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -35,7 +35,12 @@ if T.TYPE_CHECKING:
from ..interpreterbase import TYPE_nvar
from .visitor import AstVisitor
-build_target_functions = ['executable', 'jar', 'library', 'shared_library', 'shared_module', 'static_library', 'both_libraries']
+
+# TODO: it would be nice to not have to duplicate this
+BUILD_TARGET_FUNCTIONS = [
+ 'executable', 'jar', 'library', 'shared_library', 'shared_module',
+ 'static_library', 'both_libraries'
+]
class IntrospectionHelper(argparse.Namespace):
# mimic an argparse namespace
@@ -245,7 +250,7 @@ class IntrospectionInterpreter(AstInterpreter):
continue
arg_nodes = arg_node.arguments.copy()
# Pop the first element if the function is a build target function
- if isinstance(curr, FunctionNode) and curr.func_name in build_target_functions:
+ if isinstance(curr, FunctionNode) and curr.func_name in BUILD_TARGET_FUNCTIONS:
arg_nodes.pop(0)
elemetary_nodes = [x for x in arg_nodes if isinstance(x, (str, StringNode))]
inqueue += [x for x in arg_nodes if isinstance(x, (FunctionNode, ArrayNode, IdNode, ArithmeticNode))]