From 700fb1e266b8afc743c67cc01d05ed45bae320ac Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 15 Nov 2024 17:19:30 +0100 Subject: [PATCH] better control word checking for matches --- src/lexer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lexer.rs b/src/lexer.rs index d9fed26..dbb494a 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -261,7 +261,9 @@ fn read_block_dyn( if str_words[i + 1] == ">" { i += 1; let cword = &str_words[i + 1]; - if cword.contains(|c| c == '?' || c == '!') { + if cword.contains(|c| c == '?' || c == '!') + && !cword.contains(|c: char| c == '^' || !c.is_ascii_punctuation()) + { i += 1; } let pushing = if cword.contains('?') {