Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton committed May 19, 2023
1 parent bed8896 commit 8504291
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions query-grammar/src/query_grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,8 @@ fn escaped_string<'a>(delimiter: char) -> impl Parser<&'a str, Output = String>
}

fn term_val<'a>() -> impl Parser<&'a str, Output = (Delimiter, String)> {
// TODO handle escaping of quotation marks.
let double_quotes = escaped_string('"').map(|phrase| (Delimiter::DoubleQuotes, phrase));
let single_quotes = escaped_string('\'').map(|phrase| (Delimiter::SingleQuotes, phrase));
// let single_quotes =
// char('\'').with(many1(satisfy(|c| c != '\''))).skip(char('\'')).map(|text|
// (Delimiter::SingleQuotes, text));
let text_no_delimiter = word().map(|text| (Delimiter::None, text));
negative_number()
.map(|negative_number_str| (Delimiter::None, negative_number_str))
Expand Down
2 changes: 1 addition & 1 deletion src/query/query_parser/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn trim_ast(logical_ast: LogicalAst) -> Option<LogicalAst> {
///
/// The language covered by the current parser is extremely simple.
///
/// * simple terms: "e.g.: `Barack Obama` will be seen as a sequence of two tokens Baracka and
/// * simple terms: "e.g.: `Barack Obama` will be seen as a sequence of two tokens Barack and
/// Obama. By default, the query parser will interpret this as a disjunction (see
/// `.set_conjunction_by_default()`) and will match all documents that contains either "Barack" or
/// "Obama" or both. Since we did not target a specific field, the query parser will look into the
Expand Down

0 comments on commit 8504291

Please sign in to comment.