-
Notifications
You must be signed in to change notification settings - Fork 172
Implement context-specific tags on #[derive(Sequence)] #349
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
|
@bstrie I think you mean context specific, not context sensitive. |
Thanks to the Chomsky Hierarchy I have made this mistake several times myself 😅 |
|
@bstrie I think you need to fix the commit message wording too. |
|
@bstrie Also, one of the tests is failing. |
|
One of the errors is on impl ::der::Sequence<'_> for IssuingDistributionPointExample {
fn fields<F, T>(&self, f: F) -> ::der::Result<T>
where
F: FnOnce(&[&dyn der::Encodable]) -> ::der::Result<T>,
{
()
}
}...not sure what's happening there but the empty tuple is definitely not the right result. Looks like something similar on the other error: impl<'a> ::der::Sequence<'a> for OneAsymmetricKey<'a> {
fn fields<F, T>(&self, f: F) -> ::der::Result<T>
where
F: FnOnce(&[&dyn der::Encodable]) -> ::der::Result<T>,
{
()
}
}Perhaps the unparseable tokens are being lost? |
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
9e1ef3e to
b79f7ac
Compare
|
Code updated to pass all the tests (sorry about not doing so the first time, I forgot to test with |
|
|
||
| #[derive(Sequence)] | ||
| #[asn1(tag_mode = "IMPLICIT")] | ||
| pub struct TypeCheckExpandedSequenceFieldAttributeCombinations<'a> { |
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.
Oh my 😅
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.
We call that "self-documenting code". :P
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
If you'd like I would be happy to add more tests to cover the interactions between the various options, but I admit that I'm not an ASN.1 expert so I would need some guidance as to how these options interact so that I could formulate the correct desugaring.
Closes #322.