setup main to specify an entry point
This commit is contained in:
21
src/ast.rs
21
src/ast.rs
@@ -5,14 +5,6 @@ pub enum Operator {
|
||||
Div,
|
||||
Plus,
|
||||
Minus,
|
||||
// Gt,
|
||||
// Gte,
|
||||
// Lt,
|
||||
// Lte,
|
||||
// Eq,
|
||||
// Mod,
|
||||
// Exp,
|
||||
// FloorDiv,
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +12,6 @@ pub struct LiteralInt {
|
||||
pub value: i64
|
||||
}
|
||||
|
||||
// pub struct LiteralString {
|
||||
// value: String
|
||||
// }
|
||||
|
||||
pub struct Identifier {
|
||||
pub name: String
|
||||
}
|
||||
@@ -35,7 +23,6 @@ pub struct FunctionCall {
|
||||
|
||||
pub enum Expression {
|
||||
LiteralInt(LiteralInt),
|
||||
// LiteralString(LiteralString),
|
||||
FunctionCall(FunctionCall),
|
||||
Identifier(Identifier),
|
||||
Op(Box<Expression>, Operator, Box<Expression>),
|
||||
@@ -47,23 +34,15 @@ pub struct Block {
|
||||
|
||||
pub struct VariableDeclaration {
|
||||
pub name: Identifier,
|
||||
// type: Identifier,
|
||||
}
|
||||
|
||||
pub struct Function {
|
||||
pub name: Identifier,
|
||||
// return_type: Identifier,
|
||||
pub arguments: Vec<VariableDeclaration>,
|
||||
pub block: Block,
|
||||
}
|
||||
|
||||
|
||||
// pub struct Assignment {
|
||||
// variable: VariableDeclaration,
|
||||
// expression: Expression,
|
||||
// }
|
||||
|
||||
|
||||
pub struct Module {
|
||||
pub functions: Vec<Function>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user