Fix some typos.

This commit is contained in:
Bruce Mitchener
2018-03-05 10:48:48 +07:00
committed by Dan Gohman
parent 162ca42b08
commit 125270e2b0
17 changed files with 30 additions and 30 deletions

View File

@@ -19,7 +19,7 @@ pub enum Error {
UndefVariable(String),
/// A pattern contains a back-reference to a variable that was defined in the same pattern.
///
/// For example, `check: Hello $(world=.*) $world`. Backreferences are not support. Often the
/// For example, `check: Hello $(world=.*) $world`. Backreferences are not supported. Often the
/// desired effect can be achieved with the `sameln` check:
///
/// ```text

View File

@@ -42,7 +42,7 @@ pub enum Part {
}
impl Part {
/// Get the variabled referenced by this part, if any.
/// Get the variable referenced by this part, if any.
pub fn ref_var(&self) -> Option<&str> {
match *self {
Part::Var(ref var) |
@@ -217,10 +217,10 @@ impl Pattern {
}
/// Compute the length of a regular expression terminated by `)` or `}`.
/// Handle nested and escaped parentheses in the rx, but don't actualy parse it.
/// Handle nested and escaped parentheses in the rx, but don't actually parse it.
/// Return the position of the terminating brace or the length of the string.
fn regex_prefix(s: &str) -> usize {
// The prevous char was a backslash.
// The previous char was a backslash.
let mut escape = false;
// State around parsing charsets.
enum State {

View File

@@ -3,7 +3,7 @@ use std::borrow::Cow;
/// A variable name is one or more ASCII alphanumerical characters, including underscore.
/// Note that numerical variable names like `$45` are allowed too.
///
/// Try to parse a variable name from the begining of `s`.
/// Try to parse a variable name from the beginning of `s`.
/// Return the index of the character following the varname.
/// This returns 0 if `s` doesn't have a prefix that is a variable name.
pub fn varname_prefix(s: &str) -> usize {