Tom Hvitved
c8736e8a3d
Rust: Auto-generate CfgNodes.qll
2024-11-21 10:21:11 +01:00
Paolo Tranquilli
bd08bc7923
Rust: address review
2024-10-15 14:21:11 +02:00
Tom Hvitved
b284a2a7c0
Rust: Add Callable as a base class of Function and ClosureExpr
2024-10-11 12:00:30 +02:00
Paolo Tranquilli
c364fd7e56
Codegen: allow annotations to replace bases and drop fields
2024-10-10 14:33:06 +02:00
Arthur Baars
05173fa7ac
Merge pull request #17539 from github/redsun82/rust-codegen-detach
...
Rust/Codegen: allow to "detach" property emission
2024-09-23 11:40:11 +02:00
Paolo Tranquilli
c74b6be136
Rust/Codegen: allow to "detach" property emission
...
By using the `rust.detach` pragma on a property, we make that property
not appear in the generated struct as a field, and provide instead
a `generated::Class::emit_property` function that can be used to emit
the corresponding TRAP entry independently.
2024-09-20 16:06:22 +02:00
Paolo Tranquilli
4e59fa9035
Codegen: remove unneeded code
2024-09-20 12:47:45 +02:00
Paolo Tranquilli
f7afcd038a
Codegen: move use_for_null to pragmas
2024-09-20 12:47:45 +02:00
Paolo Tranquilli
d2ebe00492
Codegen: move group to parametrized pragmas
2024-09-20 12:47:44 +02:00
Paolo Tranquilli
2533f18a6e
Codegen: move ql.hideable to pragmas
2024-09-20 12:47:44 +02:00
Paolo Tranquilli
8d291ab938
Codegen: move qltest.test_with to parametrized pragmas
2024-09-20 12:47:44 +02:00
Paolo Tranquilli
3e2f886595
Codegen: allow inheritable pragmas
2024-09-20 12:47:43 +02:00
Paolo Tranquilli
db00cb6827
Codegen: move class synth decorators to pragmas
2024-09-20 11:09:22 +02:00
Paolo Tranquilli
9d6ee09f65
Codegen: move rust.doc_test_signature to parametrized pragmas
2024-09-20 11:09:21 +02:00
Paolo Tranquilli
70997e8189
Codegen: move default_doc_name to parametrized pragma
2024-09-20 11:09:21 +02:00
Paolo Tranquilli
9f1d50ebd1
Codegen: allow parametrized pragmas
2024-09-20 11:09:21 +02:00
Paolo Tranquilli
74c0fa7154
Codegen: allow annotations to add class decorations
2024-09-20 08:40:34 +02:00
Paolo Tranquilli
cc5882a3c3
Codegen: allow full annotation of classes
2024-09-20 06:55:17 +02:00
Paolo Tranquilli
97cca76970
Revert "Codegen: allow to include .py files in schema.py"
2024-09-19 16:58:20 +02:00
Arthur Baars
f38f818578
Merge pull request #17516 from github/redsun82/codegen-annotate
...
Codegen: allow to attach docstrings after the definition
2024-09-19 15:35:16 +02:00
Paolo Tranquilli
c117a53fb0
Codegen: allow to attach docstrings after the definition
2024-09-19 12:43:34 +02:00
Paolo Tranquilli
ec9bb1da56
Codegen: allow to include .py files in schema.py
2024-09-19 12:18:52 +02:00
Paolo Tranquilli
3cd8aaf4b0
Rust: simplify rust doc test annotation
2024-09-09 08:59:17 +02:00
Paolo Tranquilli
8c5cc2efdc
Rust: generate test code from schema docstrings
...
This generates test source files from code blocks in class docstrings.
By default the test code is generated as is, but it can optionally:
* be wrapped in a function providing an adequate context using
`@rust.doc_test_function(name, *, lifetimes=(), return_type="()", **kwargs)`,
with `kwargs` providing both generic and normal params depending on
capitalization
* be skipped altogether using `@rust.skip_doc_test`
So for example an annotation like
```python
@rust.doc_test_function("foo",
lifetimes=("a",),
T="Eq",
x="&'a T",
y="&'a T",
return_type="&'a T")
```
will result in the following wrapper:
```rust
fn foo<'a, T: Eq>(x: &'a T, y: &'a T) -> &'a T {
// example code here
}
```
2024-09-06 14:24:42 +02:00
Paolo Tranquilli
7cc20587ad
Codegen: add @qltest.test_with
...
This allows to group together related AST classes to reuse the same
test source and extraction. For example this is useful for
`EnumDecl/EnumCaseDecl/EnumElementDecl`, where this is applied to.
2023-10-23 14:51:22 +02:00
Paolo Tranquilli
700e3d5e53
Codegen: rename ipa to synth
2023-06-07 09:12:39 +02:00
Nora Dimitrijević
928da77d10
Merge branch 'main' into redsun82/swift-synth-properties
2023-06-06 15:34:02 +02:00
Paolo Tranquilli
d2c9847a79
Codegen: parse synth property modifier
2023-05-25 16:05:12 +02:00
Paolo Tranquilli
7dd18ff801
Swift: add @ql.hideable to schema loading
2023-05-23 12:45:18 +02:00
Paolo Tranquilli
92197bf9f2
Codegen: fix autopep8 pre-commit hook
2023-03-29 15:57:45 +02:00
Paolo Tranquilli
00b59f83f2
Codegen: disallow child on set properties
2023-03-29 15:44:06 +02:00
Paolo Tranquilli
bba5d9dbd6
Codegen: add set to schema definitions
2023-03-29 15:44:06 +02:00
Paolo Tranquilli
cdd4e8021b
Move swift/codegen to misc/codegen
2023-02-27 09:46:48 +01:00