on master help sign in
Properly ignore comments in ipkg files

Fixes #1149.

commiteb29608aee0ed0e03a43ced238de6def19bc043d authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateThu 1 May 2014, 14:40 (12 years ago) parentf9827ac
1 file changed+6−2
src/Pkg/PParser.hs+6−2
src/Pkg/PParser.hs+6−2
@@ -1,3 +1,5 @@
1+{-# LANGUAGE OverlappingInstances #-}
2+
13module Pkg.PParser where
24
35import Text.Trifecta hiding (span, stringLiteral, charLiteral, natural, symbol, char, string, whiteSpace)
@@ -27,6 +29,10 @@ data PkgDesc = PkgDesc { pkgname :: String,
2729 }
2830 deriving Show
2931
32+instance TokenParsing PParser where
33+ someSpace = many (simpleWhiteSpace <|> singleLineComment <|> multiLineComment) *> pure ()
34+
35+
3036defaultPkg = PkgDesc "" [] [] Nothing [] "" [] (sUN "") Nothing
3137
3238parseDesc :: FilePath -> IO PkgDesc
@@ -78,6 +84,4 @@ pClause = do reserved "executable"; lchar '=';
7884 mk <- iName []
7985 st <- get
8086 put (st { makefile = Just (show mk) })
81− <|> do string "--"; many (satisfy (not . isEol)) ; satisfy isEol
82− return ()
8387