pub mod filter;
pub mod formula;
pub mod statement;
pub mod transform;
pub mod value;
pub use filter::{ComparisonOp, FilterExpr, GeoPoint, PointIdPredicate};
pub use formula::{FormulaExpr, looks_like_iso_datetime};
pub use statement::*;
pub use transform::inject_filter;
pub use value::Value;
pub fn is_simple_ident(name: &str) -> bool {
let mut chars = name.chars();
match chars.next() {
Some(c) if c.is_ascii_alphabetic() || c == '_' => {}
_ => return false,
}
chars.all(|c| c.is_ascii_alphanumeric() || c == '_')
}
pub fn escape_string(value: &str) -> alloc::string::String {
let mut out = alloc::string::String::with_capacity(value.len());
for ch in value.chars() {
match ch {
'\\' => out.push_str("\\\\"),
'\'' => out.push_str("\\'"),
'\n' => out.push_str("\\n"),
'\r' => out.push_str("\\r"),
'\t' => out.push_str("\\t"),
'\0' => {}
c => out.push(c),
}
}
out
}