on master help sign in
PParser.hs: filename: Restore backwards compatibility

We've used iName to parse the executable filename till now. This change ensures we don't break any extant IPKG files.

commit44b87ecd19ece43aefb98275f967b6046fc34549 authorJeremy W. Sherman <jeremyw.sherman@gmail.com> dateMon 12 Oct 2015, 22:43 (11 years ago) parent5eeaf9e
1 file changed+11−1
src/Pkg/PParser.hs+11−1
src/Pkg/PParser.hs+11−1
@@ -67,7 +67,17 @@ pPkg = do
6767-- |
6868-- | Treated for now as an identifier or a double-quoted string.
6969filename :: (MonadicParsing m, HasLastTokenSpan m) => m String
70−filename = (token $ stringLiteral <|> (fst <$> identifier)) <?> "filename"
70+filename = token $
71+ -- Treat a double-quoted string as a filename to support spaces.
72+ -- This also moves away from tying filenames to identifiers, so
73+ -- it will also accept hyphens
74+ -- (https://github.com/idris-lang/Idris-dev/issues/2721)
75+ stringLiteral
76+ <|>
77+ -- Through at least version 0.9.19.1, IPKG executable values were
78+ -- possibly namespaced identifiers, like foo.bar.baz.
79+ show <$> fst <$> iName []
80+ <?> "filename"
7181
7282
7383pClause :: PParser ()