diff --git a/empty-comment-block-haddocks.test b/empty-comment-block-haddocks.test new file mode 100644 index 00000000..ebdcec3f --- /dev/null +++ b/empty-comment-block-haddocks.test @@ -0,0 +1,21 @@ +{- |-} +haddockAboveMultiEmpty = 1 + +{- | -} +haddockAboveMultiEmptySpace = 1 + +{- | + + -} +haddockAboveMultiEmptyLines = 1 + +haddockBelowMultiEmpty = 1 +{- ^-} + +haddockBelowMultiEmptySpace = 1 +{- ^-} + +haddockBelowMultiEmptyLines = 1 +{- ^ + + -} diff --git a/empty-comment-blocks.test b/empty-comment-blocks.test new file mode 100644 index 00000000..ab6d2053 --- /dev/null +++ b/empty-comment-blocks.test @@ -0,0 +1,12 @@ +{-##-} + +{--} +commentMultiEmpty = 1 + +{- -} +commentMultiEmptySpace = 1 + +{- + + -} +commentMultiEmptyLines = 1 diff --git a/empty-comment-mixed.test b/empty-comment-mixed.test new file mode 100644 index 00000000..925bcfd1 --- /dev/null +++ b/empty-comment-mixed.test @@ -0,0 +1,11 @@ +-- | +-- +-- Comment with blank line comment space above and below. +-- +commentWithSpace = 1 + +-- | Introduction line. +-- +-- Comment with introduction line above and blank line below. +-- +CommentWithSpaceOnlyAfter = 1 \ No newline at end of file diff --git a/empty-comment-nonempty.test b/empty-comment-nonempty.test new file mode 100644 index 00000000..52fb29fc --- /dev/null +++ b/empty-comment-nonempty.test @@ -0,0 +1,11 @@ +-- | +-- +-- +-- foo +haddockAboveIntoNonEmpty = 1 + +haddockBelowIntoNonEmpty = 1 +-- ^ +-- +-- +-- foo \ No newline at end of file diff --git a/empty-comment-record.test b/empty-comment-record.test new file mode 100644 index 00000000..cc1f261c --- /dev/null +++ b/empty-comment-record.test @@ -0,0 +1,15 @@ +data HaddockSingle = HaddockSingle + { haddockFieldEmptyBelow :: Int + -- ^ + -- | + , haddockFieldAboveEmpty :: Int + , haddockFieldEmptyAfter :: Int -- ^ + } + +data HaddockMulti = HaddockMulti + { haddockFieldEmptyBelow :: Int + {- ^-} + {- |-} + , haddockFieldAboveEmpty :: Int + , haddockFieldEmptyAfter :: Int {- ^-} + } diff --git a/empty-comment-single.test b/empty-comment-single.test new file mode 100644 index 00000000..b69c5592 --- /dev/null +++ b/empty-comment-single.test @@ -0,0 +1,5 @@ +-- | +haddockAboveSingle = 1 + +haddockBelowSingle = 1 +-- ^ \ No newline at end of file diff --git a/empty-comment-singles.test b/empty-comment-singles.test new file mode 100644 index 00000000..d734d86b --- /dev/null +++ b/empty-comment-singles.test @@ -0,0 +1,7 @@ +-- | +-- +haddockAboveSingles = 1 + +-- | +-- >>> +haddockAboveDoctest = 1 \ No newline at end of file diff --git a/example.test b/example.test new file mode 100644 index 00000000..0175d147 --- /dev/null +++ b/example.test @@ -0,0 +1,73 @@ +-- | AA +-- +-- +-- BB +-- +-- +-- Comment with blank line comment space above and below. +-- +-- +-- CC +-- +-- +-- +-- +commentWithSpace = 1 + +-- | +-- +-- 11 +-- +-- +-- 22 +-- +-- +-- Comment with blank line comment space above and below. +-- +-- +-- 33 +-- +commentWithSpace1 = 1 + +commentWithSpace2 = 1 +-- ^ +-- +-- ZZ +-- +-- +-- YY +-- +-- +-- Comment with blank line comment space above and below. +-- +-- +-- XX +-- + +-- | A comment as a string. + +{- |-} +{--} + +-- + +{-##-} + +-- | +-- >>> :{ +-- let +-- x = 1 +-- y = 2 +-- in x + y + multiline +-- :} +-- 6 +multiline = 3 + +{- | >>> :{ +let x = 1 + y = 2 + in x + y + works +:} +6 +-} +works = 3 \ No newline at end of file