Parsing templated types

Ah - thanks very much.

I have another question for you if you don’t mind.

I am trying to use various features in the python api to compile a type declaration snippet into a tinfo_t object. I would like these declarations to include C++ template type definitions, so something like:

  1. A (func*)(C<D> p1); or

  2. C;

would compile. I tried using the parser from ida_srclang, but it requires the snippet to be syntactically complete (so 1 won’t compile) and the type declarations needed to parse the snippet to be in the scope of that snippet. This is different than how it works using something like ida_typeinf.parse_decl, which will happily parse a snippet like 1 in isolation - the only problem is it will not accept the template syntax.

So is there some way to get ida_typeinf.parse_decl to accept the template syntax? Or some other call that I have not yet found that will? I tried using idauser.cfg to have it accept the < and > characters, and while that works for the GUI, it does not affect the parser.

Thanks.

Igor,

I my previous email, I incorrectly referenced snippet 1 when I meant it to be snippet 2. Sorry for the confusion.

I’ve done it for you this time, but please post unrelated questions as a new topic so it’s easier to find in future, thank you.
As for the question at hand, currently template syntax can’t be parsed by parse_decl and related functions. We have it in our TODO but it’s a pretty complicated subject so unlikely to appear soon.