Skip to content
This repository
Browse code

add test for Match/Grammar

  • Loading branch information...
commit fabc66fc92a4bdedc14ac5fe580153d7ea751f05 1 parent 59ffe33
Flavio S. Glock authored April 06, 2011
27  t-backend-specific/15-grammar-quantifier.t
... ...
@@ -0,0 +1,27 @@
  1
+use v6;
  2
+
  3
+class Main {
  4
+
  5
+    token digit {
  6
+        [ '1' | '2' | '3' ] 
  7
+        { make "got a digit" }
  8
+    }
  9
+    token digits {
  10
+        <digit>*
  11
+        { 
  12
+            say '# before hyper ', $/.perl;
  13
+            make $<digit>.>>capture 
  14
+        }
  15
+    }
  16
+
  17
+    say '1..1';
  18
+    my $m = Main.digits( '123abc', 0);
  19
+    say '# from: ', $m.from;
  20
+    say '# to:   ', $m.to;
  21
+    say '# match: ', $m.perl;
  22
+    if $m.to != 3 {
  23
+        print "not ";
  24
+    }
  25
+    say 'ok 1';
  26
+}
  27
+

0 notes on commit fabc66f

Please sign in to comment.
Something went wrong with that request. Please try again.