Skip to content

Commit 1891a12

Browse files
committed
Typographical etc. corrections to grammars.pod
1 parent 1124b3c commit 1891a12

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/Language/grammars.pod

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For example, Perl 6 is parsed and executed using a Perl 6-style grammar.
1111
1212
An example that's more practical to the common Perl 6 user is the
1313
L<JSON::Simple module|https://github.com/moritz/json>, which can
14-
deserialize any valid JSON file, and yet the deserializing code is
14+
deserialize any valid JSON file, however the deserializing code is
1515
written in less than 100 lines of simple, extensible code.
1616
1717
If you didn't like grammar in school, don't let that scare you off grammars.
@@ -26,8 +26,9 @@ document, I<named> regexes have a special syntax, similar to subroutine
2626
definitions:N<In fact, named regexes can even take extra arguments, using the
2727
same syntax as subroutine parameter lists>
2828
29-
=for code :allow<B>
30-
my B<regex number {> \d+ [ \. \d+ ]? B<}>
29+
=begin code :allow<B>
30+
my B<regex number {> \d+ [ \. \d+ ]? B<}>
31+
=end code
3132
3233
In this case, we have to specify that the regex is lexically scoped
3334
using the C<my> keyword, because named regexes are normally used within
@@ -115,13 +116,13 @@ be used in conjunction with the grammar.
115116
method parse($str, :$rule = 'TOP', :$actions) returns Match:D
116117
117118
Matches the grammar against C<$str>, using C<$rule> as the starting rule,
118-
optionally applying C<$actions> as actions object.
119+
optionally applying C<$actions> as its actions object.
119120
120121
This will fail if the grammar does not parse the I<entire> string. If a
121122
parse of only a part of the string is desired, use L<subparse>.
122123
123-
Returns the resulting L<Match> object, and also sets the caller's C<$/>
124-
variable to the result Match object.
124+
The method returns the resulting L<Match> object and also sets the caller's C<$/>
125+
variable to the Match object.
125126
126127
=begin code :allow<B>
127128
say CSVB<.parse>( q:to/EOCSV/ );
@@ -158,7 +159,7 @@ This outputs:
158159
method subparse($str, :$rule = 'TOP', :$actions) returns Match:D
159160
160161
Matches the grammar against C<$str>, using C<$rule> as the starting rule,
161-
optionally applying C<$actions> as actions object.
162+
optionally applying C<$actions> as its actions object.
162163
163164
Unlike L<parse>, C<subparse> will allow the grammar to match only part
164165
of the supplied string.
@@ -168,7 +169,7 @@ of the supplied string.
168169
method parsefile(Cool $filename as Str, *%opts) returns Match:D
169170
170171
Parses the contents of the file C<$filename> with the L<parse> method,
171-
passing along any named options in C<%opts>.
172+
passing any named options in C<%opts>.
172173
173174
=head1 Action Classes
174175

0 commit comments

Comments
 (0)