Trevor Gross 5b0a775c12 Adjust how the proc macro emits types and add an enum
Currently the macro always provides `CFn`, `RustFn`, `RustArgs`, etc.
Change this so that:

1. This information must be explicily requested in the invocation.
2. There is a new `FTy` field available that emits a single float type,
   rather than a tuple or signature.

Additionally, add two new macros that create enums representing function
names.
2024-11-02 10:54:00 -05:00

20 lines
481 B
Rust

#[libm_macros::function_enum(BaseName)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Function {}
#[libm_macros::base_name_enum]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum BaseName {}
#[test]
fn as_str() {
assert_eq!(Function::Sin.as_str(), "sin");
assert_eq!(Function::Sinf.as_str(), "sinf");
}
#[test]
fn basename() {
assert_eq!(Function::Sin.base_name(), BaseName::Sin);
assert_eq!(Function::Sinf.base_name(), BaseName::Sin);
}