How do Python parsers handle indentation? How do Python parsers handle indentation? python python

How do Python parsers handle indentation?


The indentations are handled with two "pseudo tokens" - INDENT and DEDENT. There are some details here. For more information, you should look at the source for the python tokeniser and parser.