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

Remove special-casing for group(_) #3981

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Remove special-casing for group(_) #3981

merged 6 commits into from
Feb 13, 2024

Conversation

Scott-Guest
Copy link
Contributor

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

When we originally added group(_) to replace unstructured attributes, we treated it as syntactic sugar where [group(foo1,...,fooN)] expands internally into [foo1,...,fooN].

However, on a second look, this expansion is unnecessary - group(_) is only relevant in the Context object used by KILtoKORE which maps tags in syntax blocks to sets of corresponding Productions.

In this PR, we then

  • Remove all the ProcessGroupAttributes logic and instead just parse group(_) when we build the Context.
  • Remove the special-cased KeyType.UserGroup
  • (Opinionated) Remove the mention of group(_) from the "unrecognized attributes" error message.
    • The hint was useful when we first disallowed unstructured attributes. However, now that group(_) and the whitelist are more established, it feels a bit odd to assume any unrecognized attribute is an attempt to create a group.

As a side effect of this change,

  • syntax declarations can now only refer to productions by their klabel or group. Previously, any attribute was permitted, and the priority or associativity would apply to everything with that attribute.
  • Cell properties will no longer expand <cell group="foo"> </cell>
  • We no longer error if a group conflicts with a built-in attribute
    • Before, this error was required lest [group(function)] be treated the same as [function]

@Scott-Guest Scott-Guest marked this pull request as ready for review February 12, 2024 23:06
@Scott-Guest Scott-Guest requested a review from gtrepta February 12, 2024 23:06
@rv-jenkins rv-jenkins merged commit f7c33c0 into develop Feb 13, 2024
9 of 16 checks passed
@rv-jenkins rv-jenkins deleted the frontend-only-atts branch February 13, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants