repositories
/
cloogle-irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
80375cb
)
Fix mode command and hostnames ending with .
author
Mart Lubbers
<mart@martlubbers.net>
Wed, 12 Jul 2017 14:28:46 +0000
(16:28 +0200)
committer
Mart Lubbers
<mart@martlubbers.net>
Wed, 12 Jul 2017 14:29:55 +0000
(16:29 +0200)
GenIRC.icl
patch
|
blob
|
history
IRC.icl
patch
|
blob
|
history
diff --git
a/GenIRC.icl
b/GenIRC.icl
index
4a4d754
..
c813576
100644
(file)
--- a/
GenIRC.icl
+++ b/
GenIRC.icl
@@
-26,7
+26,7
@@
gIRCParse{|EITHER|} lp rp as = case lp as of
(Right a, rest) = (Right $ LEFT a, rest)
(Left e1, _) = case rp as of
(Right a, rest) = (Right $ RIGHT a, rest)
(Right a, rest) = (Right $ LEFT a, rest)
(Left e1, _) = case rp as of
(Right a, rest) = (Right $ RIGHT a, rest)
- (Left e2, _) = (Left $ e
1 +++ " and " +++ e
2, [])
+ (Left e2, _) = (Left $ e2, [])
gIRCParse{|OBJECT|} p as = appFst (fmap OBJECT) $ p as
gIRCParse{|CONS of d|} p []
= (Left $ concat ["Expected a cmd constructor: ", d.gcd_name], [])
gIRCParse{|OBJECT|} p as = appFst (fmap OBJECT) $ p as
gIRCParse{|CONS of d|} p []
= (Left $ concat ["Expected a cmd constructor: ", d.gcd_name], [])
diff --git
a/IRC.icl
b/IRC.icl
index
4a9fa95
..
0fb408f
100644
(file)
--- a/
IRC.icl
+++ b/
IRC.icl
@@
-41,7
+41,7
@@
where
, parseIRCMessage ":cherryh.freenode.net ISON a b c d e f :g h\r\n"
, parseIRCMessage ":wilhelm.freenode.net 001 clooglebot :Welcome to the freenode Internet Relay Chat Network clooglebot\r\n"
, parseIRCMessage "PING :orwell.freenode.net\r\n"
, parseIRCMessage ":cherryh.freenode.net ISON a b c d e f :g h\r\n"
, parseIRCMessage ":wilhelm.freenode.net 001 clooglebot :Welcome to the freenode Internet Relay Chat Network clooglebot\r\n"
, parseIRCMessage "PING :orwell.freenode.net\r\n"
-
+ , parseIRCMessage ":ChanServ!ChanServ@services. MODE #cloogle +o frobnicator\r\n"
]
parseIRCMessage :: String -> Either [Error] IRCMessage
]
parseIRCMessage :: String -> Either [Error] IRCMessage
@@
-82,7
+82,8
@@
where
>>= \cs->pure (toString [c:cs])
parseHost :: Parser Char String
>>= \cs->pure (toString [c:cs])
parseHost :: Parser Char String
- parseHost = jon "." <$> pSepBy parseName (pToken '.')
+ parseHost = jon "." <$> (pSepBy parseName (pToken '.'))
+ >>= \s->optional (pToken '.') >>= pure o maybe s (\p->s+++toString s)
where
parseName :: Parser Char String
parseName = toString <$> pSome (pAlpha <|> pDigit <|> pOneOf ['-'])
where
parseName :: Parser Char String
parseName = toString <$> pSome (pAlpha <|> pDigit <|> pOneOf ['-'])