Skip to content

Commit b94de0c

Browse files
committed
Added usage statements for Grammar.pod
1 parent f3071d9 commit b94de0c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/Type/Grammar.pod

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ More L<documentation on grammars|/language/grammars> is available.
2727
2828
=head2 method parse
2929
30+
Defined as:
31+
3032
method parse($target, :$rule = 'TOP', Parcel :$args = (), Mu :$actions = Mu, *%opt) {
3133
34+
Usage:
35+
36+
GRAMMAR.parse(TARGET, RULE?, ARGS?, ACTIONS?, OPTIONS?)
37+
3238
Parses the C<$target> (which will be coerced to L<Str|/type/Str> if it isn't
3339
one), using C<$rule> as the starting rule. Additional C<$args> will be given
3440
to the starting rule if provided.
@@ -100,8 +106,14 @@ This outputs:
100106
101107
=head2 method subparse
102108
109+
Defined as:
110+
103111
method subparse($target, :$rule = 'TOP', Parcel :$args = (), Mu :$actions = Mu, *%opt) {
104112
113+
Usage:
114+
115+
GRAMMAR.subparse(TARGET, RULE?, ARGS?, ACTIONS?, OPTIONS?)
116+
105117
Does exactly the same as L<method parse|/routine/parse>, except that cursor
106118
doesn't have to reach the end of the string to succeed. (That is, it doesn't
107119
have to match the whole string).
@@ -115,8 +127,14 @@ have to match the whole string).
115127
116128
=head2 method parsefile
117129
130+
Defined as:
131+
118132
method parsefile(Str(Cool) $filename, :$enc, *%opts) {
119133
134+
Usage:
135+
136+
GRAMMAR.parsefile(FILE, OPTIONS?)
137+
120138
Reads file C<$filename>, and parses it. All named arguments are passed on to
121139
L<method parse|/routine/parse>.
122140

0 commit comments

Comments
 (0)