Patrick R. Michaud writes: > > rule identifier() { <<alpha>> \w* } > > Does Perl 6 allow leading underscores in identifiers? If so, > shouldn't this be > > rule identifier() { <+<alpha>+[_]> \w* } > > ? Yeah, it should. There was an error anyway: rule identifier() { <+<alpha>> \w* } Fixed. > > > rule open_expression_grouping() { \( } > > rule close_expression_grouping() { \) } > > rule open_argument_list() { \( } > > rule close_argument_list() { \) } > > I'm not sure I agree with expression_grouping being defined in this > way-- it seems to me that parens (and brackets and braces and dots) > are being treated as operators (S03, S04), perhaps even > "postcircumfix" operators if I understand what that means (A12). So > we need to be a bit careful here. Parens are plain old "circumfix". We could stick that into the operator-precedence parser, and in fact they probably belong there. But the grammar is supposed to be so extensible that if we try to define things in terms of hooks from the beginning, we'll never get anywhere. You're right about the argument_list forms. Keep in mind that these are just the token definitions. The rules for using them are up higher. Again, my reasoning for including them was the same: we have to include something. And I figure it's easier to take stuff out than to put stuff in. > > In addition to reviewing what's been done so far, I'll take a stab > at writing the rules for P6 rules. :-) Eexcellent. LukeThread Previous | Thread Next