Commit Graph

16 Commits

Author SHA1 Message Date
Sébastien Crozet 48c8f6a505
Release v0.33.0 (#1417) 2024-06-23 15:28:37 +02:00
Andreas Borgen Longva eb228faa2b
Improved stack! implementation, tests (#1375)
* Add macro for concatenating matrices

* Replace DimUnify with DimEq::representative

* Add some simple cat macro output generation tests

* Fix formatting in cat macro code

* Add random prefix to cat macro output

* Add simple quote_spanned for cat macro

* Use `generic_view_mut` in cat macro

* Fix clippy lints in cat macro

* Clean up documentation for cat macro

* Remove identity literal from cat macro

* Allow references in input to cat macro

* Rename cat macro to stack

* Add more stack macro tests

* Add comment to explain reason for prefix in stack! macro

* Refactor matrix!, stack! macros into separate modules

* Take all blocks by reference in stack! macro

* Make empty stack![] invocation well-defined

* Fix stack! macro incorrect reference to data

* More extensive tests for stack! macro

* Move nalgebra-macros tests to nalgebra tests

By testing matrix!, stack! macros etc. in nalgebra, we ensure that
these macros are used in the same way that users will be using them.

* Fix stack! code generation tests

* Add back nalgebra as dev-dependency of nalgebra-macros

* Fix accidental wrong matrix! macro references in docs

* Rewrite stack! documentation for clarity

* Formatting

* Skip formatting of macro, rustfmt messes it up

* Rewrite stack! impl for improved clarity, Span behavior

This improves error messages upon dimension mismatch, among other
things. I've also tried to make the implementation easier to understand,
adding some comments to help the reader understand the individual steps.

* Use SameNumberOfRows/Columns instead of DimEq in stack! macro

This gives more accurate compiler errors if matrix dimensions
are mismatched.

* Check that stack! panics at runtime for basic dimension mismatch

* Add suggested edge cases from initial PR to tests

* stack! impl: use fixed prefix everywhere

This ensures that the expected generated code in tests
is the actual generated code when used in the wild.

* nalgebra-macros: Remove clippy pedantic, fix clippy complaints

pedantic seems to be mostly intent on wasting the programmer's time

* Add stack! sanity tests for built-ins and Complex

* Fix formatting in test

* Improve readability of format_ident! calls in stack! impl

* fix trybuild tests

* chore: run tests with a specific rust version

* More trybuild fixes

---------

Co-authored-by: Birk Tjelmeland <git@birktj.no>
Co-authored-by: Sébastien Crozet <sebcrozet@dimforge.com>
2024-06-23 11:29:28 +02:00
Yotam Ofek 5cb9dcbda1
Update syn to `2.0` (#1342) 2024-06-22 18:43:32 +02:00
Sébastien Crozet e977ad8774
Release nalgebra-macro v0.2.1 2023-07-09 12:06:38 +02:00
Sébastien Crozet 8e5e54d196 Bump version of nalgebra-macros 2023-01-14 17:55:56 +01:00
Sébastien Crozet 8aa34a952f Release v0.32.0 2023-01-14 17:04:22 +01:00
Sébastien Crozet b656faa233 Release v0.31.0 2022-04-30 10:59:26 +02:00
Sébastien Crozet e8b9c40123 Release v0.30.0 2022-01-02 15:30:15 +01:00
Sébastien Crozet db63f6c031 Release v0.29.0 2021-08-08 17:54:35 +02:00
Crozet Sébastien ca1297acfb Release v0.28.0 2021-07-11 17:42:45 +02:00
Crozet Sébastien dfc8ad3d6a Release v0.27.0 2021-06-02 15:15:17 +02:00
Andreas Longva f42ecf0ebb Improve nalgebra-macros/Cargo.toml metadata 2021-05-05 08:51:16 +02:00
Andreas Longva da077497a2 Add trybuild tests to test error message reported when matrix dims mismatch 2021-05-03 13:52:34 +02:00
Andreas Longva e60136fbb1 Update nalgebra-macros to nalgebra 0.26 and const generics 2021-05-03 13:52:34 +02:00
Andreas Longva ab95cf7020 Initial impl using syn and quote 2021-05-03 13:52:34 +02:00
Andreas Longva e97692255b Initial hacked together prototype without syn 2021-05-03 13:52:34 +02:00