EFanZh / ast-demangle

MIT License
5 stars 2 forks source link

Add a more structured demangling method #2

Open khuey opened 1 year ago

khuey commented 1 year ago

cpp_demangle has a structured_demangle method that takes a limited form of a visitor trait that gets notified when certain AST nodes are traversed. The way the visitor trait is designed, emitted characters can be tied to certain AST nodes, allowing the consumer to do things like elide template arguments by default.

I'd like to introduce something similar to ast-demangle. Would you be satisfied with a limited visitor trait like cpp_demangle has or would you prefer something that's called for each AST node?

EFanZh commented 1 year ago

@khuey: Do you mean you need a method to traversal the symbol structure without building the Symbol object?

khuey commented 1 year ago

No, I want to produce the Symbol and then see which nodes output which characters (without duplicating that logic myself).

What I'm using right now is in https://github.com/Pernosco/ast-demangle if you want to take a look.