On 12/16/2013 01:17 PM, Gregory Szorc wrote: > Does SpiderMonkey expose documentation blocks to the AST? If not, should it?
No, and probably not. Comments are not tokens, so they're not in the AST. Right now SpiderMonkey pretty much just throws them away (except to the extent the comment includes a line break, in which case /*\n*/ and similar represent a line break for semicolon-insertion rules). And it'd be really unfortunate to have to include them -- then things like a DoWhileNode would have to be gunked up a bunch to store information like in |do { } /* fnord */ while /* quoi */ (true);|. Maybe there's some sort of intelligent exposure that could nonetheless be done. But I doubt it's a good idea to build it atop a parser designed for executing code, and not for exactly faithfully representing it. Jeff _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform