//! Eval implementations for string operators

use hamelin_lib::func::defs::StringConcat;

use crate::null_propagate;
use crate::registry::EvalRegistry;
use crate::value::Value;

/// Register all string operator eval implementations.
pub fn register(registry: &mut EvalRegistry) {
    // StringConcat: left + right
    registry.register_eval::<StringConcat>(|mut params| {
        let left = null_propagate!(params.take()?).require_string()?;
        let right = null_propagate!(params.take()?).require_string()?;
        Ok(Value::String(left + &right))
    });

    // No reverse eval for string concatenation - not invertible
}
