fn collect_symbol_names(expr: &Expr) -> Vec<String>
Collect all symbol names from an expression (handles +, ., and bare symbols).