Skip to content

pascal: an enumerated type is dropped from the graph entirely #4055

Description

@rajatnagda45

What happens

A Pascal/Delphi enumerated type and all of its values produce no nodes at all — the whole type vanishes. Given:

type
  TColor = (clRed, clGreen, clBlue);

the graph has nothing for TColor, clRed, clGreen, or clBlue.

Why

In graphify/extractors/pascal.py, the declType handler only emits a node when the type's kind is declClass, declIntf, or declHelper. An enumerated type parses as declType -> type -> declEnum -> declEnumValue, which matches none of those, so the declaration falls through to a plain child walk and is dropped.

Expected

An enumerated type is a named type whose values are its cases. It should become a type node with a case_of edge per value, matching every other language with enums (Java #1719 / C# / Swift / Scala) and the existing class/interface handling.

Note: this is the AST (tree-sitter-pascal) path, which is the AST-quality extractor; the regex fallback used when tree-sitter-pascal isn't installed only models classes/interfaces and is out of scope here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions