Computing Indentation from Syntax Trees

from blog marijnhaverbeke.nl/blog, | ↗ original
Most code editors have some concept of automatic indentation. For each language, they have some logic that can compute an appropriate indentation for a given line. They may immediately indent when you press Enter, or require some interaction to reindent a line or selection. Even with the cleverest tools, there isn't always a single definite...