Hacker News new | ask | show | jobs
by qznc 4152 days ago
It should basically read the token stream instead of the text. For Python that includes indent and dedent tokens, which are equivalent to open and close brackets.
1 comments

Maybe it suffices to just say "end if/for/def/class/etc" at the end of each block.