From 782618e2657385a00252cf016e04ca7f87678475 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Mon, 13 Apr 2026 07:40:16 -0300 Subject: [PATCH] fix: ADD_SUGGESTION compilation error - AS keyword case mismatch Root cause: compiler converts AS -> as (lowercase keywords) but Rhai custom syntax expected uppercase 'AS'. Rhai syntax is case-sensitive. Changed: - ADD_SUGGESTION_TOOL: 'AS' -> 'as' - ADD_SUGGESTION_TEXT: 'AS' -> 'as' - ADD_SUGGESTION: 'AS' -> 'as' This fixes: 'Syntax error: Expecting AS for ADD_SUGGESTION_TOOL expression' Co-authored-by: Qwen-Coder --- src/basic/keywords/add_suggestion.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/basic/keywords/add_suggestion.rs b/src/basic/keywords/add_suggestion.rs index cc94845d..218e4075 100644 --- a/src/basic/keywords/add_suggestion.rs +++ b/src/basic/keywords/add_suggestion.rs @@ -74,10 +74,11 @@ pub fn add_suggestion_keyword( let user_session3 = user_session.clone(); let user_session4 = user_session.clone(); - // ADD_SUGGESTION_TOOL "tool_name" AS "button text" + // ADD_SUGGESTION_TOOL "tool_name" as "button text" + // Note: compiler converts AS -> as (lowercase keywords), so we use lowercase here engine .register_custom_syntax( - ["ADD_SUGGESTION_TOOL", "$expr$", "AS", "$expr$"], + ["ADD_SUGGESTION_TOOL", "$expr$", "as", "$expr$"], true, move |context, inputs| { let tool_name = context.eval_expression_tree(&inputs[0])?.to_string(); @@ -96,10 +97,10 @@ pub fn add_suggestion_keyword( ) .expect("valid syntax registration"); - // ADD_SUGGESTION_TEXT "text_value" AS "button text" + // ADD_SUGGESTION_TEXT "text_value" as "button text" engine .register_custom_syntax( - ["ADD_SUGGESTION_TEXT", "$expr$", "AS", "$expr$"], + ["ADD_SUGGESTION_TEXT", "$expr$", "as", "$expr$"], true, move |context, inputs| { let text_value = context.eval_expression_tree(&inputs[0])?.to_string(); @@ -112,10 +113,10 @@ pub fn add_suggestion_keyword( ) .expect("valid syntax registration"); - // ADD_SUGGESTION "context_name" AS "button text" + // ADD_SUGGESTION "context_name" as "button text" engine .register_custom_syntax( - ["ADD_SUGGESTION", "$expr$", "AS", "$expr$"], + ["ADD_SUGGESTION", "$expr$", "as", "$expr$"], true, move |context, inputs| { let context_name = context.eval_expression_tree(&inputs[0])?.to_string();