AFAIU `dumpTree` will let me get the AST of the code block passed to it. But 
the question is, how do I effectively iterate over the AST without hardcoded 
indices and a ton of nested loops.

I probably should have formulated the question more clearly. I have a generic 
type section which differs from a regular one only by having custom pragmas for 
attributes. I need a generic way—a programming pattern, idiom, or Nim 
construct—to extract these pragmas and strip them out of the type section.

As I'm thinking about it now, it seems like there's no easy way out: you just 
have to parse the AST manually and them manually rebuild it. I was just 
thinking maybe there was a convenient tool for that I have overlooked.

Reply via email to