AST for enum declarations with multiple names

SyntaxEditor Python Language Add-on for WPF Forum

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

Hi,

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):
  print(repr(param))

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 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tobias,

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


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.