use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
use super::Element;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Span {
pub start: usize,
pub end: usize,
}
impl Span {
pub fn new(start: usize, end: usize) -> Self {
Self { start, end }
}
pub fn synthesized() -> Self {
Self { start: 0, end: 0 }
}
}
#[derive(Debug, Clone, Serialize)]
pub struct Parameter {
#[cfg_attr(not(feature = "include_locations"), serde(skip_serializing))]
pub span: Span,
pub key: String,
pub value: Vec<Element>,
}
pub type Parameters = IndexMap<String, Parameter>;