summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/SlackBuilder/Info.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/SlackBuilder/Info.hs b/lib/SlackBuilder/Info.hs
index 59342cc..bf8f1f7 100644
--- a/lib/SlackBuilder/Info.hs
+++ b/lib/SlackBuilder/Info.hs
@@ -28,7 +28,7 @@ import Data.Void (Void)
import Data.Word (Word8)
import Numeric (readHex, showHex)
import Text.Megaparsec (Parsec, count, eof, parse, takeWhile1P)
-import Text.Megaparsec.Byte (space, string, hexDigitChar)
+import Text.Megaparsec.Byte (hspace1, space, string, hexDigitChar)
import Text.URI
( URI(..)
, parserBs
@@ -43,6 +43,7 @@ import SlackBuilder.Trans
import System.FilePath ((</>), (<.>))
import Control.Monad.IO.Class (MonadIO(..))
import Conduit (MonadThrow(throwM))
+import Control.Monad (void)
type GenParser = Parsec Void ByteString
@@ -66,7 +67,7 @@ variableEntry variable = string (Char8.append variable "=\"")
<* string "\"\n"
variableSeparator :: GenParser ()
-variableSeparator = string " \\" *> space
+variableSeparator = void $ some $ hspace1 <|> void (string "\\\n")
packageDownloads :: ByteString -> GenParser [URI]
packageDownloads variableName = string (variableName <> "=\"")
@@ -99,6 +100,7 @@ packageName = takeWhile1P Nothing isNameToken
isNameToken x = Word8.isAlphaNum x
|| x == Word8._hyphen
|| x == Word8._underscore
+ || x == Word8._period
parseInfoFile :: GenParser PackageInfo
parseInfoFile = PackageInfo . Char8.unpack