From a3222f5e3830cec939d4bdc14f6ff97762b2bc8b Mon Sep 17 00:00:00 2001 From: Pasha Podolsky Date: Tue, 24 Dec 2024 10:07:22 +0100 Subject: [PATCH] dev --- summa-core/src/components/query_parser/summa_ql.pest | 3 ++- summa-core/src/components/query_parser/summa_ql.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/summa-core/src/components/query_parser/summa_ql.pest b/summa-core/src/components/query_parser/summa_ql.pest index 76d8f2ac..b3b204e2 100644 --- a/summa-core/src/components/query_parser/summa_ql.pest +++ b/summa-core/src/components/query_parser/summa_ql.pest @@ -15,8 +15,9 @@ range = ${ "[" ~ WHITE_SPACE* ~ boundary_word ~ WHITE_SPACE+ ~ ^"to" ~ WHITE_SPA field_name = @{ ASCII_ALPHA ~ (ASCII_ALPHANUMERIC | "_" | ".")* } word = @{ wrapped_doi | ((LETTER | NUMBER) ~ (LETTER | NUMBER | "_" | "+" | "#" | "-" | "–" | "'")*) } +signed_word = ${ "-"? ~ word } -boundary_word = _{ star | ("-"? ~ word) } +boundary_word = _{ star | signed_word } phrase_internals = { (!PEEK ~ ANY)* } phrase = ${ PUSH(quote) ~ phrase_internals? ~ (POP | EOI) ~ ("~" ~ slop)? } regex_internals = ${ (!PEEK ~ ANY)* } diff --git a/summa-core/src/components/query_parser/summa_ql.rs b/summa-core/src/components/query_parser/summa_ql.rs index 5c528052..54f63788 100644 --- a/summa-core/src/components/query_parser/summa_ql.rs +++ b/summa-core/src/components/query_parser/summa_ql.rs @@ -562,7 +562,7 @@ impl QueryParser { fn parse_boundary_word(&self, field: Field, boundary_word: Pair) -> Result, QueryParserError> { Ok(match boundary_word.as_rule() { Rule::star => Unbounded, - Rule::word => Included(self.compute_boundary_term(field, boundary_word.as_str())?), + Rule::signed_word => Included(self.compute_boundary_term(field, boundary_word.as_str())?), _ => unreachable!(), }) }