parent
0f20b45a49
commit
ad2154fc66
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "cwdemangle"
|
name = "cwdemangle"
|
||||||
version = "0.1.6"
|
version = "0.1.7"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Luke Street <luke@street.dev>"]
|
authors = ["Luke Street <luke@street.dev>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -127,6 +127,12 @@ fn demangle_arg<'a>(
|
||||||
mut str: &'a str,
|
mut str: &'a str,
|
||||||
options: &DemangleOptions,
|
options: &DemangleOptions,
|
||||||
) -> Option<(String, String, &'a str)> {
|
) -> Option<(String, String, &'a str)> {
|
||||||
|
// Negative constant
|
||||||
|
if let Some(str) = str.strip_prefix('-') {
|
||||||
|
let (size, rest) = parse_digits(str)?;
|
||||||
|
let out = format!("-{size}");
|
||||||
|
return Some((out.clone(), String::new(), rest));
|
||||||
|
}
|
||||||
let mut result = String::new();
|
let mut result = String::new();
|
||||||
let (mut pre, mut post, rest) = parse_qualifiers(str);
|
let (mut pre, mut post, rest) = parse_qualifiers(str);
|
||||||
result += pre.as_str();
|
result += pre.as_str();
|
||||||
|
@ -694,6 +700,10 @@ mod tests {
|
||||||
demangle("QuerySymbolToMapFile___Q24nw4r2dbFPUcPC12OSModuleInfoUlPUcUl", &options),
|
demangle("QuerySymbolToMapFile___Q24nw4r2dbFPUcPC12OSModuleInfoUlPUcUl", &options),
|
||||||
Some("nw4r::db::QuerySymbolToMapFile_(unsigned char*, const OSModuleInfo*, unsigned long, unsigned char*, unsigned long)".to_string())
|
Some("nw4r::db::QuerySymbolToMapFile_(unsigned char*, const OSModuleInfo*, unsigned long, unsigned char*, unsigned long)".to_string())
|
||||||
);
|
);
|
||||||
|
assert_eq!(
|
||||||
|
demangle("__ct__Q37JGadget27TLinkList<10JUTConsole,-24>8iteratorFQ37JGadget13TNodeLinkList8iterator", &options),
|
||||||
|
Some("JGadget::TLinkList<JUTConsole, -24>::iterator::iterator(JGadget::TNodeLinkList::iterator)".to_string())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue