Merge remote-tracking branch 'origin/master' into no_std

This commit is contained in:
Dan Gohman
2018-03-12 12:55:57 -07:00
138 changed files with 3795 additions and 1168 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

@@ -1,5 +1,5 @@
//! This crate provides a text pattern matching library with functionality similar to the LLVM
//! project's [FileCheck command](http://llvm.org/docs/CommandGuide/FileCheck.html).
//! project's [FileCheck command](https://llvm.org/docs/CommandGuide/FileCheck.html).
//!
//! A list of directives is typically extracted from a file containing a test case. The test case
//! is then run through the program under test, and its output matched against the directives.
@@ -236,7 +236,9 @@
//! This will match `"one, two"` , but not `"one,two"`. Without the `$()`, trailing whitespace
//! would be trimmed from the pattern.
#![deny(missing_docs)]
#![deny(missing_docs,
trivial_numeric_casts,
unused_extern_crates)]
pub use error::{Error, Result};
pub use variable::{VariableMap, Value, NO_VARIABLES};

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 {