blob: be42375babc01c5e7c5378d7e7e7065c77e48f34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
module Parser
( module Export
, decimal
, ueventFile
) where
import qualified Text.Megaparsec.Lexer as Lexer
import Text.Megaparsec as Export (parse, parseMaybe)
import Text.Megaparsec.String as Export (Parser)
import Data.Map (Map); import qualified Data.Map as Map
import Text.Megaparsec
decimal :: Parser Integer
decimal = Lexer.decimal
ueventFile :: Parser (Map String String)
ueventFile =
Map.fromList <$> some param
param :: Parser (String,String)
param = do
k <- someTill anyChar (char '=')
v <- someTill anyChar newline
return (k,v)
|