4 ms·
Implementation simplicity also sounds good to me. BTW, it's discussed in the manual: Nim's standard grammar describes an indentation sensitive language. This m
by otherme123 4y ago
Implementation simplicity also sounds good to me. BTW, it's discussed in the manual:
Nim's standard grammar describes an indentation sensitive language. This means that all the control structures are recognized by indentation. Indentation consists only of spaces; tabulators are not allowed.
The indentation handling is implemented as follows: The lexer annotates the following token with the preceding number of spaces; indentation is not a separate token. This trick allows parsing of Nim with only 1 token of lookahead.