diff options
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/parsetok.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c index 82a5450..0b3e957 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -130,6 +130,15 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, if (type == ENDMARKER && started) { type = NEWLINE; /* Add an extra newline */ started = 0; + /* Add the right number of dedent tokens, + except if a certain flag is given -- + codeop.py uses this. */ + if (tok->indent && + !(flags & PyPARSE_DONT_IMPLY_DEDENT)) + { + tok->pendin = -tok->indent; + tok->indent = 0; + } } else started = 1; |