Commit Graph

118 Commits

Author SHA1 Message Date
Benedikt Peetz ddd9255c2e build(cog): Remove wrong toml header 2024-05-04 10:22:03 +02:00
Benedikt Peetz 07c38468ce chore(treewide): Renew copyright headers 2024-05-04 10:20:25 +02:00
Benedikt Peetz c7b8fb3f86 build(cog): Use new `renew_copyright_header` script 2024-05-04 10:19:57 +02:00
Benedikt Peetz 0a60c894d2 feat!(src/macros): Store allocation location in all strings
This makes it possible to automatically free the string in the correct
way expected by both c and rust.
Rust strings can now just be freed by the rust allocator, whilst c
strings 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-04 10:12:20 +02:00
Benedikt Peetz 86427b0c1a refactor(src/macros/generate/host): Merge host generation in one module 2024-05-04 08:23:36 +02:00
Benedikt Peetz 0774ac2124 chore(Cargo.toml): Add further required metadata 2024-05-03 20:02:17 +02:00
Benedikt Peetz 475e7edadf chore(Cargo.toml): Add required metadata 2024-05-03 19:32:44 +02:00
Benedikt Peetz 366efd8331
docs(README): Mention the binary 2024-03-27 23:04:14 +01:00
Benedikt Peetz 1e078fa46d
tests(types): Update to represent a minimal change in the library 2024-03-27 23:03:45 +01:00
Benedikt Peetz 06c61ade54
docs(README): Add 2024-03-27 22:53:08 +01:00
Benedikt Peetz 6bed2a843a
fix(example/main): Ignore generated api.rs debugging file 2024-03-27 22:36:26 +01: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
Benedikt Peetz a66c687421
fix(macros/generate/convert/auxiliary/c): Correctly generate function types 2024-03-27 10:54:01 +01:00
Benedikt Peetz 055cf2d5ce
test: Add new multiline display for c auxiliary code 2024-03-27 10:51:39 +01:00
Benedikt Peetz b1d47de7e3
test(multiple): Ignore, as it's not a important feature 2024-03-27 10:22:48 +01:00
Benedikt Peetz 9a0720e5e9
fix(docs/generate_docs): Cd into the correct directory to make ebnf2pdf work 2024-03-27 10:21:50 +01:00
Benedikt Peetz 838181c116
docs(grammar.ebnf): Don't reimplement already specified rules 2024-03-27 10:21:06 +01:00
Benedikt Peetz bb101c14fb
feat(macros/generate/convert/auxiliary): Merge comments in c
```c
/**
  comment one
  */
/**
  comment two
  */
/**
  comment three
  */
```
is just not as readable as:
```c
/**
  * comment one
  * comment two
  * comment three
  */
```
2024-03-27 10:17:38 +01:00
Benedikt Peetz 37ba451362
fix(types): Remove top-level support for generic types
These would still parse and would generate _stuff_, but the generated
stuff is just not ideal yet. So better not accept them, until their
internal support has matured.
2024-03-27 10:01:51 +01:00
Benedikt Peetz 9a8ccc9cc2
fix(macros/generate): Correctly generate function types 2024-03-27 10:01:07 +01:00
Benedikt Peetz 7a8dc66876
fix(parser/unchecked/parse_structure): Accept attributes on fields 2024-03-27 09:59:35 +01:00
Benedikt Peetz fae3de8b49
fix(parser/lexing/take_until_sucessive_match): Add utf8 support 2024-03-27 09:58:08 +01:00
Benedikt Peetz 9233a136ee
build(.envrc): Add `./target/debug` to PATH 2024-03-27 08:11:44 +01:00
Benedikt Peetz 4e3bdf273e
fix(binary/parse): Actually only perform the other steps, if asked for it
Otherwise, the lexing functionality becomes useless, if the Trixy file
can't be parsed and processed.
2024-03-27 08:10:33 +01:00
Benedikt Peetz 508dc2bc46
fix(parser/tokenizer): Remove the tokenizer's death, when exposed to doc comments
Previously, the tokenizer had horrendous errors when lexing raw literal
strings. These have been removed. The remaining issue still persists,
that empty doc comments are serialized in c in a _weird_ way. They
should be merged.
2024-03-27 08:07:29 +01:00
Benedikt Peetz 00a82ac54b
fix(scripts/renew_copyright_header): Set correct template line lenght 2024-03-26 21:12:40 +01:00
Benedikt Peetz 5ab2bbb8fd
chore(treewide): Update license header 2024-03-26 20:11:23 +01:00
Benedikt Peetz dc000f2bed
chore(.licensure.yml): Remove unnecessary line in header comment 2024-03-26 20:08:35 +01:00
Benedikt Peetz 9e7e9d7b12
fix(scripts/renew_copyright_header): Add support for gitignore files 2024-03-26 20:08:12 +01:00
Benedikt Peetz 4110f659c6
style(flake): Use yamlfmt instead of prettier 2024-03-26 20:07:32 +01:00
Benedikt Peetz 2b4599592c
chore(treewide): Add or update license header 2024-03-26 19:58:24 +01:00
Benedikt Peetz 3646e4aee8
fix(scripts/renew_copyright_header): Correctly handle shebangs 2024-03-26 19:58:22 +01:00
Benedikt Peetz 3484ead8af
fix(scripts/renew_copyright_header): Add per filetype handling
Otherwise, the mistakes are not avoidable.
2024-03-26 19:58:20 +01:00
Benedikt Peetz a653dec211
chore(docs/generate_docs): Add a `.sh` extension, so scripts recognize the ft 2024-03-26 19:58:19 +01:00
Benedikt Peetz 596197be92
build(flake): Update 2024-03-26 19:58:17 +01:00
Benedikt Peetz e9efc2335a
build(scripts/renew_copyright_header): Init 2024-03-26 19:58:15 +01:00