Skip to content

Commit

Permalink
bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pablogsal committed Apr 27, 2020
1 parent 2b74c83 commit b94dbd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion Lib/test/test_codeop.py
Expand Up @@ -122,7 +122,6 @@ def test_valid(self):
av("def f():\n pass\n#foo\n")
av("@a.b.c\ndef f():\n pass\n")

@support.skip_if_new_parser("Pegen does not support PyCF_DONT_INPLY_DEDENT yet")
def test_incomplete(self):
ai = self.assertIncomplete

Expand Down
2 changes: 1 addition & 1 deletion Parser/pegen/pegen.c
Expand Up @@ -553,7 +553,7 @@ _PyPegen_fill_token(Parser *p)
type = NEWLINE; /* Add an extra newline */
p->parsing_started = 0;

if (p->tok->indent) {
if (p->tok->indent && !(p->flags & PyPARSE_DONT_IMPLY_DEDENT)) {
p->tok->pendin = -p->tok->indent;
p->tok->indent = 0;
}
Expand Down

0 comments on commit b94dbd7

Please sign in to comment.