summaryrefslogtreecommitdiffstats
path: root/Hirc/Parser.hs
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-10-08 22:01:46 +0200
committertv <tv@shackspace.de>2015-10-08 22:03:31 +0200
commit4c74e39b922ff0d2dd572f90cee0cd842aa40a84 (patch)
tree38e323ba3c84750f4a83a88b4993cb50b9a3e365 /Hirc/Parser.hs
parentc07b9562e72133ccf5a64e880beb53cb8499a642 (diff)
Evaluate parsed messages
Diffstat (limited to 'Hirc/Parser.hs')
-rw-r--r--Hirc/Parser.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Hirc/Parser.hs b/Hirc/Parser.hs
index 2cb2451..ef34270 100644
--- a/Hirc/Parser.hs
+++ b/Hirc/Parser.hs
@@ -7,7 +7,7 @@ import Text.Parsec.String
message :: Parser Message
message =
- Message <$> optionMaybe (char ':' *> prefix) <* spaces1 <*> command <*> params
+ Message <$> optionMaybe (char ':' *> prefix <* spaces1) <*> command <*> params
where
spaces1 = skipMany1 space
prefix = Prefix <$> nick
@@ -16,7 +16,7 @@ message =
nick = many1 (noneOf " !@")
user = many1 (noneOf " !@")
host = many1 (noneOf " !@")
- command = UnknownCommand <$> many1 nonspace
+ command = many1 nonspace
params = many1 (spaces1 *> (trailing <|> middle))
trailing = char ':' *> many1 anyChar
middle = many1 nonspace