From 37f4c8e194c26d821f88e247273065088b397d58 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 23 Jul 2016 12:20:46 +0700 Subject: [PATCH] Fill in some missing doc holes. --- src/matchers/english/boolean.rs | 6 ++++-- src/matchers/english/mod.rs | 3 +++ src/parser.rs | 9 +++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/matchers/english/boolean.rs b/src/matchers/english/boolean.rs index e7537e5..2960df5 100644 --- a/src/matchers/english/boolean.rs +++ b/src/matchers/english/boolean.rs @@ -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", diff --git a/src/matchers/english/mod.rs b/src/matchers/english/mod.rs index 1684abc..afd1210 100644 --- a/src/matchers/english/mod.rs +++ b/src/matchers/english/mod.rs @@ -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); } diff --git a/src/parser.rs b/src/parser.rs index 2bb5a17..7ad314f 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -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); }