-
Notifications
You must be signed in to change notification settings - Fork 107
Minor edits to ParseError
#908
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
Conversation
// Don't make fields `pub`, don't make breaking changes, and use caution when | ||
// adding public methods. | ||
#[derive(Clone, Debug, Default, PartialEq, Eq)] | ||
pub struct ParseErrors(pub Vec<ParseError>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Don't make fields pub
" is confusing when the type already has a pub field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have this field be pub(crate)
instead of pub
, now that it's publically exported? Or should this type be an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to pub(crate)
in the latest commit. I plan to make the field private in a future PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought... undid this in the latest commit since I don't want to fix the resulting build failures. I promise that I'll take care of it in a PR in the next few days!
4b6d64c
to
871a800
Compare
Description of changes
Another round of edits to the parsing-related errors. I expect to make more changes to the public API in a future PR (in particular: I think we want to better hide the terms "AST" and "CST" in the public API).
pub use
forRestrictedExpressionParseError
andParseError
, which could previously be returned by public functions, but were never exported themselves 😅 Added "CAUTION" notes to these error types like the ones added in AlignEvaluationError
andExtensionFunctionLookupError
with cedar#745 #860.ParseLiteral
andRestrictedExpr
cases fromParseError
.RestrictedExpr::from_str()
andLiteral::from_str()
now have their own error types.UnescapeError
s to not print theEscapeError
variant (which comes from Rust's lexer).Issue #, if available
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
cedar-policy
(e.g., changes to the signature of an existing API).(This PR will be batched with the other breaking changes that are part of #745.)
I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):