Latest Nim dev has custom pragmas that can be useful in this case. Details at the bottom of [https://github.com/nim-lang/Nim/blob/devel/doc/manual/pragmas.txt](https://github.com/nim-lang/Nim/blob/devel/doc/manual/pragmas.txt)
Examples: [https://github.com/nim-lang/Nim/blob/devel/tests/pragmas/tcustom_pragma.nim](https://github.com/nim-lang/Nim/blob/devel/tests/pragmas/tcustom_pragma.nim) it could be not the only solution through