9 Commits

Author SHA1 Message Date
Tom Hvitved
c8736e8a3d Rust: Auto-generate CfgNodes.qll 2024-11-21 10:21:11 +01:00
Paolo Tranquilli
a5e3fbf367 Codegen/Rust: allow breaking up schema file 2024-09-19 15:57:42 +02:00
Tom Hvitved
18ae8b14e9 Rust: Use elements/internal/generated instead of internal/generated 2024-09-18 10:44:20 +02:00
Tom Hvitved
efa52acf73 Rust: Move codeql/rust/generated files into codeql/rust/internal/generated 2024-09-17 08:51:24 +02:00
Tom Hvitved
683ecc39d8 Rust: Adjust some generated Impl files 2024-09-16 13:39:57 +02:00
Paolo Tranquilli
56e127849f Rust/Codegen: fix generated list files 2024-09-09 12:31:09 +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
4f0fe1ce3a Rust: bazel packaging 2024-08-30 13:05:46 +02:00
Paolo Tranquilli
590a146b49 Rust: some basic extraction of function names (with locations!) 2024-08-29 17:58:50 +02:00