Skip to content

Commit e187cf9

Browse files
authored
Merge pull request #2036 from ronaldxs/grammar_totorial-role-clarification
grammar_totorial.pm6 clarification of extending grammars with roles
2 parents be25007 + acc559a commit e187cf9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc/Language/grammar_tutorial.pod6

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,14 @@ grammar Quoted-Other does Letters does Quote-Other {
301301
}
302302
=end code
303303
304-
Will output exactly the same as the code above.
304+
Will output exactly the same as the code above. Symptomatic of the difference
305+
between Classes and Roles, a conflict like defining C<token quote> twice
306+
using Role composition will result in an error:
307+
308+
=begin code
309+
grammar Quoted-Quotes does Letters does Quote-Quotes does Quote-Other { ... }
310+
# OUTPUT: ... Error while compiling ... Method 'quote' must be resolved ...
311+
=end code
305312
306313
=head2 Adding some constraints
307314

0 commit comments

Comments
 (0)