Skip to content

Polymorphic base classes#1544

Open
Janther wants to merge 4 commits intomainfrom
polymorphic-nodes
Open

Polymorphic base classes#1544
Janther wants to merge 4 commits intomainfrom
polymorphic-nodes

Conversation

@Janther
Copy link
Copy Markdown
Member

@Janther Janther commented May 4, 2026

Similar to #1543

There are 4 types of polymeric nodes.

  1. with a variant that could be different keywords. These usually are parsed as a string.
  2. with a variant that could be a name given by a developer or a keyword. These are parsed as a TerminalNode.
  3. with a variant that could be an Expression or a Statement. These are parsed as a NonterminalNode.
  4. with a variant that could be anything. This is more general and has logic for cases 2 and 3.

all of this logic put in 4 different base classes cleans up everything.

I added 4 cases just to be very specific but I'd be willing to merge case 2 and 3 into case 4.

@Janther Janther requested a review from fvictorio May 4, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant