mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-09-21 22:17:19 +03:00
PParser.hs: filename: Explain failed parse with |fail|
This still provides misleading output from the parser about what it was expecting, but does explain what the actual problem was: *Pkg.PParser> execout <$> runparser pPkg defaultPkg "foo.ipkg" "package bar\n\nexecutable = \"invalid/filename\"" Failure foo.ipkg:3:32: error: a filename must be non-empty and have no directory component, expected: space executable = "invalid/filename"<EOF> ^
This commit is contained in:
parent
3ccdc4b7c7
commit
67ff67e4d8
@ -79,8 +79,9 @@ filename = (do
|
||||
-- Through at least version 0.9.19.1, IPKG executable values were
|
||||
-- possibly namespaced identifiers, like foo.bar.baz.
|
||||
show <$> fst <$> iName []
|
||||
guard $ isValidFilename filename
|
||||
return filename)
|
||||
if isValidFilename filename
|
||||
then return filename
|
||||
else fail "a filename must be non-empty and have no directory component")
|
||||
<?> "filename"
|
||||
where
|
||||
isValidFilename :: FilePath -> Bool
|
||||
|
Loading…
Reference in New Issue
Block a user