From 08d29e91135d4e087c0eecb9e1f76362929a1465 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 19 Nov 2026 23:33:51 +0100 Subject: [PATCH] address: the backslash joint as a character literal Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/address.rs | 2 +- crates/mind-body/src/address/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/mind-body/src/address.rs b/crates/mind-body/src/address.rs index 73e7bf0..91bebeb 100644 --- a/crates/mind-body/src/address.rs +++ b/crates/mind-body/src/address.rs @@ -110,7 +110,7 @@ pub(crate) fn names_whole_word(text: &str, name: &str, exact: bool) -> bool { /// A character that joins a word to more of the same token: a letter, a digit, or a path or identifier joint. fn joins(c: char) -> bool { - c.is_alphanumeric() || matches!(c, '-' | '_' | '/' | '\') + c.is_alphanumeric() || matches!(c, '-' | '_' | '/' | '\\') } /// Whether the text after a name carries the token on: a joining character, or a `.` with a letter or digit after it. diff --git a/crates/mind-body/src/address/tests.rs b/crates/mind-body/src/address/tests.rs index 178f55b..fc10941 100644 --- a/crates/mind-body/src/address/tests.rs +++ b/crates/mind-body/src/address/tests.rs @@ -142,7 +142,7 @@ fn a_direct_message_is_for_her_whatever_the_basis() { #[test] fn a_name_inside_a_path_or_an_identifier_is_not_her_name() { let eureka = Addressee::new("@eureka:chat", ["Eureka"]); - for path in ["the trace at /var/lib/mind-eureka/persona-trace.cc grew", "see eureka.cc", "eureka_state is a crate", "C:\eureka\x", "mind-eureka@ is a unit"] { + for path in ["the trace at /var/lib/mind-eureka/persona-trace.cc grew", "see eureka.cc", "eureka_state is a crate", "C:\\eureka\\x", "mind-eureka@ is a unit"] { assert!(!addresses(&eureka, &said(path, &[])), "{path:?} does not name her"); } for spoken in ["Eureka.", "Eureka, are you there?", "ask eureka.", "(Eureka)", "@Eureka hi", "\"Eureka\" said it", "Eureka's turn"] {