some marginally better errors
This commit is contained in:
parent
3911f5052b
commit
b36e72adf5
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import Text.Pandoc.Walk
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import qualified Data.Text as Text
|
import qualified Data.Text as Text
|
||||||
|
import Data.Data (toConstr)
|
||||||
|
|
||||||
|
|
||||||
glosses :: Vars => Block -> IO [Block]
|
glosses :: Vars => Block -> IO [Block]
|
||||||
|
@ -38,7 +39,10 @@ glossTable = \case
|
||||||
PGloss l p s g t -> Just <$> make l (Just p) Nothing s g t
|
PGloss l p s g t -> Just <$> make l (Just p) Nothing s g t
|
||||||
PNGloss l b n s g t -> Just <$> make l (Just b) (Just n) s g t
|
PNGloss l b n s g t -> Just <$> make l (Just b) (Just n) s g t
|
||||||
HorizontalRule -> pure Nothing
|
HorizontalRule -> pure Nothing
|
||||||
b -> error $ "found " ++ show b ++ " in gloss section"
|
BulletList xs | let ℓ = length xs, ℓ < 4 || ℓ > 6 ->
|
||||||
|
fail $ "found list of length " ++ show ℓ ++
|
||||||
|
" in gloss section (missing `---`?)"
|
||||||
|
b -> fail $ "found unexpected " ++ show (toConstr b) ++ " in gloss section"
|
||||||
where
|
where
|
||||||
make l b n s g t = do
|
make l b n s g t = do
|
||||||
let ℓ = length $ splitInlines s
|
let ℓ = length $ splitInlines s
|
||||||
|
|
Loading…
Add table
Reference in a new issue