Commit Graph

142 Commits

Author SHA1 Message Date
Benedikt Peetz 50c9d45cb7
chore(version): v0.2.1 2024-05-20 15:39:05 +02:00
Benedikt Peetz 5253e59be1
fix(src/types/traits/convert_trait): Remove unneeded imports 2024-05-20 15:38:14 +02:00
Benedikt Peetz afd8169e67
chore(version): v0.2.0 2024-05-20 15:37:01 +02:00
Benedikt Peetz 243a89b8fa
build(NEWS.md): Restore separator
`cog` needs this to know where the changelog starts.
2024-05-20 15:36:16 +02:00
Benedikt Peetz 477b9e149b
build(flake): Ignore correct changelog file 2024-05-20 15:35:29 +02:00
Benedikt Peetz d1f31c2761
chore(c_test): Remove the POC
The feature is implemented, thus it has served it's purpose.
2024-05-20 15:33:53 +02:00
Benedikt Peetz 1677f5c56c
chore(treewide): Add missing license headers 2024-05-20 15:33:53 +02:00
Benedikt Peetz 1f0b9c6f25
fix(example/main): Update to use the new result type 2024-05-20 15:33:52 +02:00
Benedikt Peetz 9000c1de02
feat(src): Add real and working support for results
Every `Result` is now -- on demand -- instantiated (i.e. the generic types
are replaced with the concretely specified ones). And can thus simply be
exported to c.
2024-05-20 15:33:51 +02:00
Benedikt Peetz ee8e860789
build(update.sh): Don't always perform the expensive `upgrade` 2024-05-20 15:33:50 +02:00
Benedikt Peetz c6dc9db2e8
docs(grammar.pdf): Regenerate with new landscape ebnf2pdf script 2024-05-20 15:33:50 +02:00
Benedikt Peetz 650d577b3b
fix(src/parsing): Remove the extra `error` attribute keyword
This keyword marked an enum as being an error, which is exactly what
`derive(Error)` already does. Thus this extra attribute keyword has been
removed and the `error` name has been used to rename the `msg` attribute
keyword, to be in-line with what `thiserror` does.
2024-05-20 15:33:49 +02:00
Benedikt Peetz 7e2cbb4fc3
test(error_derive): Init 2024-05-20 15:33:48 +02:00
Benedikt Peetz 4f846058ba
fix(parser/unchecked/attributes): Correctly enforce an identifier in `derive`
The ebnf grammar specifies an identifier (namely “Error” in the
`derive` attribute.), while the parser expected a string literal there.
2024-05-20 15:33:47 +02:00
Benedikt Peetz 9953b50846
refactor(example/main/.cargo/config): Add a `.toml` extension
Cargo is deprecating the old name (i.e. without the `.toml` extension).
2024-05-20 15:33:46 +02:00
Benedikt Peetz 83ba3b4c17
build(treewide): Update 2024-05-20 15:33:46 +02:00
Benedikt Peetz e57bd4024d
test(results): Add a test for results 2024-05-20 15:33:45 +02:00
Benedikt Peetz 7034cf70ce
docs(c_test): Add a poc regarding results in c 2024-05-20 15:33:44 +02:00
Benedikt Peetz 7bced94bdd
test(src/types/newtypes): Test if a full round-trip works 2024-05-20 15:33:44 +02:00
Benedikt Peetz 1599631431
test(tests): Update to new String wrapper 2024-05-20 15:33:43 +02:00
Benedikt Peetz 601d82d5c9
chore(version): v0.1.1 2024-05-20 15:33:42 +02:00
Benedikt Peetz 994b3deb33
chore(version): v0.1.0 2024-05-20 15:33:41 +02:00
Benedikt Peetz 5f9ef33dfc
build(cog): Avoid building the project with nix, as this fails 2024-05-20 15:33:41 +02:00
Benedikt Peetz c9622c15bc
fix(gitignore): Don't ignore the `Cargo.lock` file 2024-05-20 15:33:39 +02:00
Benedikt Peetz ecfdb0abda
build(cog): Remove wrong toml header 2024-05-20 15:33:39 +02:00
Benedikt Peetz 447370d554
chore(treewide): Renew copyright headers 2024-05-20 15:33:38 +02:00
Benedikt Peetz 198421761c
build(cog): Use new `renew_copyright_header` script 2024-05-20 15:33:37 +02:00
Benedikt Peetz 2e92028de2
feat(src/macros)!: Store allocation location in all stringsThis makes it possible to automatically free the string in the correctway expected by both c and rust.Rust strings can now just be freed by the rust allocator, whilst cstrings are forgotten, so that the c allocator may free them.BREAKING CHANGE: All usage of explicit mentions `std::string::String` in your `handle_cmd` function will need to be replaced by `trixy::types::newtypes::String`. Otherwise these types should provide the same methods. 2024-05-20 15:33:36 +02:00
Benedikt Peetz 0f131c957f
refactor(src/macros/generate/host): Merge host generation in one module 2024-05-20 15:33:36 +02:00
Benedikt Peetz 4d76282b99
chore(Cargo.toml): Add further required metadata 2024-05-20 15:33:33 +02:00
Benedikt Peetz cc788a9493
chore(Cargo.toml): Add required metadata 2024-05-20 15:33:32 +02:00
Benedikt Peetz 6c64180676
docs(README): Mention the binary 2024-05-20 15:33:32 +02:00
Benedikt Peetz 91adaa2b70
test(types): Update to represent a minimal change in the library 2024-05-20 15:33:30 +02:00
Benedikt Peetz c787aa2e27
docs(README): Add 2024-05-20 15:33:30 +02:00
Benedikt Peetz ed4a113141
fix(example/main): Ignore generated `api.rs` debugging file 2024-05-20 15:33:22 +02:00
Benedikt Peetz bd0b3c7dcf
fix(generate/convert/host/rust/derive/structure): Ignore `ptr` arg on todo 2024-03-27 22:36:24 +01:00
Benedikt Peetz 5a9de1ac0a
test(tests): Update `expected.md` files 2024-03-27 22:36:22 +01:00
Benedikt Peetz a766149521
style(treewide): Format 2024-03-27 22:36:19 +01:00
Benedikt Peetz 7f6c76a6a6
docs(example/main): Update to include newly added callbacks 2024-03-27 22:36:17 +01:00
Benedikt Peetz c69c00e1e9
feat(types/try_from_impl): Add a trixy::String from &str impl
This makes it more convenient to use the api.
2024-03-27 22:36:15 +01:00
Benedikt Peetz db5cd1a29b
fix(macros): Mark the main generate function as must_use
The generated FileTree should be used, calling the function without
using it is useless.
2024-03-27 22:36:12 +01:00
Benedikt Peetz 73416da73c
docs(macros/generate): Improve error output 2024-03-27 22:36:10 +01:00
Benedikt Peetz febb2deae3
fix(types/types_list): Add the supported primitive types
Otherwise, the generated type paths lead nowhere.
2024-03-27 22:36:09 +01:00
Benedikt Peetz a58030ce7e
fix(macros/generate/host/host/type): The function type is a c pointer 2024-03-27 22:36:05 +01:00
Benedikt Peetz 645b8d58f6
fix(macros/generate/host/c/function): Actually call the callback function
Previously, the generated c wrapper function did not call the callback
correctly.
2024-03-27 22:36:03 +01:00
Benedikt Peetz b5f5ae8b03
fix(macros/generate/host): Add unified support for conversions
These include from the c type to rust, vice versa.
2024-03-27 22:36:01 +01:00
Benedikt Peetz 3d35d395f3
fix(macros/generate/auxiliary/c/function): Also add inputs when no output 2024-03-27 22:35:59 +01:00
Benedikt Peetz 475dde282c
test(tests): Update 2024-03-27 22:35:57 +01:00
Benedikt Peetz 2e2028da31
build(update.sh): Include the main example in the updates 2024-03-27 22:35:54 +01:00
Benedikt Peetz bfeb62033a
fix(macros/generate/convert/auxiliary/c/arguments): Accept newlines
Multiple lines in one comment were not checked for, which resulted in
only one `*` before instead of a new one after every `\n`.
2024-03-27 22:35:52 +01:00