aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/baseobjects.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-09-26 12:16:31 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-10-06 22:37:18 +0200
commitdfec4385a74fb0530733d008bd2afce278bc486e (patch)
treed672b94cc0c294ca97482b97c057da36050a9ca1 /mesonbuild/interpreterbase/baseobjects.py
parentaf0587cb490dfa2c2a00c2426c10d1de11d34fdd (diff)
downloadmeson-dfec4385a74fb0530733d008bd2afce278bc486e.zip
meson-dfec4385a74fb0530733d008bd2afce278bc486e.tar.gz
meson-dfec4385a74fb0530733d008bd2afce278bc486e.tar.bz2
interpreter: Move RangeHolder out of interpreterbase to interpreter
Diffstat (limited to 'mesonbuild/interpreterbase/baseobjects.py')
-rw-r--r--mesonbuild/interpreterbase/baseobjects.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/mesonbuild/interpreterbase/baseobjects.py b/mesonbuild/interpreterbase/baseobjects.py
index 3c7085b..7e98b48 100644
--- a/mesonbuild/interpreterbase/baseobjects.py
+++ b/mesonbuild/interpreterbase/baseobjects.py
@@ -176,26 +176,3 @@ class IterableObject(metaclass=ABCMeta):
def size(self) -> int:
raise MesonBugException(f'size not implemented for {self.__class__.__name__}')
-
-class RangeHolder(MesonInterpreterObject, IterableObject):
- def __init__(self, start: int, stop: int, step: int, *, subproject: str) -> None:
- super().__init__(subproject=subproject)
- self.range = range(start, stop, step)
- self.operators.update({
- MesonOperator.INDEX: self.op_index,
- })
-
- def op_index(self, other: int) -> int:
- try:
- return self.range[other]
- except:
- raise InvalidArguments(f'Index {other} out of bounds of range.')
-
- def iter_tuple_size(self) -> None:
- return None
-
- def iter_self(self) -> T.Iterator[int]:
- return iter(self.range)
-
- def size(self) -> int:
- return len(self.range)