Prevent traceur from removing the comments

21 views
Skip to first unread message

Nicolas Badia

unread,
Jan 27, 2015, 10:18:02 AM1/27/15
to traceur-comp...@googlegroups.com
Hi all,

I'm new to traceur compiler and I'm wondering if there is an option to prevent it from removing the comments.

Thanks in advance,

----
Nicolas

John J Barton

unread,
Jan 27, 2015, 10:49:59 AM1/27/15
to traceur-comp...@googlegroups.com
Strictly speaking, Traceur is not "removing" comments.  Traceur parses the input es6, transforms the resulting symbolic tree, and writes es5 source from the result. The tree does not contain the comments and thus they do not appear in the output.

Attaching the comments to the tree is not so difficult in theory, but figuring out where to put them in the output is very difficult. Of course there are simple cases where, say comments precede a function declaration, but in general the input may not be closely related to the output and where do we put comments in those cases.  Some approximate approach would be great but it is a significant bit of work.

So, no such option, sorry.

jjb

--
You received this message because you are subscribed to the Google Groups "traceur-compiler-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to traceur-compiler-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Badia

unread,
Jan 27, 2015, 11:03:07 AM1/27/15
to traceur-comp...@googlegroups.com
Thanks for the quick answer.
From your explanation, I can understand that it would be a significant bit of work.

Thanks again.

---
Nicolas
To unsubscribe from this group and stop receiving emails from it, send an email to traceur-compiler-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages