Skip to main content

dar_core/
ast.rs

1// crates/dar-core/src/ast.rs
2#[derive(Debug, Clone)]
3pub enum Stmt {
4    Decl { name: String, init: Option<Expr,>, },
5    Print { expr: Expr, },
6    External { path: String, functions: Vec<ExternalFunc,>, },
7    Mod { path: String, },
8    Call { func: String, arg: Expr, },
9    Lua { path: String, mappings: Vec<(String, String,),>, },
10}
11#[derive(Debug, Clone)]
12pub struct ExternalFunc {
13    pub source_name: String,
14    pub alias: Option<String,>,
15}
16#[derive(Debug, Clone)]
17pub enum Expr {
18    Variable(String,),
19    StringLiteral(String,),
20    EmptyLiteral,
21    MethodCall { obj: Box<Expr,>, method: Method, },
22    Call { func: String, arg: Box<Expr,>, },
23}
24#[derive(Debug, Clone)]
25pub enum Method {
26    Upper,
27}