fix escaped quotes in filter

This commit is contained in:
Tamo 2022-06-09 16:03:49 +02:00
parent 9580b9de79
commit 90afde435b
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
2 changed files with 78 additions and 14 deletions

View file

@ -40,7 +40,6 @@ mod error;
mod value;
use std::fmt::Debug;
use std::ops::Deref;
use std::str::FromStr;
pub use condition::{parse_condition, parse_to, Condition};
@ -70,14 +69,6 @@ pub struct Token<'a> {
value: Option<String>,
}
impl<'a> Deref for Token<'a> {
type Target = &'a str;
fn deref(&self) -> &Self::Target {
&self.span
}
}
impl<'a> PartialEq for Token<'a> {
fn eq(&self, other: &Self) -> bool {
self.span.fragment() == other.span.fragment()
@ -89,6 +80,10 @@ impl<'a> Token<'a> {
Self { span, value }
}
pub fn lexeme(&self) -> &str {
&self.span
}
pub fn value(&self) -> &str {
self.value.as_ref().map_or(&self.span, |value| value)
}