use super::common::ImmutableString;
#[derive(Debug, PartialEq, Clone)]
pub enum Value {
StringLit(StringLit),
NumberLit(NumberLit),
BooleanLit(BooleanLit),
Object(Object),
Array(Array),
NullKeyword(NullKeyword),
}
#[derive(Debug, PartialEq, Clone)]
pub struct Range {
pub pos: usize,
pub end: usize,
pub start_line: usize,
pub end_line: usize,
}
#[derive(Debug, PartialEq, Clone)]
pub struct StringLit {
pub range: Range,
pub value: ImmutableString,
}
#[derive(Debug, PartialEq, Clone)]
pub struct NumberLit {
pub range: Range,
pub value: ImmutableString,
}
#[derive(Debug, PartialEq, Clone)]
pub struct BooleanLit {
pub range: Range,
pub value: bool,
}
#[derive(Debug, PartialEq, Clone)]
pub struct NullKeyword {
pub range: Range,
}
#[derive(Debug, PartialEq, Clone)]
pub struct Object {
pub range: Range,
pub properties: Vec<ObjectProp>,
}
#[derive(Debug, PartialEq, Clone)]
pub struct ObjectProp {
pub range: Range,
pub name: StringLit,
pub value: Value,
}
#[derive(Debug, PartialEq, Clone)]
pub struct Array {
pub range: Range,
pub elements: Vec<Value>,
}
#[derive(Debug, PartialEq, Clone)]
pub enum Comment {
Line(CommentLine),
Block(CommentBlock)
}
#[derive(Debug, PartialEq, Clone)]
pub struct CommentLine {
pub range: Range,
pub text: ImmutableString,
}
#[derive(Debug, PartialEq, Clone)]
pub struct CommentBlock {
pub range: Range,
pub text: ImmutableString,
}