Skip to content

Commit 67579a1

Browse files
committed
:args named parcel argument in Grammar.parse
1 parent e8d23f6 commit 67579a1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

S05-regex.pod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4396,7 +4396,9 @@ All grammar objects are derived from C<Cursor>, so every grammar object's
43964396
value embodies the current state of the current match. This new grammar
43974397
object is then passed as the invocant to the C<TOP> method (regex, token,
43984398
or rule) of C<MyGrammar>. The default rule name to call can be overridden with
4399-
the C<:rule> named argument of the C<parse> method.
4399+
the C<:rule> named argument of the C<parse> method. This is useful for unit testing
4400+
the rules of a grammar. As methods, rules can have arguments, so the C<:args> named
4401+
argument is used to pass such arguments as a parcel if necessary.
44004402

44014403
Grammar objects are considered immutable, so
44024404
every match returns a different match state, and multiple match states may

0 commit comments

Comments
 (0)