Skip to content

Commit

Permalink
Fix typos in doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
linkmauve authored and Geal committed Jul 15, 2018
1 parent 4e74e73 commit 7580624
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/how_nom_macros_work.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ transformed with the second pattern:
opt!(call!(digit))
```

The `call!` macro transforms `call!(input, f)` into `f(i)`. If you need to pass more parameters to the function, you can Use `call!(input, f, arg, arg2)` to get `f(i, arg, arg2)`.
The `call!` macro transforms `call!(input, f)` into `f(input)`. If you need to pass more parameters to the function, you can Use `call!(input, f, arg, arg2)` to get `f(input, arg, arg2)`.

## Using the macro's parameters

Expand Down
2 changes: 1 addition & 1 deletion doc/making_a_new_parser_from_scratch.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ This particular one is caused by `named!` generating a function returning a `IRe

There are a few tools you can use to debug how code is generated.

## trace_macros
## trace\_macros

The `trace_macros` feature show how macros are applied. To use it, add `#![feature(trace_macros)]` at the top of your file (you need Rust nightly for this), then apply it like this:

Expand Down
4 changes: 2 additions & 2 deletions doc/upgrading_to_nom_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ you can fix it with:
+ c == 0x0
```

## length_value, length_bytes refactoring
## `length_value!`, `length_bytes!` refactoring

The "length-value" pattern usually indicates that we get a length from the input, then take a slice of that size from the input, and convert that to a value of the type we need. The `length_value!` macro was using the length parameter to apply the value parser a specific number of times.

Expand All @@ -133,7 +133,7 @@ error[E0308]: mismatched types
sig_hash_algs_len: be_u16 ~
```

## error! does not exist anymore
## `error!` does not exist anymore

The `error!` macro, that was used to return a parsing error without backtracking through the parser tree, is now called `return_error!`. This change was done because the "log" crate also uses an `error!` macro, and they complained about the name conflict to nom instead of complaining to log, much to my dismay.

Expand Down

0 comments on commit 7580624

Please sign in to comment.