osslate / irc-message

Performant, streaming IRC message parser
BSD 2-Clause "Simplified" License
92 stars 13 forks source link

A message must have a non-empty command #14

Closed welwood08 closed 9 years ago

welwood08 commented 10 years ago

I'm not sure how strict this parser is intended to be, but I have a light wrapper around it to make a transform stream and was writing tests when I encountered a few unexpected failures.

According to the pseudo BNF in RFC1459, the command part of a message is required and must be at least 1 character (1+ letters or exactly 3 digits, but that's a separate issue if it's wanted). This change makes the parser treat empty string and things like ": " as malformed in the same way that it already treats ":".

osslate commented 9 years ago

Merged this manually, sorry it took so long. Starting with 3.0, irc-message provides a Transform stream out of the box (with options to parse IRCv3 message tags, prefixes, etc) too :)