Fix nested array ordering

This commit is contained in:
Luke Street 2022-09-03 12:31:35 -04:00
parent 0dbe134330
commit 5318f6ac53
1 changed files with 5 additions and 1 deletions

View File

@ -142,7 +142,7 @@ fn demangle_arg(mut str: &str) -> Option<(String, String, &str)> {
let (arg_pre, arg_post, rest) = demangle_arg(&rest[1..])?;
if !post.is_empty() { post = format!("({})", post); }
result = format!("{}{}{}", pre, arg_pre, post);
let ret_post = format!("{}[{}]", arg_post, count);
let ret_post = format!("[{}]{}", count, arg_post);
return Some((result, ret_post, rest));
}
result.push_str(match str.chars().next().unwrap() {
@ -459,5 +459,9 @@ mod tests {
demangle("RenderNormals__FRA43_A43_CQ220CFluidPlaneCPURender13SHFieldSampleRA22_A22_CUcRCQ220CFluidPlaneCPURender10SPatchInfo"),
Some("RenderNormals(const CFluidPlaneCPURender::SHFieldSample(&)[43][43], const unsigned char(&)[22][22], const CFluidPlaneCPURender::SPatchInfo&)".to_string())
);
assert_eq!(
demangle("Matrix__FfPA2_A3_f"),
Some("Matrix(float, float(*)[2][3])".to_string())
);
}
}