Skip to content

Commit

Permalink
Docs tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmehall committed Apr 29, 2017
1 parent 6831442 commit af1bbd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ documentation = "https://github.com/kevinmehall/rust-peg/blob/master/README.md#r
description = "A simple Parsing Expression Grammar (PEG) parser generator."
keywords = ["peg", "parser", "parsing", "grammar"]
categories = ["parsing"]
readme = "README.md"

[dependencies]
quote = "0.3"
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,16 @@ the input string parameter, and they are available by name in all action code bl

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

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.
The arguments will be passed to each internal parse function, so they must be `Copy` or be a `&`
or `&mut` reference. 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.

## Usage

### With a build script

A Cargo build script can compile your PEG grammar to Rust source automatically.
A Cargo build script can compile your PEG grammar to Rust source automatically. This method works
on stable Rust.

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

Expand Down
1 change: 1 addition & 0 deletions src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn main() {
write!(&mut out, "{}", parser).unwrap();
}
Err(err) => {
writeln!(log, "Error compiling rust-peg grammar:").unwrap();
writeln!(log, "{}", err).unwrap();
process::exit(1);
}
Expand Down

0 comments on commit af1bbd6

Please sign in to comment.