use crate::parser::geom::GeometryStatement;
#[derive(Debug, Clone, PartialEq)]
pub struct GeomStmt {
pub tuple_idx: usize,
pub stmt_idx: usize,
pub statement: GeometryStatement,
}
impl GeomStmt {
pub fn new(tuple_idx: usize, stmt_idx: usize, statement: GeometryStatement) -> Self {
Self {
tuple_idx,
stmt_idx,
statement,
}
}
pub fn region(&self) -> Option<&str> {
self.statement.region()
}
pub fn is_anonymous(&self) -> bool {
self.statement.region().is_none()
}
pub fn anonymous_key(&self) -> String {
format!("__anon_{}_{}", self.tuple_idx, self.stmt_idx)
}
}