Init.
This commit is contained in:
+65
@@ -0,0 +1,65 @@
|
||||
pub enum Script {
|
||||
Expr(Expr),
|
||||
Fn(Fn),
|
||||
FnCall(FnCall),
|
||||
}
|
||||
|
||||
pub struct Expr {
|
||||
pub ident: ExprIdent,
|
||||
pub value: ExprValue,
|
||||
}
|
||||
|
||||
pub struct ExprIdent(pub Ident);
|
||||
|
||||
pub enum ExprValue {
|
||||
Number(ExprNumber),
|
||||
String(ExprString),
|
||||
}
|
||||
|
||||
pub struct ExprNumber {
|
||||
pub raw: String,
|
||||
pub value: f64,
|
||||
}
|
||||
|
||||
pub struct ExprString {
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
pub struct Fn {
|
||||
pub ident: FnIdent,
|
||||
pub params: Vec<FnParam>,
|
||||
pub elements: Vec<FnElement>,
|
||||
}
|
||||
|
||||
pub struct FnIdent(pub Ident);
|
||||
|
||||
pub struct FnParam {
|
||||
pub ident: FnParamIdent,
|
||||
pub ty: FnParamType,
|
||||
}
|
||||
|
||||
pub struct FnParamIdent(pub Ident);
|
||||
|
||||
pub enum FnParamType {
|
||||
Number,
|
||||
String,
|
||||
}
|
||||
|
||||
pub enum FnElement {
|
||||
Expr(Expr),
|
||||
}
|
||||
|
||||
pub struct FnCall {
|
||||
pub ident: FnIdent,
|
||||
pub args: Vec<FnCallArg>,
|
||||
}
|
||||
|
||||
pub enum FnCallArg {
|
||||
Expr(ExprIdent),
|
||||
Number(ExprNumber),
|
||||
String(ExprString),
|
||||
}
|
||||
|
||||
pub struct Ident {
|
||||
pub name: String,
|
||||
}
|
||||
Reference in New Issue
Block a user