Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While line/column works nicely if no modification was done on the AST, it works pretty bad with modification.

Furthermore, you can't do cosmetic (e.g., indentation) changes on the AST that will reflect back on the source code (preserving user, i.e., non-modified, style decisions).

The Microsoft example (thinking of Roslyn) offers a great lossless syntax tree written with immutable data structures.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: