This is really, really hard to do because it would overcomplicate the language grammar, as it would have to take comments into account at every step. I am not even sure if it is possible. If someone wants to try it out though. :)
That's why most tools end-up handling comments on the side, separated from parsing. *José Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Sun, Sep 16, 2018 at 6:59 PM, Steve Morin <steve.mo...@gmail.com> wrote: > Wanted to see what peoples thoughts are about adding comments to the AST. > > One use-case is to be able to parse and manipulate Source files outside of > just macros but in that case you would want to be able to preserve > comments. > > E.g. Read a source file, manipulate it, write that source file back to a > file. > > This would allow people/tooling to use elixir to parse and manipulate > source files. > > If this might disturb existing consumers of the AST maybe this could be > added as a option to existing Macro functions so that I could be turned on > for people with this use-case. > > -- > You received this message because you are subscribed to the Google Groups > "elixir-lang-core" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ms > gid/elixir-lang-core/955237D8-31DE-448C-9777-1104F1175DC7%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2B3rS%2BWrD8BbPHLMSS123A4NW29T%2BwM-V40V_1OgQbq_w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.