We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[regression] String formatting has regressed since 0.60. ERROR: Format placeholder @9@ out of range.
**Describe the bug**
There is a regression of as yet unknown cause in Meson's string formatting, as discovered by @alex3kov and diagnosed by myself at libsixel/libsixel#50. This regression causes previously building package to no longer build.

**To Reproduce**
https://github.com/libsixel/libsixel/blob/v1.10.3/meson.build

**Expected behavior**
Good build

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)?
    Plain build.
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    Arch Linux
* what Python version are you using e.g. 3.8.0
    Python 3.9.7
* what `meson --version`
    Versions above 0.59.2 I confirm are affected.
* what `ninja --version` if it's a Ninja build
    We do not get to Ninja step, Meson is the cause.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mesonbuild/interpreter/primitives/string.py`
Content:
```
1 # Copyright 2021 The Meson development team
2 # SPDX-license-identifier: Apache-2.0
3 
4 import re
5 import os
6 from pathlib import PurePath
7 
8 import typing as T
9 
10 from ...mesonlib import version_compare
11 from ...interpreterbase import (
12     ObjectHolder,
13     MesonOperator,
14     FeatureNew,
15     typed_operator,
16     noKwargs,
17     noPosargs,
18     typed_pos_args,
19 
20     TYPE_var,
21     TYPE_kwargs,
22 
23     InvalidArguments,
24 )
25 
26 
27 if T.TYPE_CHECKING:
28     # Object holders need the actual interpreter
29     from ...interpreter import Interpreter
30 
31 class StringHolder(ObjectHolder[str]):
32     def __init__(self, obj: str, interpreter: 'Interpreter') -> None:
33         super().__init__(obj, interpreter)
34         self.methods.update({
35             'contains': self.contains_method,
36             'startswith': self.startswith_method,
37             'endswith': self.endswith_method,
38             'format': self.format_method,
39             'join': self.join_method,
40             'replace': self.replace_method,
41             'split': self.split_method,
42             'strip': self.strip_method,
43             'substring': self.substring_method,
44             'to_int': self.to_int_method,
45             'to_lower': self.to_lower_method,
46             'to_upper': self.to_upper_method,
47             'underscorify': self.underscorify_method,
48             'version_compare': self.version_compare_method,
49         })
50 
51         self.trivial_operators.update({
52             # Arithmetic
53             MesonOperator.PLUS: (str, lambda x: self.held_object + x),
54 
55             # Comparison
56             MesonOperator.EQUALS: (str, lambda x: self.held_object == x),
57             MesonOperator.NOT_EQUALS: (str, lambda x: self.held_object != x),
58             MesonOperator.GREATER: (str, lambda x: self.held_object > x),
59             MesonOperator.LESS: (str, lambda x: self.held_object < x),
60             MesonOperator.GREATER_EQUALS: (str, lambda x: self.held_object >= x),
61             MesonOperator.LESS_EQUALS: (str, lambda x: self.held_object <= x),
62         })
63 
64         # Use actual methods for functions that require additional checks
65         self.operators.update({
66             MesonOperator.DIV: self.op_div,
67             MesonOperator.INDEX: self.op_index,
68         })
69 
70     def display_name(self) -> str:
71         return 'str'
72 
73     @noKwargs
74     @typed_pos_args('str.contains', str)
75     def contains_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
76         return self.held_object.find(args[0]) >= 0
77 
78     @noKwargs
79     @typed_pos_args('str.startswith', str)
80     def startswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
81         return self.held_object.startswith(args[0])
82 
83     @noKwargs
84     @typed_pos_args('str.endswith', str)
85     def endswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
86         return self.held_object.endswith(args[0])
87 
88     @noKwargs
89     @typed_pos_args('str.format', varargs=object)
90     def format_method(self, args: T.Tuple[T.List[object]], kwargs: TYPE_kwargs) -> str:
91         arg_strings: T.List[str] = []
92         for arg in args[0]:
93             if isinstance(arg, bool): # Python boolean is upper case.
94                 arg = str(arg).lower()
95             arg_strings.append(str(arg))
96 
97         def arg_replace(match: T.Match[str]) -> str:
98             idx = int(match.group(1))
99             if idx >= len(arg_strings):
100                 raise InvalidArguments(f'Format placeholder @{idx}@ out of range.')
101             return arg_strings[idx]
102 
103         return re.sub(r'@(\d+)@', arg_replace, self.held_object)
104 
105     @noKwargs
106     @typed_pos_args('str.join', varargs=str)
107     def join_method(self, args: T.Tuple[T.List[str]], kwargs: TYPE_kwargs) -> str:
108         return self.held_object.join(args[0])
109 
110     @noKwargs
111     @typed_pos_args('str.replace', str, str)
112     def replace_method(self, args: T.Tuple[str, str], kwargs: TYPE_kwargs) -> str:
113         return self.held_object.replace(args[0], args[1])
114 
115     @noKwargs
116     @typed_pos_args('str.split', optargs=[str])
117     def split_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> T.List[str]:
118         return self.held_object.split(args[0])
119 
120     @noKwargs
121     @typed_pos_args('str.strip', optargs=[str])
122     def strip_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> str:
123         return self.held_object.strip(args[0])
124 
125     @noKwargs
126     @typed_pos_args('str.substring', optargs=[int, int])
127     def substring_method(self, args: T.Tuple[T.Optional[int], T.Optional[int]], kwargs: TYPE_kwargs) -> str:
128         start = args[0] if args[0] is not None else 0
129         end   = args[1] if args[1] is not None else len(self.held_object)
130         return self.held_object[start:end]
131 
132     @noKwargs
133     @noPosargs
134     def to_int_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> int:
135         try:
136             return int(self.held_object)
137         except ValueError:
138             raise InvalidArguments(f'String {self.held_object!r} cannot be converted to int')
139 
140     @noKwargs
141     @noPosargs
142     def to_lower_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:
143         return self.held_object.lower()
144 
145     @noKwargs
146     @noPosargs
147     def to_upper_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:
148         return self.held_object.upper()
149 
150     @noKwargs
151     @noPosargs
152     def underscorify_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:
153         return re.sub(r'[^a-zA-Z0-9]', '_', self.held_object)
154 
155     @noKwargs
156     @typed_pos_args('str.version_compare', str)
157     def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
158         return version_compare(self.held_object, args[0])
159 
160     @FeatureNew('/ with string arguments', '0.49.0')
161     @typed_operator(MesonOperator.DIV, str)
162     def op_div(self, other: str) -> str:
163         return os.path.join(self.held_object, other).replace('\\', '/')
164 
165     @typed_operator(MesonOperator.INDEX, int)
166     def op_index(self, other: int) -> str:
167         try:
168             return self.held_object[other]
169         except IndexError:
170             raise InvalidArguments(f'Index {other} out of bounds of string of size {len(self.held_object)}.')
171 
172 
173 class MesonVersionString(str):
174     pass
175 
176 class MesonVersionStringHolder(StringHolder):
177     @noKwargs
178     @typed_pos_args('str.version_compare', str)
179     def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
180         self.interpreter.tmp_meson_version = args[0]
181         return version_compare(self.held_object, args[0])
182
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py
--- a/mesonbuild/interpreter/primitives/string.py
+++ b/mesonbuild/interpreter/primitives/string.py
@@ -13,6 +13,7 @@
     MesonOperator,
     FeatureNew,
     typed_operator,
+    noArgsFlattening,
     noKwargs,
     noPosargs,
     typed_pos_args,
@@ -85,6 +86,7 @@
     def endswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:
         return self.held_object.endswith(args[0])
 
+    @noArgsFlattening
     @noKwargs
     @typed_pos_args('str.format', varargs=object)
     def format_method(self, args: T.Tuple[T.List[object]], kwargs: TYPE_kwargs) -> str:

{"golden_diff": "diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py\n--- a/mesonbuild/interpreter/primitives/string.py\n+++ b/mesonbuild/interpreter/primitives/string.py\n@@ -13,6 +13,7 @@\n     MesonOperator,\n     FeatureNew,\n     typed_operator,\n+    noArgsFlattening,\n     noKwargs,\n     noPosargs,\n     typed_pos_args,\n@@ -85,6 +86,7 @@\n     def endswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n         return self.held_object.endswith(args[0])\n \n+    @noArgsFlattening\n     @noKwargs\n     @typed_pos_args('str.format', varargs=object)\n     def format_method(self, args: T.Tuple[T.List[object]], kwargs: TYPE_kwargs) -> str:\n", "issue": "[regression] String formatting has regressed since 0.60. ERROR: Format placeholder @9@ out of range.\n**Describe the bug**\r\nThere is a regression of as yet unknown cause in Meson's string formatting, as discovered by @alex3kov and diagnosed by myself at libsixel/libsixel#50. This regression causes previously building package to no longer build.\r\n\r\n**To Reproduce**\r\nhttps://github.com/libsixel/libsixel/blob/v1.10.3/meson.build\r\n\r\n**Expected behavior**\r\nGood build\r\n\r\n**system parameters**\r\n* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)?\r\n    Plain build.\r\n* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)\r\n    Arch Linux\r\n* what Python version are you using e.g. 3.8.0\r\n    Python 3.9.7\r\n* what `meson --version`\r\n    Versions above 0.59.2 I confirm are affected.\r\n* what `ninja --version` if it's a Ninja build\r\n    We do not get to Ninja step, Meson is the cause.\n", "before_files": [{"content": "# Copyright 2021 The Meson development team\n# SPDX-license-identifier: Apache-2.0\n\nimport re\nimport os\nfrom pathlib import PurePath\n\nimport typing as T\n\nfrom ...mesonlib import version_compare\nfrom ...interpreterbase import (\n    ObjectHolder,\n    MesonOperator,\n    FeatureNew,\n    typed_operator,\n    noKwargs,\n    noPosargs,\n    typed_pos_args,\n\n    TYPE_var,\n    TYPE_kwargs,\n\n    InvalidArguments,\n)\n\n\nif T.TYPE_CHECKING:\n    # Object holders need the actual interpreter\n    from ...interpreter import Interpreter\n\nclass StringHolder(ObjectHolder[str]):\n    def __init__(self, obj: str, interpreter: 'Interpreter') -> None:\n        super().__init__(obj, interpreter)\n        self.methods.update({\n            'contains': self.contains_method,\n            'startswith': self.startswith_method,\n            'endswith': self.endswith_method,\n            'format': self.format_method,\n            'join': self.join_method,\n            'replace': self.replace_method,\n            'split': self.split_method,\n            'strip': self.strip_method,\n            'substring': self.substring_method,\n            'to_int': self.to_int_method,\n            'to_lower': self.to_lower_method,\n            'to_upper': self.to_upper_method,\n            'underscorify': self.underscorify_method,\n            'version_compare': self.version_compare_method,\n        })\n\n        self.trivial_operators.update({\n            # Arithmetic\n            MesonOperator.PLUS: (str, lambda x: self.held_object + x),\n\n            # Comparison\n            MesonOperator.EQUALS: (str, lambda x: self.held_object == x),\n            MesonOperator.NOT_EQUALS: (str, lambda x: self.held_object != x),\n            MesonOperator.GREATER: (str, lambda x: self.held_object > x),\n            MesonOperator.LESS: (str, lambda x: self.held_object < x),\n            MesonOperator.GREATER_EQUALS: (str, lambda x: self.held_object >= x),\n            MesonOperator.LESS_EQUALS: (str, lambda x: self.held_object <= x),\n        })\n\n        # Use actual methods for functions that require additional checks\n        self.operators.update({\n            MesonOperator.DIV: self.op_div,\n            MesonOperator.INDEX: self.op_index,\n        })\n\n    def display_name(self) -> str:\n        return 'str'\n\n    @noKwargs\n    @typed_pos_args('str.contains', str)\n    def contains_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.find(args[0]) >= 0\n\n    @noKwargs\n    @typed_pos_args('str.startswith', str)\n    def startswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.startswith(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.endswith', str)\n    def endswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.endswith(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.format', varargs=object)\n    def format_method(self, args: T.Tuple[T.List[object]], kwargs: TYPE_kwargs) -> str:\n        arg_strings: T.List[str] = []\n        for arg in args[0]:\n            if isinstance(arg, bool): # Python boolean is upper case.\n                arg = str(arg).lower()\n            arg_strings.append(str(arg))\n\n        def arg_replace(match: T.Match[str]) -> str:\n            idx = int(match.group(1))\n            if idx >= len(arg_strings):\n                raise InvalidArguments(f'Format placeholder @{idx}@ out of range.')\n            return arg_strings[idx]\n\n        return re.sub(r'@(\\d+)@', arg_replace, self.held_object)\n\n    @noKwargs\n    @typed_pos_args('str.join', varargs=str)\n    def join_method(self, args: T.Tuple[T.List[str]], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.join(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.replace', str, str)\n    def replace_method(self, args: T.Tuple[str, str], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.replace(args[0], args[1])\n\n    @noKwargs\n    @typed_pos_args('str.split', optargs=[str])\n    def split_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> T.List[str]:\n        return self.held_object.split(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.strip', optargs=[str])\n    def strip_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.strip(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.substring', optargs=[int, int])\n    def substring_method(self, args: T.Tuple[T.Optional[int], T.Optional[int]], kwargs: TYPE_kwargs) -> str:\n        start = args[0] if args[0] is not None else 0\n        end   = args[1] if args[1] is not None else len(self.held_object)\n        return self.held_object[start:end]\n\n    @noKwargs\n    @noPosargs\n    def to_int_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> int:\n        try:\n            return int(self.held_object)\n        except ValueError:\n            raise InvalidArguments(f'String {self.held_object!r} cannot be converted to int')\n\n    @noKwargs\n    @noPosargs\n    def to_lower_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.lower()\n\n    @noKwargs\n    @noPosargs\n    def to_upper_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.upper()\n\n    @noKwargs\n    @noPosargs\n    def underscorify_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return re.sub(r'[^a-zA-Z0-9]', '_', self.held_object)\n\n    @noKwargs\n    @typed_pos_args('str.version_compare', str)\n    def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return version_compare(self.held_object, args[0])\n\n    @FeatureNew('/ with string arguments', '0.49.0')\n    @typed_operator(MesonOperator.DIV, str)\n    def op_div(self, other: str) -> str:\n        return os.path.join(self.held_object, other).replace('\\\\', '/')\n\n    @typed_operator(MesonOperator.INDEX, int)\n    def op_index(self, other: int) -> str:\n        try:\n            return self.held_object[other]\n        except IndexError:\n            raise InvalidArguments(f'Index {other} out of bounds of string of size {len(self.held_object)}.')\n\n\nclass MesonVersionString(str):\n    pass\n\nclass MesonVersionStringHolder(StringHolder):\n    @noKwargs\n    @typed_pos_args('str.version_compare', str)\n    def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        self.interpreter.tmp_meson_version = args[0]\n        return version_compare(self.held_object, args[0])\n", "path": "mesonbuild/interpreter/primitives/string.py"}], "after_files": [{"content": "# Copyright 2021 The Meson development team\n# SPDX-license-identifier: Apache-2.0\n\nimport re\nimport os\nfrom pathlib import PurePath\n\nimport typing as T\n\nfrom ...mesonlib import version_compare\nfrom ...interpreterbase import (\n    ObjectHolder,\n    MesonOperator,\n    FeatureNew,\n    typed_operator,\n    noArgsFlattening,\n    noKwargs,\n    noPosargs,\n    typed_pos_args,\n\n    TYPE_var,\n    TYPE_kwargs,\n\n    InvalidArguments,\n)\n\n\nif T.TYPE_CHECKING:\n    # Object holders need the actual interpreter\n    from ...interpreter import Interpreter\n\nclass StringHolder(ObjectHolder[str]):\n    def __init__(self, obj: str, interpreter: 'Interpreter') -> None:\n        super().__init__(obj, interpreter)\n        self.methods.update({\n            'contains': self.contains_method,\n            'startswith': self.startswith_method,\n            'endswith': self.endswith_method,\n            'format': self.format_method,\n            'join': self.join_method,\n            'replace': self.replace_method,\n            'split': self.split_method,\n            'strip': self.strip_method,\n            'substring': self.substring_method,\n            'to_int': self.to_int_method,\n            'to_lower': self.to_lower_method,\n            'to_upper': self.to_upper_method,\n            'underscorify': self.underscorify_method,\n            'version_compare': self.version_compare_method,\n        })\n\n        self.trivial_operators.update({\n            # Arithmetic\n            MesonOperator.PLUS: (str, lambda x: self.held_object + x),\n\n            # Comparison\n            MesonOperator.EQUALS: (str, lambda x: self.held_object == x),\n            MesonOperator.NOT_EQUALS: (str, lambda x: self.held_object != x),\n            MesonOperator.GREATER: (str, lambda x: self.held_object > x),\n            MesonOperator.LESS: (str, lambda x: self.held_object < x),\n            MesonOperator.GREATER_EQUALS: (str, lambda x: self.held_object >= x),\n            MesonOperator.LESS_EQUALS: (str, lambda x: self.held_object <= x),\n        })\n\n        # Use actual methods for functions that require additional checks\n        self.operators.update({\n            MesonOperator.DIV: self.op_div,\n            MesonOperator.INDEX: self.op_index,\n        })\n\n    def display_name(self) -> str:\n        return 'str'\n\n    @noKwargs\n    @typed_pos_args('str.contains', str)\n    def contains_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.find(args[0]) >= 0\n\n    @noKwargs\n    @typed_pos_args('str.startswith', str)\n    def startswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.startswith(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.endswith', str)\n    def endswith_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return self.held_object.endswith(args[0])\n\n    @noArgsFlattening\n    @noKwargs\n    @typed_pos_args('str.format', varargs=object)\n    def format_method(self, args: T.Tuple[T.List[object]], kwargs: TYPE_kwargs) -> str:\n        arg_strings: T.List[str] = []\n        for arg in args[0]:\n            if isinstance(arg, bool): # Python boolean is upper case.\n                arg = str(arg).lower()\n            arg_strings.append(str(arg))\n\n        def arg_replace(match: T.Match[str]) -> str:\n            idx = int(match.group(1))\n            if idx >= len(arg_strings):\n                raise InvalidArguments(f'Format placeholder @{idx}@ out of range.')\n            return arg_strings[idx]\n\n        return re.sub(r'@(\\d+)@', arg_replace, self.held_object)\n\n    @noKwargs\n    @typed_pos_args('str.join', varargs=str)\n    def join_method(self, args: T.Tuple[T.List[str]], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.join(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.replace', str, str)\n    def replace_method(self, args: T.Tuple[str, str], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.replace(args[0], args[1])\n\n    @noKwargs\n    @typed_pos_args('str.split', optargs=[str])\n    def split_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> T.List[str]:\n        return self.held_object.split(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.strip', optargs=[str])\n    def strip_method(self, args: T.Tuple[T.Optional[str]], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.strip(args[0])\n\n    @noKwargs\n    @typed_pos_args('str.substring', optargs=[int, int])\n    def substring_method(self, args: T.Tuple[T.Optional[int], T.Optional[int]], kwargs: TYPE_kwargs) -> str:\n        start = args[0] if args[0] is not None else 0\n        end   = args[1] if args[1] is not None else len(self.held_object)\n        return self.held_object[start:end]\n\n    @noKwargs\n    @noPosargs\n    def to_int_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> int:\n        try:\n            return int(self.held_object)\n        except ValueError:\n            raise InvalidArguments(f'String {self.held_object!r} cannot be converted to int')\n\n    @noKwargs\n    @noPosargs\n    def to_lower_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.lower()\n\n    @noKwargs\n    @noPosargs\n    def to_upper_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return self.held_object.upper()\n\n    @noKwargs\n    @noPosargs\n    def underscorify_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str:\n        return re.sub(r'[^a-zA-Z0-9]', '_', self.held_object)\n\n    @noKwargs\n    @typed_pos_args('str.version_compare', str)\n    def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        return version_compare(self.held_object, args[0])\n\n    @FeatureNew('/ with string arguments', '0.49.0')\n    @typed_operator(MesonOperator.DIV, str)\n    def op_div(self, other: str) -> str:\n        return os.path.join(self.held_object, other).replace('\\\\', '/')\n\n    @typed_operator(MesonOperator.INDEX, int)\n    def op_index(self, other: int) -> str:\n        try:\n            return self.held_object[other]\n        except IndexError:\n            raise InvalidArguments(f'Index {other} out of bounds of string of size {len(self.held_object)}.')\n\n\nclass MesonVersionString(str):\n    pass\n\nclass MesonVersionStringHolder(StringHolder):\n    @noKwargs\n    @typed_pos_args('str.version_compare', str)\n    def version_compare_method(self, args: T.Tuple[str], kwargs: TYPE_kwargs) -> bool:\n        self.interpreter.tmp_meson_version = args[0]\n        return version_compare(self.held_object, args[0])\n", "path": "mesonbuild/interpreter/primitives/string.py"}]}