fork download
  1. #!/usr/bin/perl6
  2. my Str $cookie = 'foo=bar,count=1,date=YY:MM:DDX*&,';
  3. say $cookie;
  4. grammar cookies {
  5. rule TOP {
  6. ^
  7. [
  8. <name> '=' <content>,
  9. ] +
  10. $
  11. }
  12. rule name {
  13. \w+
  14. }
  15. rule content {
  16. [ ^ , ] +
  17. }
  18. }
  19. say cookies.parse($cookie);
Runtime error #stdin #stdout #stderr 0.1s 102592KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
===SORRY!===
Unrecognized regex metacharacter , (must be quoted to match literally)
at /home/mv5wK0/prog.pl:8
------> 			<name> '=' <content>⏏,	
Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']' 
at /home/mv5wK0/prog.pl:8
------> 			<name> '=' <content>,⏏