Some basic parsing works (fixing order of operations), and one test case.

This commit is contained in:
2020-08-13 10:15:32 -07:00
parent 2881c5104a
commit 91d5d1b4fd
7 changed files with 137 additions and 50 deletions

View File

@@ -1,21 +1,25 @@
use crate::syntax::token_stream::Location;
#[derive(Debug, PartialEq)]
pub struct Program {
pub statements: Vec<Statement>,
pub result: Expression,
pub statements: Vec<Statement>,
pub result: Expression,
}
#[derive(Debug, PartialEq)]
pub enum Statement {
Binding(Location, String, Expression),
Expr(Location, Expression),
}
#[derive(Debug, PartialEq)]
pub enum Expression {
Value(Location, Value),
Reference(Location, String),
Primitive(Location, String, Vec<Expression>),
}
#[derive(Debug, PartialEq)]
pub enum Value {
Number(Option<u8>, i128)
Number(Option<u8>, i128),
}