Is there an easy way to get the program source code as seen by Crystal compiler after all macros being expanded?
I want to print code metrics at that point, such as lines of code per file/class/module/method etc.
Is there an easy way to get the program source code as seen by Crystal compiler after all macros being expanded?
I want to print code metrics at that point, such as lines of code per file/class/module/method etc.
I think RFC: Ability to expand macro (recursively) · Issue #2324 · crystal-lang/crystal · GitHub is still accurate.
*.You can expand one location. (either debug() or the expand tool)
Additionally you will need to expand defs to their specialized versions since a macro expansion inside of them could expand to different code. I don’t think there’s support for that.