use serde::Serialize;
use super::{Element, Expression, Parameters, Span};
#[derive(Debug, Clone, Serialize)]
pub struct TableElement {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub open_span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub close_span: Span,
pub parameters: Parameters,
pub children: Vec<TableRowItem>,
}
#[derive(Debug, Clone, Serialize)]
pub enum TableRowItem {
Row(TableRowElement),
Conditional(ConditionalTableRows),
}
#[derive(Debug, Clone, Serialize)]
pub struct TableRowElement {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub open_span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub close_span: Span,
pub parameters: Parameters,
pub children: Vec<TableCellItem>,
}
#[derive(Debug, Clone, Serialize)]
pub enum TableCellItem {
Cell(TableCellElement),
Conditional(ConditionalTableCells),
}
#[derive(Debug, Clone, Serialize)]
pub struct TableCellElement {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub open_span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub close_span: Span,
pub parameters: Parameters,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub x: Vec<Element>,
#[serde(skip_serializing_if = "Vec::is_empty")]
pub y: Vec<Element>,
pub children: Vec<Element>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ConditionalTableRows {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub open_span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub close_span: Span,
pub condition: Expression,
pub rows: Vec<TableRowElement>,
}
#[derive(Debug, Clone, Serialize)]
pub struct ConditionalTableCells {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub open_span: Span,
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub close_span: Span,
pub condition: Expression,
pub cells: Vec<TableCellElement>,
}