dev: includedirectivep: cleanup

This commit is contained in:
Simon Michael 2025-07-11 12:13:12 -07:00
parent f5d3b7bd38
commit c8a5b8eb37

View File

@ -290,8 +290,8 @@ directivep = (do
includedirectivep :: MonadIO m => ErroringJournalParser m () includedirectivep :: MonadIO m => ErroringJournalParser m ()
includedirectivep = do includedirectivep = do
-- save the position -- save the position
parentoff <- getOffset off <- getOffset
parentpos <- getSourcePos pos <- getSourcePos
-- parse -- parse
string "include" string "include"
lift skipNonNewlineSpaces1 lift skipNonNewlineSpaces1
@ -299,12 +299,12 @@ includedirectivep = do
lift followingcommentp lift followingcommentp
-- find file(s) -- find file(s)
let (mprefix,glb) = splitReaderPrefix prefixedglob let (mprefix,glb) = splitReaderPrefix prefixedglob
paths <- getFilePaths parentoff parentpos glb paths <- getFilePaths off pos glb
let prefixedpaths = case mprefix of let prefixedpaths = case mprefix of
Nothing -> paths Nothing -> paths
Just fmt -> map ((show fmt++":")++) paths Just fmt -> map ((show fmt++":")++) paths
-- parse them inline -- parse them inline
forM_ prefixedpaths $ parseIncludedFile parentpos forM_ prefixedpaths $ parseIncludedFile pos
where where