# Usage:
# util/compile_p6grammar.pl examples/digits.grammar > Digits.pm
# perl -Ilib -MDigits -e 'print Digits->count("7c3d54")->(), "\n"'
grammar Digits;
%{ our $Count = 0; %}
token count {
<char>* { return $Count; }
}
token char {
| \d { $Count++; }
| \D
}