Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mulander@bunkier_mysli:~/rakudo/rakudo-star-2010.07$ cat test.p6
- #!/home/full/mulander/rakudo/rakudo/parrot_install/bin/perl6
- use v6;
- grammar COMMENT {
- token TOP {
- '/*' ~ '*/' <content>
- }
- token content {
- .*?
- }
- }
- my $in = "/*This is just a comment*/";
- my $m = COMMENT.parse($in);
- say $m.<content>;
- mulander@bunkier_mysli:~/rakudo/rakudo-star-2010.07$ ./perl6 test.p6
- Unable to parse TOP, couldn't find final '*/' at line 1
- in 'COMMENT::TOP' at line 6:test.p6
- in 'Grammar::parse' at line 5599:CORE.setting
- in main program body at line 15:test.p6
- mulander@bunkier_mysli:~/rakudo/rakudo-star-2010.07$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement