Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Parsec (parser combinator)

Name: Anonymous 2008-01-23 19:31

I think this is quite cool. (Parsing an IRC 'NICK foo' message)

special = oneOf "-[]\\`^{}_" -- Taken from RFC1459, except '_',
                             -- which I added (generally accepted character (are there others?)).

nick = do { string "NICK"; space;
            first <- letter; rest <- many1 $ alphaNum <|> special; eof;
            return $ Nick (first:rest) }


Not quite sure what I think of it in comparison to regular expressions, yet.

Name: Anonymous 2008-01-23 20:27

>>15

I know UnrealIRCd supports additionals charsets. It's probably a bit tricky to do right, because not all clients use the same character encoding (Shift_JIS, GBK, W1251/W1251 and whathaveyou).

Name: Anonymous 2008-01-23 20:37

>>23
That does sound tricky. I won't implement any additional support initially. Having a look at UnrealIRCd's source code might prove helpful when I do, however.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List