1mod decode;
4mod encode;
5
6pub use decode::*;
7pub use encode::*;
8
9#[derive(Debug,PartialEq)]
10pub enum ScriptExpression {
11 ScriptValue(ScriptValue),
12 ScriptField(ScriptField),
13 ScriptCall(ScriptCall),
14 ScriptMarkup(ScriptMarkup),
15 ScriptComment(ScriptComment),
16 ScriptBinaryOp(ScriptBinaryOp),
17}
18
19#[derive(Debug,PartialEq)]
21pub enum ScriptReference {
22 Name(String),
23 ScriptAccessor(ScriptAccessor),
24}
25
26#[derive(Debug,PartialEq)]
28pub struct ScriptAccessor {
29 pub name: String,
30 pub path: Vec<ScriptAccessorPath>,
31}
32
33#[derive(Debug,PartialEq)]
34pub enum ScriptAccessorPath {
35 Name(String),
37 Expression(ScriptExpression),
39}
40
41#[derive(Debug,PartialEq)]
49pub struct ScriptField {
50 pub reference: ScriptReference,
51 pub value: Box<ScriptExpression>,
52}
53
54#[derive(Debug,PartialEq)]
56pub enum ScriptValue {
57 Name(String),
59 BoolLiteral(bool),
60 IntegerLiteral(i32),
61 BigIntegerLiteral(u64),
63 FloatLiteral(f32),
64 StringLiteral(String),
65}
66
67#[derive(Debug,PartialEq)]
75pub struct ScriptCall {
76 pub reference: ScriptReference,
77 pub arguments: Vec<ScriptExpression>
78}
79
80#[derive(Debug,PartialEq)]
93pub struct ScriptMarkup {
94 pub name: String,
95 pub body: Vec<ScriptExpression>
96}
97
98#[derive(Debug,PartialEq)]
100pub enum ScriptComment {
101 Block(String),
102 Line(String),
103}
104
105#[derive(Debug,PartialEq)]
107pub struct ScriptBinaryOp {
108 pub kind: ScriptBinaryOpKind,
109 pub lhs: Box<ScriptExpression>,
110 pub rhs: Box<ScriptExpression>,
111}
112
113#[derive(Debug,PartialEq)]
114pub enum ScriptBinaryOpKind {
115 Add,
116 Subtract,
117 Multiply,
118 Divide,
119 BitOr,
120 }