Keine Beschreibung
Datei suchen
2026-01-30 21:59:58 +01:00
.cargo fixed the version dep 2026-01-17 21:21:17 +01:00
core added deny.toml and fixed problems 2026-01-28 19:40:15 +01:00
wrappers fixed an issue where tuples could not be matched 2026-01-26 22:19:02 +01:00
.editorconfig Updated the library for new types 2026-01-17 18:48:08 +01:00
.gitignore fixed the version dep 2026-01-17 21:21:17 +01:00
.pre-commit-config.yaml Added a lot of rust syntax 2026-01-25 13:50:45 +01:00
Cargo.lock new release 0.6.2 2026-01-30 21:59:58 +01:00
Cargo.toml new release 0.6.2 2026-01-30 21:59:58 +01:00
clippy.toml implemented an core library for parsing data 2026-01-17 10:40:09 +01:00
deny.toml added deny.toml and fixed problems 2026-01-28 19:40:15 +01:00
README.md had to change the interface 2026-01-22 08:05:33 +01:00
rustfmt.toml Updated the library for new types 2026-01-17 18:48:08 +01:00

Common Macros

This is an library i made to make it easier to do stuff with unsynn

Core

This is an basic library it currently implements this:

  • CompileError: An wrapper to emit an Compile Error
  • flatten_tokenstream: Cleans up the tokenstream an simplifies the stream.
  • Attribute & Metadata: Type Aliases to parse Attributes before an struct, function, ...
  • Number: An Parser to parse Binary, Octal, Decimal and Hexadecimal Numbers
    • an way to decode and encode such numbers without prefix is planned

Wrappers

This is an Crate based on the core Crate. Its purpose is for Enums that wrap different types that can only be contained in an enum, but share an common methods of usage. The Macro currently can handle only lifetime generics at the moment. in the end it is planned to be used like this:

wrap_enum!{
    pub enum Example<'a> {
        VariantA(ForeignType<'a, u8>),
        VariantB(ForeignType<'a, u16>),
        VariantC(ForeignType<'a, u32>),
        VariantD(ForeignType<'a, u64>),
    }
    pub fn operation(&self, value) -> TypeB<'a> {
        value.operation()
    }
    pub fn operation2(&self, value, added_argument: bool) -> TypeB<'a> {
        value.operation2(added_argument)
    }
}

In this example the output would result in something like this(Default trait implementations like From excluded):

pub enum Example<'a> {
    VariantA(ForeignType<'a, u8>),
    VariantB(ForeignType<'a, u16>),
    VariantC(ForeignType<'a, u32>),
    VariantD(ForeignType<'a, u64>),
}
impl<'a> Example<'a> {
    pub fn operation(&self) -> TypeB<'a> {
        match self {
            Self::VariantA(value)=>value.operation(),
            Self::VariantB(value)=>value.operation(),
            Self::VariantC(value)=>value.operation(),
            Self::VariantD(value)=>value.operation(),
        }
    }
    pub fn operation2(&self, added_argument: bool) -> TypeB<'a> {
        match self {
            Self::VariantA(value)=>value.operation2(added_argument),
            Self::VariantB(value)=>value.operation2(added_argument),
            Self::VariantC(value)=>value.operation2(added_argument),
            Self::VariantD(value)=>value.operation2(added_argument),
        }
    }
}