Merge branch 'main' into redsun82/rust-str

This commit is contained in:
Paolo Tranquilli
2024-11-22 14:44:48 +01:00
127 changed files with 1500 additions and 3253 deletions

View File

@@ -1032,6 +1032,7 @@ class _:
@annotate(FormatArgsArg)
@qltest.test_with(FormatArgsExpr)
class _:
"""
A FormatArgsArg. For example:
@@ -1046,9 +1047,14 @@ class _:
"""
A FormatArgsExpr. For example:
```rust
todo!()
format_args!("no args");
format_args!("{} foo {:?}", 1, 2);
format_args!("{b} foo {a:?}", a=1, b=2);
let (x, y) = (1, 42);
format_args!("{x}, {y}");
```
"""
formats: list["Format"] | child | synth
@annotate(GenericArg)
@@ -1789,14 +1795,15 @@ class _:
attrs: drop
@qltest.skip
@synth.on_arguments(parent="FormatArgsExpr", index=int, kind=int)
@qltest.test_with(FormatArgsExpr)
class FormatTemplateVariableAccess(PathExprBase):
pass
@qltest.skip
@synth.on_arguments(parent=FormatArgsExpr, index=int, text=string, offset=int)
@qltest.test_with(FormatArgsExpr)
class Format(Locatable):
"""
A format element in a formatting template. For example the `{}` in:
@@ -1806,10 +1813,11 @@ class Format(Locatable):
"""
parent: FormatArgsExpr
index: int
argument: optional["FormatArgument"] | child
@qltest.skip
@synth.on_arguments(parent=FormatArgsExpr, index=int, kind=int, name=string, positional=boolean, offset=int)
@qltest.test_with(FormatArgsExpr)
class FormatArgument(Locatable):
"""
An argument in a format element in a formatting template. For example the `width`, `precision`, and `value` in:
@@ -1822,6 +1830,7 @@ class FormatArgument(Locatable):
```
"""
parent: Format
variable: optional[FormatTemplateVariableAccess] | child
@annotate(Item)
class _: