Skip to content

Commit

Permalink
Remove SourceLocation.
Browse files Browse the repository at this point in the history
We aren't going to deal with longer texts for now, just convert
the input to a possible value as a whole.
  • Loading branch information
waywardmonkeys committed Jul 22, 2016
1 parent 6824b18 commit dfa5e7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
7 changes: 3 additions & 4 deletions src/parse/english/boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ pub fn register(parser: &mut Parser) {
language: langtag!(en),
result_type: ValueType::Boolean,
matcher: Box::new(move |_text: &str| -> Option<Match> {
return Some(Match {
location: SourceLocation { start: 0, end: 0 },
weight: 100,
Some(Match {
value: HumanValue::Boolean(true),
});
weight: 100,
})
}),
});
}
13 changes: 0 additions & 13 deletions src/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ use std::time::{Duration, Instant};

pub mod english;

/// A location within a body of text.
#[derive(Debug)]
pub struct SourceLocation {
/// The starting offset into the text of the match.
pub start: usize,

/// The ending offset into the text of the match.
pub end: usize,
}

#[allow(missing_docs)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ValueType {
Expand Down Expand Up @@ -109,9 +99,6 @@ pub struct Match {
/// Should it be an enum with values like 'Likely', 'Unlikely',
/// and 'Certain'?
pub weight: i32,

/// Location of the match within the text.
pub location: SourceLocation,
}

#[allow(missing_docs)]
Expand Down

0 comments on commit dfa5e7e

Please sign in to comment.