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

Add parser support for bitfields #13

Merged
merged 2 commits into from
Jul 30, 2020
Merged

Add parser support for bitfields #13

merged 2 commits into from
Jul 30, 2020

Conversation

jonas-schievink
Copy link
Contributor

No description provided.

Copy link
Member

@japaric japaric left a comment

Choose a reason for hiding this comment

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

Thanks; looks good to me. For now let's also reject ranges that try to view outside a 32-bit value, e.g. {:31..33}.

#[test]
fn range() {
assert!(super::parse("{:0..4}").is_ok());
let fmt = "{:0..4}";
Copy link
Member

Choose a reason for hiding this comment

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

Also, could add some tests that exercise indexed parameters? "{0:0..4} {0:2..6}" (it's OK if the bitfield slices overlap). Also something with different indices: "{0:0..4} {1:8..12}".

@japaric japaric merged commit e16e082 into main Jul 30, 2020
@jonas-schievink jonas-schievink deleted the parse-bitfields branch July 30, 2020 15:31
bors bot added a commit that referenced this pull request Jan 4, 2021
323: Merge I128/Ixx and U128/Uxx variants r=japaric a=Sh3Rm4n

Closes #314 

Also lift 32 bit range for bitfields introduced in #13
Could be split into another PR, if concerns are raised.

Co-authored-by: Fabian Viöl <f.vioel@googlemail.com>
bors bot added a commit that referenced this pull request Jan 4, 2021
323: Merge I128/Ixx and U128/Uxx variants r=japaric a=Sh3Rm4n

Closes #314 

Also lift 32 bit range for bitfields introduced in #13
Could be split into another PR, if concerns are raised.

Co-authored-by: Fabian Viöl <f.vioel@googlemail.com>
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.

2 participants