-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added some patchwork to make this work with nom
- Loading branch information
Jarrod
committed
Oct 22, 2011
1 parent
47c259e
commit 1e6a243
Showing
6 changed files
with
41 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
use v6; | ||
|
||
class Net::IRC::Parser { | ||
grammar RawEvent { | ||
token TOP { | ||
^ | ||
[':' [<user>|<server=host>] <.space> || <?>] | ||
<command> | ||
[ <.space>+ [':'$<params>=(.*)$ || $<params>=<-space>+] ]* | ||
$ | ||
} | ||
module Net::IRC::Parser; | ||
grammar RawEvent { | ||
token TOP { | ||
^ | ||
[':' [<user>|<server=host>] <.space> || <?>] | ||
<command> | ||
[ <.space>+ [':'$<params>=(.*)$ || $<params>=<-space>+] ]* | ||
$ | ||
} | ||
|
||
token user { | ||
$<nick>=<-[:!]>+ '!' $<ident>=<-[@]>+ '@' <host> | ||
} | ||
token user { | ||
$<nick>=<-[:!]>+ '!' $<ident>=<-[@]>+ '@' <host> | ||
} | ||
|
||
token host { | ||
#[ <-space - [. $ @ !]>+ ] ** '.' | ||
#Due to some IRC servers/services allowing anything as a host format, | ||
#I've decided to define a 'host' as 'anything but a space'. Bah. | ||
<-space>+ | ||
} | ||
token host { | ||
#[ <-space - [. $ @ !]>+ ] ** '.' | ||
|
||
#Due to some IRC servers/services allowing anything as a host format, | ||
#I've decided to define a 'host' as 'anything but a space'. Bah. | ||
<-space>+ | ||
} | ||
|
||
token command { | ||
<.alpha>+ | \d\d\d | ||
} | ||
token command { | ||
<.alpha>+ | \d\d\d | ||
} | ||
|
||
token params { | ||
[ ':'.*$ | <-space>+ ] | ||
} | ||
token params { | ||
[ ':'.*$ | <-space>+ ] | ||
} | ||
|
||
|
||
} | ||
|