aboutsummaryrefslogtreecommitdiff
path: root/haddock-library
diff options
context:
space:
mode:
authorOleg Grenrus <oleg.grenrus@iki.fi>2019-02-04 18:44:25 +0200
committerAlec Theriault <alec.theriault@gmail.com>2019-02-04 08:44:25 -0800
commitcacd245a5e0a0f2e14d4ed34e877835fdef3367f (patch)
treed29e2dbdea36129720b7e8df9e9a007e539b0a4b /haddock-library
parent032ff0dd3411f66131854c4314b9f00c8540fd10 (diff)
Make a fixture of weird parsing of lists (#997)
The second example is interesting. If there's a list directly after the header, and that list has deeper structure, the parser is confused: It finds two lists: - One with the first nested element, - everything after it I'm not trying to fix this, as I'm not even sure this is a bug, and not a feature.
Diffstat (limited to 'haddock-library')
-rw-r--r--haddock-library/fixtures/examples/list-blocks1.input15
-rw-r--r--haddock-library/fixtures/examples/list-blocks1.parsed12
-rw-r--r--haddock-library/fixtures/examples/list-blocks2.input10
-rw-r--r--haddock-library/fixtures/examples/list-blocks2.parsed10
-rw-r--r--haddock-library/haddock-library.cabal1
5 files changed, 47 insertions, 1 deletions
diff --git a/haddock-library/fixtures/examples/list-blocks1.input b/haddock-library/fixtures/examples/list-blocks1.input
new file mode 100644
index 00000000..72a0640b
--- /dev/null
+++ b/haddock-library/fixtures/examples/list-blocks1.input
@@ -0,0 +1,15 @@
+* Something about foo
+
+ @
+ foo :: a -> b -> c
+ foo a b = bar c b
+ @
+
+* Something about bar
+
+ @
+ bar :: a -> b -> c
+ bar a b = foo b a
+ @
+
+* And then we continue
diff --git a/haddock-library/fixtures/examples/list-blocks1.parsed b/haddock-library/fixtures/examples/list-blocks1.parsed
new file mode 100644
index 00000000..9fc4f0ba
--- /dev/null
+++ b/haddock-library/fixtures/examples/list-blocks1.parsed
@@ -0,0 +1,12 @@
+DocUnorderedList
+ [DocAppend
+ (DocParagraph (DocString "Something about foo"))
+ (DocCodeBlock
+ (DocString
+ (concat ["foo :: a -> b -> c\n", "foo a b = bar c b\n"]))),
+ DocAppend
+ (DocParagraph (DocString "Something about bar"))
+ (DocCodeBlock
+ (DocString
+ (concat ["bar :: a -> b -> c\n", "bar a b = foo b a\n"]))),
+ DocParagraph (DocString "And then we continue")]
diff --git a/haddock-library/fixtures/examples/list-blocks2.input b/haddock-library/fixtures/examples/list-blocks2.input
new file mode 100644
index 00000000..91492adb
--- /dev/null
+++ b/haddock-library/fixtures/examples/list-blocks2.input
@@ -0,0 +1,10 @@
+=== Title
+
+* List directly
+* after the title
+
+ @
+ with some inline things
+ @
+
+* is parsed weirdly
diff --git a/haddock-library/fixtures/examples/list-blocks2.parsed b/haddock-library/fixtures/examples/list-blocks2.parsed
new file mode 100644
index 00000000..169677b7
--- /dev/null
+++ b/haddock-library/fixtures/examples/list-blocks2.parsed
@@ -0,0 +1,10 @@
+DocAppend
+ (DocAppend
+ (DocHeader
+ Header {headerLevel = 3, headerTitle = DocString "Title"})
+ (DocUnorderedList
+ [DocParagraph (DocString "List directly"),
+ DocAppend
+ (DocParagraph (DocString "after the title"))
+ (DocCodeBlock (DocString "with some inline things\n"))]))
+ (DocUnorderedList [DocParagraph (DocString "is parsed weirdly")])
diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal
index 17f556aa..32ffc110 100644
--- a/haddock-library/haddock-library.cabal
+++ b/haddock-library/haddock-library.cabal
@@ -91,7 +91,6 @@ test-suite fixtures
main-is: Fixtures.hs
ghc-options: -Wall -O0
hs-source-dirs: fixtures
- buildable: False
build-depends:
base >= 4.5 && < 4.13
, base-compat >= 0.9.3 && < 0.11