Improved example formatting.
@@ -61,8 +61,8 @@ fn main() {
// A pair can be converted to an iterator of the tokens which make it up:
for inner_pair in pair.into_inner() {
match inner_pair.as_rule() {
- Rule::alpha => println!("letter: {}", inner_pair.into_span().as_str()),
- Rule::digit => println!("digit: {}", inner_pair.into_span().as_str()),
+ Rule::alpha => println!("Letter: {}", inner_pair.into_span().as_str()),
+ Rule::digit => println!("Digit: {}", inner_pair.into_span().as_str()),
_ => unreachable!()
};
}
@@ -75,13 +75,13 @@ This produces the following output:
Rule: ident
Span: Span { start: 0, end: 2 }
Text: a1
-letter: a
-digit: 1
+Letter: a
+Digit: 1
Rule: ident
Span: Span { start: 3, end: 5 }
Text: b2
-letter: b
-digit: 2
+Letter: b
+Digit: 2
```
## Meaningful error reporting
