Skip to content

Python textMate grammar: 'in' in the control flow 'for ... in ...' syntax is sometimes recognized as a logical operator #85271

@tweakimp

Description

@tweakimp
  • VSCode Version: 1.40.1 and 1.41.0-insider
  • OS Version: Win 10 64bit

Steps to Reproduce:
Type in this python code and use Developer: Inspect TM Scopes to look at the in keyword in each line.

x = [y + 3 for y in range(3)]  # 'in' is recognized as logical operator, but is part of the control flow
z = any(y == 3 for y in range(7))  # 'in' is rightfully recognized as control flow operator

for a in x:  # 'in' is recognized as logical operator, but is part of the control flow
    if a in x:  # 'in' is rightfully recognized as logical operator
        pass

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

grammarSyntax highlighting grammarupstream-issue-linkedThis is an upstream issue that has been reported upstream

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions