Skip to content

Commit

Permalink
Correct comments and add changelog entry.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
NadiaYvette committed Jun 17, 2023
1 parent 1b690b3 commit 5562a42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## 1.6.4 *Aug 30th 2022*
Fixed:

* Add hex and octal BitVector parsing. [#1772] (https://github.com/clash-lang/clash-compiler/pull/2505)
* Input validation of the used arguments in blackboxes is now complete. [#2184](https://github.com/clash-lang/clash-compiler/pull/2184)
* `Clash.Annotations.BitRepresentation.Deriving.deriveAnnotation` no longer has quadratic complexity in the size of the constructors and fields. [#2209](https://github.com/clash-lang/clash-compiler/pull/2209)
* Fully resolve type synonyms when deriving bit representations. [#2209](https://github.com/clash-lang/clash-compiler/pull/2209)
Expand Down
7 changes: 4 additions & 3 deletions clash-prelude/src/Clash/Sized/Internal/BitVector.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright : (C) 2013-2016, University of Twente,
2019 , Gergő Érdi
2016-2019, Myrtle Software Ltd,
2021-2022, QBayLogic B.V.
2023 , Nadia Chambers
License : BSD2 (see the file LICENSE)
Maintainer : QBayLogic B.V. <devops@qbaylogic.com>
-}
Expand Down Expand Up @@ -544,7 +545,7 @@ read# cs0 = (fromIntegral (length cs1), BV m v)
-- >>> $(hLit "dead")
-- 0b1101111010101101
--
-- Don't care digits are interpreted as f as a hexadecimal digit.
-- Don't care digits set 4 bits in the undefined mask.
hLit :: String -> ExpQ
hLit s = pure (SigE body typ)
where
Expand All @@ -571,10 +572,10 @@ read16# cs0 = (fromIntegral $ 4 * length cs1, BV m v)
++ show c ++ " in input: " ++ cs0

-- | Create an octal literal.
-- >>> $(hLit "5234")
-- >>> $(oLit "5234")
-- 0b101011010100
--
-- Don't care digits are interpreted as 7 as an octal digit.
-- Don't care digits set 3 bits in the undefined mask.
oLit :: String -> ExpQ
oLit s = pure (SigE body typ)
where
Expand Down

0 comments on commit 5562a42

Please sign in to comment.