Skip to content

Commit af1bbd6

Browse files
committed
Docs tweaks
1 parent 6831442 commit af1bbd6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ documentation = "https://github.com/kevinmehall/rust-peg/blob/master/README.md#r
1111
description = "A simple Parsing Expression Grammar (PEG) parser generator."
1212
keywords = ["peg", "parser", "parsing", "grammar"]
1313
categories = ["parsing"]
14+
readme = "README.md"
1415

1516
[dependencies]
1617
quote = "0.3"

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,16 @@ the input string parameter, and they are available by name in all action code bl
127127

128128
For an example see [the test](peg-syntax-ext/tests/grammar_args.rs).
129129

130-
Be careful with mutable arguments. Remember that rule actions can run on parse paths that later fail and do not contribute to the final parse.
130+
The arguments will be passed to each internal parse function, so they must be `Copy` or be a `&`
131+
or `&mut` reference. Be careful with mutable arguments. Remember that rule actions can run on parse
132+
paths that later fail and do not contribute to the final parse.
131133

132134
## Usage
133135

134136
### With a build script
135137

136-
A Cargo build script can compile your PEG grammar to Rust source automatically.
138+
A Cargo build script can compile your PEG grammar to Rust source automatically. This method works
139+
on stable Rust.
137140

138141
[Example crate using rust-peg with a build script](peg-tests/)
139142

src/bin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn main() {
3131
write!(&mut out, "{}", parser).unwrap();
3232
}
3333
Err(err) => {
34+
writeln!(log, "Error compiling rust-peg grammar:").unwrap();
3435
writeln!(log, "{}", err).unwrap();
3536
process::exit(1);
3637
}

0 commit comments

Comments
 (0)