Skip to content

Commit

Permalink
Fill in some missing doc holes.
Browse files Browse the repository at this point in the history
waywardmonkeys committed Jul 23, 2016
1 parent f687522 commit 37f4c8e
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/matchers/english/boolean.rs
Original file line number Diff line number Diff line change
@@ -6,14 +6,16 @@

//! Booleans - English Humanization

// This is just a dummy example for now. It should clearly be
// much better and actually work correctly. :)

use matchers::*;
use parser::HumanizedParser;

#[allow(missing_docs)]
/// Register matchers for English expressions for boolean values.
///
/// This doesn't need to be invoked directly typically. This will
/// be called by `humanize::matchers::english::register`.
pub fn register(parser: &mut HumanizedParser) {
parser.register_matcher(Matcher {
name: "English Booleans",
3 changes: 3 additions & 0 deletions src/matchers/english/mod.rs
Original file line number Diff line number Diff line change
@@ -12,6 +12,9 @@ pub mod boolean;
// pub mod ordinal;

/// Register all of the English language matchers.
///
/// This doesn't need to be invoked directly typically. This will
/// be called when creating a default `HumanizedParser`.
pub fn register(parser: &mut HumanizedParser) {
boolean::register(parser);
}
9 changes: 7 additions & 2 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -7,7 +7,12 @@
use language_tags::LanguageTag;
use matchers::*;

#[allow(missing_docs)]
/// Parse text input by a human and return a primitive value.
///
/// The actual matching is done by `Matcher` objects which are installed
/// by default when the parser is created. A parser without pre-installed
/// matchers can be created with `new_without_default_matchers`. Additional
/// or custom matchers can be added with `register_matcher`.
pub struct HumanizedParser<'p> {
/// The matchers which have been registered with this parser.
///
@@ -60,7 +65,7 @@ impl<'p> HumanizedParser<'p> {
matches
}

#[allow(missing_docs)]
/// Install a new `Matcher` to be used by this parser.
pub fn register_matcher(&mut self, matcher: Matcher<'p>) {
self.matchers.push(matcher);
}

0 comments on commit 37f4c8e

Please sign in to comment.