Problem is found in the following piece of code;

3  grammar Grammar {
4    rule TOP { <.sentence>+ }
5    rule sentence { ('c1'|'c2') '=' <+ dutch-chars - [aeiou]>+ }
6    token dutch-chars { <[a..z]> }
7  }

Grammar.parse('c1 = sdwbh') ~~ Match || say 'Matched dutch characters';

Error message is;

Method 'chars' not found for invocant of class 'Grammar'
  in regex sentence at Regex3.pl6:5
  in regex TOP at Regex3.pl6:4
  in block <unit> at Regex3.pl6:9

Changing 'dutch-chars' into 'dutch_chars' will compile fine. Seems that the dash in between is seen as a substraction.

Perl6 version 2015.07.1-182-g5ba44fc built on MoarVM version 2015.07-108-g7e9f29e

Greetings
Marcel Timmerman

Reply via email to