Skip to content

Comments

Refactor allowed syntax checks for attributes#4011

Closed
Scott-Guest wants to merge 2 commits intodevelopfrom
att-syntax
Closed

Refactor allowed syntax checks for attributes#4011
Scott-Guest wants to merge 2 commits intodevelopfrom
att-syntax

Conversation

@Scott-Guest
Copy link
Contributor

@Scott-Guest Scott-Guest commented Feb 20, 2024

Fixes #3982

Previously, each attribute specified an allowed set of Class[_]s where that attribute may occur. However, both a cell and a non-cell are just Productions, so no Class[_] restriction is sufficient to distinguish cells.

This PR then refactors to instead have an allowed set of Att.Syntax types, each with a isA(term: AnyRef): Boolean method to check membership.

In process, we also:

  • Restrict label(_) to rules, claims, contexts, and context aliases rather than allowing it on any sentence
  • Restrict group(_) to productions
  • Restrict cell, cellName, exit, stream, multiplicity, and type to cells

@Scott-Guest
Copy link
Contributor Author

Parking this until we can move CheckAtt to immediately after parsing

@ehildenb ehildenb closed this Apr 29, 2025
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.

2 participants