可以通过宏获得评论吗? [英] Is that possible to get comments with macro?
本文介绍了可以通过宏获得评论吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图解析一些代码并重新格式化它们,但似乎引用只会忽略注释.
I was trying to parse some code and reformat them, but it seems that quote will just ignore the comments.
有什么办法可以做到这一点?我想我必须深入到erlang方面?
Is there any way to achieve this? I guess I have to dive into the erlang side?
推荐答案
否,您无法在宏内获取代码注释.它们永远不会成为AST的一部分,并且仍然被Elixir的令牌生成器丢弃.
No, you cannot get code comments inside macros. They never become part of the AST and are discarded still in Elixir's tokenizer.
这篇关于可以通过宏获得评论吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文