calligraphy 0.1.2 → 0.1.3
raw patch · 3 files changed
+8/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- calligraphy.cabal +1/−1
- src/Calligraphy/Phases/Parse.hs +2/−2
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Changelog +## 0.1.3++### [Changed]+- [#7] When encountering overlapping declarations, this will now keep the first one we find instead of throwing an error. Overlapping declarations are the result of TH slices. Since we don't have any guarantees for those anyways, producing garbage instead of an error seems like a net win.+ ## 0.1.2 ### [Added]
calligraphy.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: calligraphy-version: 0.1.2+version: 0.1.3 license: BSD-3-Clause build-type: Simple license-file: LICENSE
src/Calligraphy/Phases/Parse.hs view
@@ -186,9 +186,9 @@ structure :: [RawDecl] -> Either (TreeError Loc RawDecl) (LexTree Loc RawDecl) structure = foldM (\ !t decl -> LT.insertWith f (rdStart decl) decl (rdEnd decl) t) LT.emptyLexTree where- f (RawDecl na ka ta sa ea) (RawDecl nb kb tb _ _)+ f (RawDecl na ka ta sa ea) prev@(RawDecl nb kb tb _ _) | ta == tb && na == nb = Just (RawDecl na (ka <> kb) ta sa ea)- | otherwise = Nothing+ | otherwise = Just prev -- | This is the best way I can find of checking whether the name was written by a programmer or not. -- GHC internally classifies names extensively, but none of those mechanisms seem to allow to distinguish GHC-generated names.