setup main to specify an entry point

This commit is contained in:
Andrew Segavac
2020-04-19 22:22:15 -06:00
parent 4d537e0f39
commit ba65669225
6 changed files with 101 additions and 37 deletions

View File

@@ -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>,
}