← Back to context

Comment by pansa2

9 hours ago

> did you feel that whitespace for lexical scoping made the job of writing the lexer significantly more complex?

Significant indentation requires a more complex lexer because it means the lexical grammar is no longer regular. The lexer can't just be a finite state machine, instead it has to maintain a stack of previous indentation levels.

But I don't think many modern languages have a regular lexical grammar anyway. Without significant indentation, some other features still require the lexer to maintain a stack - e.g. string interpolation (Python's f-strings).