String expression.
| 2243 | |
| 2244 | |
| 2245 | class StringRef(ExprRef): |
| 2246 | """String expression.""" |
| 2247 | |
| 2248 | __slots__ = () |
| 2249 | |
| 2250 | def __init__( |
| 2251 | self, |
| 2252 | ast: ASTNode, |
| 2253 | vars: frozenset[tuple[str, ASTSort]] = frozenset(), |
| 2254 | ) -> None: |
| 2255 | super().__init__(ast, StringSort(), vars) |
| 2256 | |
| 2257 | def __add__(self, other: StringRef) -> StringRef: |
| 2258 | if isinstance(other, str): |
| 2259 | other = StringVal(other) |
| 2260 | return StringRef( |
| 2261 | StrConcatNode(self._ast, other._ast), |
| 2262 | _merge(self._vars, other._vars), |
| 2263 | ) |
| 2264 | |
| 2265 | def __radd__(self, other: str) -> StringRef: |
| 2266 | return StringVal(other) + self |
| 2267 | |
| 2268 | |
| 2269 | def StringSort() -> StringSortRef: |
no outgoing calls
no test coverage detected