summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/baseobjects.py
diff options
context:
space:
mode:
authorVolker Weißmann <volker.weissmann@gmx.de>2025-03-14 20:54:46 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-05-29 09:20:27 -0700
commite8f27f5912f1266adb0390fbf54aa3b14f9bf7da (patch)
treeea6e587b2629b6739899c0e5950bf3046c7ae1f1 /mesonbuild/interpreterbase/baseobjects.py
parentb80e7030c766f0561adaa90776f90745bb007d31 (diff)
downloadmeson-e8f27f5912f1266adb0390fbf54aa3b14f9bf7da.tar.gz
rewriter: Replace assignments with cur_assignments
Replace the variable tracking of `AstInterpreter.assignments` with a slightly better variable tracking called `AstInterpreter.cur_assignments`. We now have a class `UnknownValue` for more explicit handling of situations that are too complex/impossible.
Diffstat (limited to 'mesonbuild/interpreterbase/baseobjects.py')
-rw-r--r--mesonbuild/interpreterbase/baseobjects.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py
index a5ccccedc..7cda5729f 100644
--- a/mesonbuild/interpreterbase/baseobjects.py
+++ b/mesonbuild/interpreterbase/baseobjects.py
@@ -121,6 +121,12 @@ class MesonInterpreterObject(InterpreterObject):
class MutableInterpreterObject:
''' Dummy class to mark the object type as mutable '''
+class UnknownValue(MesonInterpreterObject):
+ '''This class is only used for the rewriter/static introspection tool and
+ indicates that a value cannot be determined statically, either because of
+ limitations in our code or because the value differs from machine to
+ machine.'''
+
HoldableTypes = (HoldableObject, int, bool, str, list, dict)
TYPE_HoldableTypes = T.Union[TYPE_var, HoldableObject]
InterpreterObjectTypeVar = T.TypeVar('InterpreterObjectTypeVar', bound=TYPE_HoldableTypes)