From 0505a8ef6d72039ff9787e820bdf7c2655f46780 Mon Sep 17 00:00:00 2001 From: Mees Delzenne Date: Mon, 5 Aug 2024 19:07:41 +0200 Subject: [PATCH] Fix like operator not being implemented (#4460) --- core/src/syn/lexer/byte.rs | 1 + core/src/syn/parser/test/value.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/core/src/syn/lexer/byte.rs b/core/src/syn/lexer/byte.rs index 5d30fb98..db5dc1e3 100644 --- a/core/src/syn/lexer/byte.rs +++ b/core/src/syn/lexer/byte.rs @@ -138,6 +138,7 @@ impl<'a> Lexer<'a> { b'(' => t!("("), b';' => t!(";"), b',' => t!(","), + b'~' => t!("~"), b'@' => t!("@"), byte::CR | byte::FF | byte::LF | byte::SP | byte::VT | byte::TAB => { self.eat_whitespace(); diff --git a/core/src/syn/parser/test/value.rs b/core/src/syn/parser/test/value.rs index 7f7905c0..5e6c2113 100644 --- a/core/src/syn/parser/test/value.rs +++ b/core/src/syn/parser/test/value.rs @@ -14,6 +14,11 @@ fn parse_coordinate() { test_parse!(parse_value, "(1.88, -18.0)").unwrap(); } +#[test] +fn parse_like_operator() { + test_parse!(parse_value, "a ~ b").unwrap(); +} + #[test] fn parse_large_depth_object() { let mut text = String::new();