Skip to content

Conversation

john-h-kastner-aws
Copy link
Contributor

Description of changes

Fix #409 by parsing an Add rather than an Name in is expression. This allows for parsing expression in this position so that principal is User::"alice" can parse, allowing for a more useful error in when building the ast. The Add production needs to be used instead of Expr to avoid ambiguity with the .. is .. in .. form.

Checklist for requesting a review.

The change in this PR is (choose one, and delete the other options):

  • A bug fix or other functionality change requiring a patch to cedar-policy.

I confirm that this PR (choose one, and delete the other options):

  • Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar Dafny model or DRT infrastructure.

Disclaimer

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

}

// VariableDef := Variable [':' Name] [('in' | '==') Expr]
// VariableDef := Variable [':' Name] ['is' Add] [('in' | '==') Expr]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe we should add a comment here saying Add shows up here rather than Name because we want better error message. Otherwise it could be confusing here because the grammar specifies that a Name comes after is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.1 Features for 3.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve parser errors around is
5 participants