Oliver Hunt wrote:
> <snip>
> 
>> OTOH, if we standardize an AST format, then presumably we'll be adding
>> a source->AST API function that uses the implementation's existing parser.
> 
> I'd be worried about assuming that this is an obvious/trivial thing for
> implementations to do, you're effectively requiring that the internal AST
> representation of an implementation be entirely standardised.

Not at all. An implementation could, for example, parse to its internal
AST format and then convert from that to the standard format (which is a
trivial tree walk). This only requires that the internal format not lose
information relative to the standard one. If it does currently lose
information, then changing it not to is relatively straightforward.

In any case, without a source->AST API, what use is a standard AST format?
The existance of that API (and the corresponding AST->source pretty-printing
API) is the main motivation for standardizing the format, AFAICS.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to