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 hex and octal BitVector parsing per issue 1772 #2505

Merged

Conversation

NadiaYvette
Copy link
Contributor

Automatically switching between hex, octal and binary based on the prefix, akin to how BinaryLiterals does it, may be a better option. The API functions added are hLit and oLit, by analogy with bLit.

Fixes: #1772

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

Copy link
Contributor

@alex-mckenna alex-mckenna left a comment

Choose a reason for hiding this comment

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

Looks pretty close, just a new nits. I would also add a changelog entry for this change and update the copyright notice at the top of the file.

Come to think of it, your other PR should also have a changelog and copyright notice too

clash-prelude/src/Clash/Sized/Internal/BitVector.hs Outdated Show resolved Hide resolved
clash-prelude/src/Clash/Sized/Internal/BitVector.hs Outdated Show resolved Hide resolved
clash-prelude/src/Clash/Sized/Internal/BitVector.hs Outdated Show resolved Hide resolved
clash-prelude/tests/Clash/Tests/BitVector.hs Show resolved Hide resolved
clash-prelude/tests/Clash/Tests/BitVector.hs Show resolved Hide resolved
@martijnbastiaan
Copy link
Member

Overall this is looking good! Given that the Haddock is also user documentation, I'd like to see more examples worked out.

CHANGELOG.md Outdated Show resolved Hide resolved
NadiaYvette added a commit to NadiaYvette/clash-compiler that referenced this pull request Jul 30, 2023
NadiaYvette added a commit to NadiaYvette/clash-compiler that referenced this pull request Jul 30, 2023
clash-lang#2505 (comment)
Also adjusts comments/documentation so the precise strings are shown.
Automatically switching between hex, octal and binary based on the
prefix, akin to how BinaryLiterals does it, may be a better option.
Copyright was added to BitVector.hs and some of the comments referred
to functions they were based on where they should've referred to the
functions themselves, and explained undefined mask digits either
ambiguously or just incorrectly.
clash-lang#2505 (comment)
Also adjusts comments/documentation so the precise strings are shown.
Copy link
Contributor

@alex-mckenna alex-mckenna left a comment

Choose a reason for hiding this comment

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

Thanks for coming back to this @NadiaYvette, I'd forgotten about this PR.

@martijnbastiaan I'm happy with this PR as it stands, can you make sure it makes it in time for 1.8?

Copy link
Member

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

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

Last few changes, and then it looks good to me! :)

@martijnbastiaan
Copy link
Member

can you make sure it makes it in time for 1.8?

I'll grapple people away from the release button until this is merged

@martijnbastiaan martijnbastiaan added this to the 1.8 milestone Jul 30, 2023
@martijnbastiaan
Copy link
Member

@kloonbot run_ci 58f18ea

Copy link
Member

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

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

I've applied the suggestions, this look good to me now :)

@martijnbastiaan martijnbastiaan enabled auto-merge (squash) August 12, 2023 07:48
@martijnbastiaan martijnbastiaan merged commit 43145e7 into clash-lang:master Aug 12, 2023
14 checks passed
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.

bLit should handle 0x, 0b, and 0o literals
3 participants