Merge branch 'main' into redsun82/rust-tweaks

This commit is contained in:
Paolo Tranquilli
2024-12-04 09:35:01 +01:00
60 changed files with 1195 additions and 521 deletions

View File

@@ -550,15 +550,45 @@ class _:
"""
@annotate(ArrayExpr, cfg = True)
@annotate(ArrayExprInternal)
@ql.internal
@qltest.skip
class _:
pass
class ArrayExpr(Expr):
"""
An array expression. For example:
The base class for array expressions. For example:
```rust
[1, 2, 3];
[1; 10];
```
"""
exprs: list[Expr] | child
attrs: list[Attr] | child
@synth.from_class(ArrayExprInternal)
class ArrayListExpr(ArrayExpr):
"""
An array expression with a list of elements. For example:
```rust
[1, 2, 3];
```
"""
__cfg__ = True
@synth.from_class(ArrayExprInternal)
class ArrayRepeatExpr(ArrayExpr):
"""
An array expression with a repeat operand and a repeat length. For example:
```rust
[1; 10];
```
"""
__cfg__ = True
repeat_operand: Expr | child
repeat_length: Expr | child
@annotate(LiteralExpr, cfg = True)

3
rust/schema/ast.py generated
View File

@@ -38,9 +38,10 @@ class Abi(AstNode):
class ArgList(AstNode):
args: list["Expr"] | child
class ArrayExpr(Expr):
class ArrayExprInternal(Expr):
attrs: list["Attr"] | child
exprs: list["Expr"] | child
is_semicolon: predicate
class ArrayTypeRepr(TypeRepr):
const_arg: optional["ConstArg"] | child