command: Operand carries a source span
Each WHERE-expression Operand now records the byte span of the terminal it was built from — the precise per-literal highlight target for an expression WARNING (finishing ADR-0027 §2's highlight/hint wiring). parse_operand captures MatchedItem::span; the RowFilter::eq convenience constructor uses Operand::NO_SPAN. PartialEq is hand-written to ignore the span — it is editor metadata, so Command equality stays whitespace- and position-independent, which the Expr test corpus relies on. No behaviour change; 1100 tests still pass, clippy clean.
This commit is contained in:
@@ -4251,8 +4251,8 @@ fn compile_operand(
|
||||
params: &mut Vec<rusqlite::types::Value>,
|
||||
) -> String {
|
||||
match operand {
|
||||
Operand::Column(name) => quote_ident(name),
|
||||
Operand::Literal(value) => {
|
||||
Operand::Column { name, .. } => quote_ident(name),
|
||||
Operand::Literal { value, .. } => {
|
||||
params.push(bind_where_literal(value, against));
|
||||
format!("?{}", params.len())
|
||||
}
|
||||
@@ -4264,12 +4264,12 @@ fn compile_operand(
|
||||
/// yield `None`.
|
||||
fn operand_column_type(operand: &Operand, schema: &ReadSchema) -> Option<Type> {
|
||||
match operand {
|
||||
Operand::Column(name) => schema
|
||||
Operand::Column { name, .. } => schema
|
||||
.columns
|
||||
.iter()
|
||||
.find(|c| c.name.eq_ignore_ascii_case(name))
|
||||
.and_then(|c| c.user_type),
|
||||
Operand::Literal(_) => None,
|
||||
Operand::Literal { .. } => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user