Skip to content

fix some typos #774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PERFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ In general, these are ordered from fastest to slowest.
`is_match` is fastest because it doesn't actually need to find the start or the
end of the leftmost-first match. It can quit immediately after it knows there
is a match. For example, given the regex `a+` and the haystack, `aaaaa`, the
search will quit after examing the first byte.
search will quit after examining the first byte.

In constrast, `find` must return both the start and end location of the
In contrast, `find` must return both the start and end location of the
leftmost-first match. It can use the DFA matcher for this, but must run it
forwards once to find the end of the match *and then run it backwards* to find
the start of the match. The two scans and the cost of finding the real end of
Expand Down Expand Up @@ -196,7 +196,7 @@ a few examples of regexes that get literal prefixes detected:

Literals in anchored regexes can also be used for detecting non-matches very
quickly. For example, `^foo\w+` and `\w+foo$` may be able to detect a non-match
just by examing the first (or last) three bytes of the haystack.
just by examining the first (or last) three bytes of the haystack.

## Unicode word boundaries may prevent the DFA from being used

Expand Down
8 changes: 4 additions & 4 deletions regex-syntax/src/ast/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl ParserBuilder {
/// they should impose a limit on the length, in bytes, of the concrete
/// pattern string. In particular, this is viable since this parser
/// implementation will limit itself to heap space proportional to the
/// lenth of the pattern string.
/// length of the pattern string.
///
/// Note that a nest limit of `0` will return a nest limit error for most
/// patterns but not all. For example, a nest limit of `0` permits `a` but
Expand Down Expand Up @@ -236,7 +236,7 @@ pub struct Parser {
/// supported.
octal: bool,
/// The initial setting for `ignore_whitespace` as provided by
/// Th`ParserBuilder`. is is used when reseting the parser's state.
/// `ParserBuilder`. It is used when resetting the parser's state.
initial_ignore_whitespace: bool,
/// Whether whitespace should be ignored. When enabled, comments are
/// also permitted.
Expand Down Expand Up @@ -1023,7 +1023,7 @@ impl<'s, P: Borrow<Parser>> ParserI<'s, P> {
/// The given `kind` should correspond to the operator observed by the
/// caller.
///
/// This assumes that the paser is currently positioned at the repetition
/// This assumes that the parser is currently positioned at the repetition
/// operator and advances the parser to the first character after the
/// operator. (Note that the operator may include a single additional `?`,
/// which makes the operator ungreedy.)
Expand Down Expand Up @@ -1078,7 +1078,7 @@ impl<'s, P: Borrow<Parser>> ParserI<'s, P> {
/// corresponds to the {m,n} syntax, and does not include the ?, * or +
/// operators.
///
/// This assumes that the paser is currently positioned at the opening `{`
/// This assumes that the parser is currently positioned at the opening `{`
/// and advances the parser to the first character after the operator.
/// (Note that the operator may include a single additional `?`, which
/// makes the operator ungreedy.)
Expand Down
2 changes: 1 addition & 1 deletion regex-syntax/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl ParserBuilder {
/// they should impose a limit on the length, in bytes, of the concrete
/// pattern string. In particular, this is viable since this parser
/// implementation will limit itself to heap space proportional to the
/// lenth of the pattern string.
/// length of the pattern string.
///
/// Note that a nest limit of `0` will return a nest limit error for most
/// patterns but not all. For example, a nest limit of `0` permits `a` but
Expand Down
2 changes: 1 addition & 1 deletion src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl ExecBuilder {
///
/// Note that when compiling 2 or more regular expressions, capture groups
/// are completely unsupported. (This means both `find` and `captures`
/// wont work.)
/// won't work.)
pub fn new_many<I, S>(res: I) -> Self
where
S: AsRef<str>,
Expand Down