use cljrs_types::span::Span;
#[derive(Debug, Clone)]
pub struct Form {
pub kind: FormKind,
pub span: Span,
}
impl Form {
pub fn new(kind: FormKind, span: Span) -> Self {
Self { kind, span }
}
}
impl PartialEq for Form {
fn eq(&self, other: &Self) -> bool {
self.kind == other.kind
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum FormKind {
Nil,
Bool(bool),
Int(i64),
BigInt(String),
Float(f64), BigDecimal(String),
Ratio(String),
Char(char),
Str(String),
Regex(String),
Symbolic(f64),
Symbol(String),
Keyword(String),
AutoKeyword(String),
List(Vec<Form>),
Vector(Vec<Form>),
Map(Vec<Form>),
Set(Vec<Form>),
Quote(Box<Form>),
SyntaxQuote(Box<Form>),
Unquote(Box<Form>),
UnquoteSplice(Box<Form>),
Deref(Box<Form>),
Var(Box<Form>),
Meta(Box<Form>, Box<Form>),
AnonFn(Vec<Form>),
TaggedLiteral(String, Box<Form>),
ReaderCond {
splicing: bool,
clauses: Vec<Form>,
},
}