Commit Graph

22 Commits

Author SHA1 Message Date
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
Paolo Tranquilli
122e5a7598 Rust: remove accidental IDE files 2024-09-06 12:05:11 +02:00
Paolo Tranquilli
8ecba44ea9 Rust: add experimental bazel target 2024-09-06 09:29:54 +02:00
Arthur Baars
0516505033 Rust: update dependencies 2024-09-05 16:58:41 +02:00
Arthur Baars
6fd469c807 Rust: use autodiscovery for sysroot
This should make the rust-analyzer library look for a rust toolchain and
try to start the proc-macro server.
2024-09-05 14:49:37 +02:00
Arthur Baars
d93330bc4c Rust: make printAst work 2024-09-05 14:49:36 +02:00
Arthur Baars
d8eb5d463d Rust: run cargo fmt 2024-09-05 14:45:47 +02:00
Arthur Baars
60b349f7e5 Rust: remove 'take(1)' from crates iterator 2024-09-05 14:45:46 +02:00
Arthur Baars
be16954521 Rust: add autobuild.sh 2024-09-05 14:45:45 +02:00
Arthur Baars
52ef1e382a Add 'version' field to generated Cargo.toml file 2024-09-05 14:45:44 +02:00
Paolo Tranquilli
885e89a927 Rust: first running tests 2024-08-30 17:45:51 +02:00
Paolo Tranquilli
7e1290aa74 Rust: reuse shared rust trap library 2024-08-30 16:08:37 +02:00
Paolo Tranquilli
4f0fe1ce3a Rust: bazel packaging 2024-08-30 13:05:46 +02:00
Paolo Tranquilli
04753b286f Rust: tweak trap_key 2024-08-30 10:12:20 +02:00
Paolo Tranquilli
590a146b49 Rust: some basic extraction of function names (with locations!) 2024-08-29 17:58:50 +02:00
Paolo Tranquilli
f40901f391 Rust: archiving + skeleton def translator 2024-08-28 17:15:49 +02:00
Paolo Tranquilli
2a2b79e6df Rust: skeleton trap file emission code 2024-08-27 17:50:53 +02:00
Paolo Tranquilli
927710017e Rust: add some configuration and logging 2024-08-27 17:07:23 +02:00
Paolo Tranquilli
0e3c867cb9 Toy rust program listing definitions of a cargo project 2024-08-16 10:37:49 +02:00