standardese / cppast

Library to parse and work with the C++ AST
Other
1.7k stars 164 forks source link

Better to_string for cpp_dependent_type #148

Closed deadlocklogic closed 2 years ago

deadlocklogic commented 2 years ago

Dependent types should be named as: typename dependee::name but in the current implementation only the name appears when calling cppast::to_string.

void write_dependent(code_generator::output& output, const cpp_dependent_type& type)
{
    output << token_seq(type.name());
}

Maybe use the dependee type in this snippet for better naming? Thnaks.

foonathan commented 2 years ago

The libclang parser never generates a cpp_dependent_type actually, so I'm curious why you ran into that issue? Nevertheless, it is now formatted properly.

deadlocklogic commented 2 years ago

I made a TypeUtils class which (parses/clones/prints/sanitizes/resolves) cpp_type. So yeah I am stretching the boundaries a bit with this library.