Skip to content

Commit c671ebd

Browse files
committed
Reflow and revision
1 parent 9f8c989 commit c671ebd

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

doc/Language/grammar_tutorial.pod6

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ Grammars are a special kind of class. You declare and define a grammar exactly
4343
as you would any other class, except that you use the I<grammar> keyword instead
4444
of I<class>.
4545
46-
=begin code :skip-test
47-
grammar G { ... }
48-
=end code
46+
=begin code :skip-test
47+
grammar G { ... }
48+
=end code
4949
50-
Grammars are made up of methods that define a regex, a token, or a rule.
51-
These are all varieties of different types of match methods. Once you have a
52-
grammar defined, you call it and pass in a string for parsing.
50+
As such classes, grammars are made up of methods that define a regex, a token,
51+
or a rule. These are all varieties of different types of match methods. Once you
52+
have a grammar defined, you call it and pass in a string for parsing.
5353
54-
=begin code :preamble<grammar G{};my $string;>
55-
my $matchObject = G.parse($string);
56-
=end code
54+
=begin code :preamble<grammar G{};my $string;>
55+
my $matchObject = G.parse($string);
56+
=end code
5757
5858
Now, you may be wondering, if I have all these regexes defined that just return
5959
their results, how does that help with parsing strings that may be ahead
@@ -122,7 +122,6 @@ C<'clever_text_keyword'> B<must> be the first thing in the string, or
122122
the grammar parse will fail and we'll get an empty match. This is great for
123123
recognizing a malformed string that should be discarded.
124124
125-
126125
=head1 Learning by example - a REST contrivance
127126
128127
Let's suppose we'd like to parse a URI into the component parts that make up a

0 commit comments

Comments
 (0)