diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-12-05 11:30:55 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-01-25 17:07:41 +0100 |
commit | e1d2da4c227a15427b82697d573d44bbd08ef906 (patch) | |
tree | d4336629f4bfc719594a1fd23be85936c97d0f8a /src/Text/Pandoc/Readers/Markdown.hs | |
parent | f1cec1dd0257c10fb291a7fb50e216a5218ebf77 (diff) | |
download | pandoc-e1d2da4c227a15427b82697d573d44bbd08ef906.tar.gz |
Have warningWithPos take a SourcePos rather than Maybe SourcePos.
After all, we have warning if you don't want the source pos info.
Diffstat (limited to 'src/Text/Pandoc/Readers/Markdown.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 012edfe3b..1923bca01 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -280,7 +280,7 @@ yamlMetaBlock = try $ do ) nullMeta hashmap Right Yaml.Null -> return nullMeta Right _ -> do - P.warningWithPos (Just pos) "YAML header is not an object" + P.warningWithPos pos "YAML header is not an object" return nullMeta Left err' -> do case err' of @@ -291,13 +291,13 @@ yamlMetaBlock = try $ do yamlLine = yline , yamlColumn = ycol }}) -> - P.warningWithPos (Just $ setSourceLine + P.warningWithPos (setSourceLine (setSourceColumn pos (sourceColumn pos + ycol)) (sourceLine pos + 1 + yline)) $ "Could not parse YAML header: " ++ problem - _ -> P.warningWithPos (Just pos) + _ -> P.warningWithPos pos $ "Could not parse YAML header: " ++ show err' return nullMeta @@ -420,7 +420,7 @@ referenceKey = try $ do let oldkeys = stateKeys st let key = toKey raw case M.lookup key oldkeys of - Just _ -> P.warningWithPos (Just pos) $ "Duplicate link reference `" ++ raw ++ "'" + Just _ -> P.warningWithPos pos $ "Duplicate link reference `" ++ raw ++ "'" Nothing -> return () updateState $ \s -> s { stateKeys = M.insert key (target, attr') oldkeys } return $ return mempty @@ -486,7 +486,7 @@ noteBlock = try $ do let newnote = (ref, parsed) oldnotes <- stateNotes' <$> getState case lookup ref oldnotes of - Just _ -> P.warningWithPos (Just pos) $ "Duplicate note reference `" ++ ref ++ "'" + Just _ -> P.warningWithPos pos $ "Duplicate note reference `" ++ ref ++ "'" Nothing -> return () updateState $ \s -> s { stateNotes' = newnote : oldnotes } return mempty |