Skip to content

Add parser support for bitfields#13

Merged
japaric merged 2 commits intomainfrom
parse-bitfields
Jul 30, 2020
Merged

Add parser support for bitfields#13
japaric merged 2 commits intomainfrom
parse-bitfields

Conversation

@jonas-schievink
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
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}.

Comment thread parser/src/lib.rs
#[test]
fn range() {
assert!(super::parse("{:0..4}").is_ok());
let fmt = "{:0..4}";
Copy link
Copy Markdown
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