3 ms·
There are simpler and less intrusive ways to solve outside-AST issues (like an automatic reformatting pass before each build or each diff) What you're suggesti
by Ace17 11y ago
There are simpler and less intrusive ways to solve outside-AST issues (like an automatic reformatting pass before each build or each diff)
What you're suggesting raises a bunch of new (non-trivial) issues:
- What would you do with code comments? Things like "f(/+old_value+/new_value)".
- How to store code before preprocessing (C and C++) ?
- How to store files mixing several languages (PHP, HTML, Javascript) ?
- How do you store code for a DSL?
- sitkack 11y ago> - What would you do with code comments? Things like "f(/+old_value+/new_value)". Comments are included in the AST, the AST should be reprojectable into canonical plaint text. > - How to store code before preprocessing (C and C++) ? This could get tricky, punt. cdata > - How to store files mixing several languages (PHP, HTML, Javascript) ? Same file format, different semantics. PHP is a DSL. My new language manifesto includes having a mandatory publicly defined AST.
- marssaxman 11y agoIf it is reprojectable into canonical plain text, it's not really an AST - just an ST.