! Copyright (C) 2009 Bruno Deferrari
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel fry splitting ascii accessors combinators
- arrays classes.tuple math.order words assocs
- irc.messages.base sequences ;
+USING: accessors irc.messages.base kernel sequences splitting ;
IN: irc.messages.parser
<PRIVATE
: split-message ( string -- prefix command parameters trailing )
":" ?head [ " " split1 ] [ f swap ] if
":" split1
- [ " " split harvest unclip swap ] dip ;
+ [ split-words harvest unclip swap ] dip ;
: sender ( irc-message -- sender )
prefix>> [ ":" ?head drop "!" split-at-first drop ] [ f ] if* ;