Skip to content

Commit

Permalink
Fix documentation for utf8_string/3 (dashbitco#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
kipcole9 authored May 30, 2021
1 parent ae47f73 commit 58d9140
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/nimble_parsec.ex
Original file line number Diff line number Diff line change
Expand Up @@ -825,15 +825,19 @@ defmodule NimbleParsec do
end

@doc ~S"""
Defines an ASCII string combinator with of exact length or `min` and `max`
Defines an UTF8 string combinator with of exact length or `min` and `max`
codepoint length.
The `ranges` specify the allowed characters in the ASCII string.
See `ascii_char/2` for more information.
The `ranges` specify the allowed characters in the UTF8 string.
See `utf8_char/2` for more information.
If you want a string of unknown size, use `utf8_string(ranges, min: 1)`.
If you want a literal string, use `string/2`.
Note that the combinator matches on codepoints, not graphemes. Therefore
results may vary depending on whether the input is in `nfc` or `nfd`
normalized form.
## Examples
defmodule MyParser do
Expand Down

0 comments on commit 58d9140

Please sign in to comment.