Commit Graph

771 Commits

Author SHA1 Message Date
Paolo Tranquilli
b4b680775c Rust: integrate into standard files+location library 2024-09-12 13:17:10 +02:00
Simon Friis Vindum
67a06cb772 Rust: Support loop in CFG 2024-09-12 09:29:19 +02:00
Paolo Tranquilli
aeae922ef3 Rust: make ql tests extract files together
For the moment this removes the possibility to set custom flags or env
variables for the extractor via comments, but that can be added back
easily if needed with a different mechanism (like an `env` file).
2024-09-12 09:13:35 +02:00
Geoffrey White
c2e86423b9 Rust: Test the successfully extracted files diagnostic. 2024-09-11 17:10:08 +01:00
Geoffrey White
f1d281ffcc Rust: Add test cases for diagnostics. 2024-09-11 17:10:07 +01:00
Simon Friis Vindum
857edb791c Rust: Fix control flow tree for function and block expression 2024-09-11 11:18:56 +02:00
Simon Friis Vindum
809d040528 Make more classes private and final 2024-09-11 09:37:39 +02:00
Simon Friis Vindum
91d5171d90 Add base setup for control flow graph construction 2024-09-11 09:08:53 +02:00
Paolo Tranquilli
4f90f5fb4c Rust: accept test changes 2024-09-10 17:36:18 +02:00
Paolo Tranquilli
9c8f6145ab Merge pull request #17408 from github/aibaars/rust-experiment
Rust: add partial extractor for Expr, Statement, Pattern
2024-09-10 17:09:47 +02:00
Arthur Baars
a5d1d9e167 Make implementation more complete
Use Unimplemented to mark AstNodes  that need implementing
2024-09-10 14:13:05 +02:00
Paolo Tranquilli
ef06b555c1 Rust: accept test changes 2024-09-10 11:29:54 +02:00
Paolo Tranquilli
56e127849f Rust/Codegen: fix generated list files 2024-09-09 12:31:09 +02:00
Paolo Tranquilli
10a23c0843 Merge branch 'rust-experiment' into redsun82/rust-doctest-gen 2024-09-09 12:20:55 +02:00
Paolo Tranquilli
ac9e977baa Rust: remove accidental test source file 2024-09-06 14:29:10 +02:00
Paolo Tranquilli
18c423eb55 Rust: fix formatting of code snippet in docstring 2024-09-06 14:27:57 +02:00
Paolo Tranquilli
6111a7497d Rust: remove accidental schema annotation 2024-09-06 14:26:36 +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
Arthur Baars
46d6bbb458 Rust: update generated code 2024-09-05 16:59:29 +02:00
Paolo Tranquilli
885e89a927 Rust: first running tests 2024-08-30 17:45:51 +02:00
Paolo Tranquilli
590a146b49 Rust: some basic extraction of function names (with locations!) 2024-08-29 17:58:50 +02:00