AST for enum declarations with multiple names

SyntaxEditor Python Language Add-on for WPF Forum

Posted 8 months ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Version: 22.1.1
Platform: .NET 4.8
Environment: Windows 10 (64-bit)


I am parsing python files using your syntax tree. I found a enum declaration where multiple names are assigned to one value in a single line.

from enum import IntEnum

class MyEnum(IntEnum):
  A = B = 1

def MyFunction(param : MyEnum):

In the syntax tree the left expression "A = B" is a TupleExpression. However the items collection is empty, so I have no way to get any of both names.

Best regards, Tobias Lingemann.

Comments (1)

Posted 8 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Tobias,

Thanks for reporting this.  We've fixed it for the next maintenance release.

Actipro Software Support

The latest build of this product (v22.1.4) was released 23 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.