mangler

Crates.iomangler
lib.rsmangler
version0.2.0
sourcesrc
created_at2024-08-29 09:56:06.028835
updated_at2024-08-29 10:22:13.048858
descriptionA simple Rust program that mangles and parse C++ symbol names using Itanium ABI.
homepagehttps://github.com/NightProg/mangler
repositoryhttps://github.com/NightProg/mangler
max_upload_size
id1355924
size12,785
NightProg (NightProg)

documentation

README

mangler

A simple Rust program that mangles and parse C++ symbol names using Itanium ABI.

Example

use mangler::*;

fn main() {
    let mangled = mangle("foo::bar::hello(int, float, std::string)");
    println!("{}", mangled); // _ZN3foo3bar5helloEifSs

    let mangled = mangle(
        Symbol::Function(
            Box::new(
                Symbol::Namespace(
                    vec![
                        Symbol::Type("hello".to_string()),
                        Symbol::Type("world".to_string()),
                        Symbol::Generic(
                            vec![
                                Symbol::Typed(
                                    Box::new(
                                        Symbol::Type("int".to_string())
                                    ),
                                    vec![TypedElement::Ptr]
                                )
                            ]
                        ),
                        Symbol::Type("print".to_string())
                    ]
                )
            ),
            vec![
                Symbol::Type("int".to_string()),
                Symbol::Type("float".to_string()),
                Symbol::Type("std::string".to_string())
            ]
        )
    );

    println!("{}", mangled); // _ZN5hello5worldIPiE5printEifSs
  
}
Commit count: 0

cargo fmt