Skip to content

Commit 8d2236b

Browse files
committed
Rust: define Format and FormatArgument in schema
1 parent d4b2dc3 commit 8d2236b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

rust/schema/annotations.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,3 +1760,32 @@ class _:
17601760
@synth.on_arguments(parent="FormatArgsExpr", index=int, kind=int)
17611761
class ImplicitVariableAccess(Expr):
17621762
pass
1763+
1764+
1765+
@qltest.skip
1766+
@synth.on_arguments(parent=FormatArgsExpr, index=int)
1767+
class Format(Locatable):
1768+
"""
1769+
A format element in a formatting template. For example the `{}` in:
1770+
```rust
1771+
println!("Hello {}", "world");
1772+
```
1773+
"""
1774+
parent: FormatArgsExpr
1775+
index: int
1776+
1777+
1778+
@qltest.skip
1779+
@synth.on_arguments(parent=FormatArgsExpr, index=int, kind=int)
1780+
class FormatArgument(Locatable):
1781+
"""
1782+
An argument in a format element in a formatting template. For example the `width`, `precision`, and `value` in:
1783+
```rust
1784+
println!("Value {value:#width$.precision$}");
1785+
```
1786+
or the `0`, `1` and `2` in:
1787+
```rust
1788+
println!("Value {0:#1$.2$}", value, width, precision);
1789+
```
1790+
"""
1791+
parent: Format

0 commit comments

Comments
 (0)