Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor allowed syntax checks for attributes #4011

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

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

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