fix:journal: include directive error messages now show the correct line
They were showing the line after the include directive, confusingly.
This commit is contained in:
parent
251af8529f
commit
f5d3b7bd38
@ -289,14 +289,14 @@ directivep = (do
|
|||||||
-- Examples: foo.j, ../foo/bar.j, timedot:/foo/2020*, *.journal
|
-- Examples: foo.j, ../foo/bar.j, timedot:/foo/2020*, *.journal
|
||||||
includedirectivep :: MonadIO m => ErroringJournalParser m ()
|
includedirectivep :: MonadIO m => ErroringJournalParser m ()
|
||||||
includedirectivep = do
|
includedirectivep = do
|
||||||
|
-- save the position
|
||||||
|
parentoff <- getOffset
|
||||||
|
parentpos <- getSourcePos
|
||||||
-- parse
|
-- parse
|
||||||
string "include"
|
string "include"
|
||||||
lift skipNonNewlineSpaces1
|
lift skipNonNewlineSpaces1
|
||||||
prefixedglob <- rstrip . T.unpack <$> takeWhileP Nothing (`notElem` [';','\n'])
|
prefixedglob <- rstrip . T.unpack <$> takeWhileP Nothing (`notElem` [';','\n'])
|
||||||
lift followingcommentp
|
lift followingcommentp
|
||||||
-- save the position (does sequencing wrt newline matter ? seems not)
|
|
||||||
parentoff <- getOffset
|
|
||||||
parentpos <- getSourcePos
|
|
||||||
-- find file(s)
|
-- find file(s)
|
||||||
let (mprefix,glb) = splitReaderPrefix prefixedglob
|
let (mprefix,glb) = splitReaderPrefix prefixedglob
|
||||||
paths <- getFilePaths parentoff parentpos glb
|
paths <- getFilePaths parentoff parentpos glb
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user