Permalink
Browse files

add test for Match/Grammar

  • Loading branch information...
1 parent 59ffe33 commit fabc66fc92a4bdedc14ac5fe580153d7ea751f05 @fglock committed Apr 6, 2011
Showing with 27 additions and 0 deletions.
  1. +27 −0 t-backend-specific/15-grammar-quantifier.t
View
27 t-backend-specific/15-grammar-quantifier.t
@@ -0,0 +1,27 @@
+use v6;
+
+class Main {
+
+ token digit {
+ [ '1' | '2' | '3' ]
+ { make "got a digit" }
+ }
+ token digits {
+ <digit>*
+ {
+ say '# before hyper ', $/.perl;
+ make $<digit>.>>capture
+ }
+ }
+
+ say '1..1';
+ my $m = Main.digits( '123abc', 0);
+ say '# from: ', $m.from;
+ say '# to: ', $m.to;
+ say '# match: ', $m.perl;
+ if $m.to != 3 {
+ print "not ";
+ }
+ say 'ok 1';
+}
+

0 comments on commit fabc66f

Please sign in to comment.