on master help sign in
PParser.hs: filename: Restore backwards compatibility
44b87ecJeremy W. Sherman
src/Pkg/PParser.hs+11−1
@@ -67,7 +67,17 @@ pPkg = do
67-- |
67-- |
68-- | Treated for now as an identifier or a double-quoted string.
68-- | Treated for now as an identifier or a double-quoted string.
69filename :: (MonadicParsing m, HasLastTokenSpan m) => m String
69filename :: (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"
71
81
72
82
73pClause :: PParser ()
83pClause :: PParser ()