Made the frontend for math, actually, completely work.
This commit is contained in:
parent
77eb521af4
commit
71ed4cea39
|
@ -146,7 +146,7 @@ impl std::fmt::Display for Token {
|
||||||
BangEqual => write!(f, "!="),
|
BangEqual => write!(f, "!="),
|
||||||
LessEqual => write!(f, "<="),
|
LessEqual => write!(f, "<="),
|
||||||
GreaterEqual => write!(f, ">="),
|
GreaterEqual => write!(f, ">="),
|
||||||
String => write!(f, "[string]"),
|
StringLiteral => write!(f, "string"),
|
||||||
Number(n) => write!(f, "{}", n),
|
Number(n) => write!(f, "{}", n),
|
||||||
Identifier(i) => write!(f, "{}", i),
|
Identifier(i) => write!(f, "{}", i),
|
||||||
True => write!(f, "true"),
|
True => write!(f, "true"),
|
||||||
|
|
36
src/main.rs
36
src/main.rs
|
@ -16,41 +16,7 @@ macro_rules! arrow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// let fc = fasm_codegen!(
|
let parsed = "3*10+5/5%12";
|
||||||
// vec![
|
|
||||||
// Expr::VarDefinition(VarDefinition {name: "goren", value: Value::Number(10)}),
|
|
||||||
// Expr::MathExpr(Math {
|
|
||||||
// left: &Value::Var(VarReference { name: "goren"}),
|
|
||||||
// right: &Value::Number(17),
|
|
||||||
// operator: MathOperator::OP_MULT
|
|
||||||
// }
|
|
||||||
// ),
|
|
||||||
// Expr::FunDefinition(FunDefinition {
|
|
||||||
// name: "adder", contents: vec![
|
|
||||||
// Expr::MathExpr(
|
|
||||||
// Math {
|
|
||||||
// left: &Value::Param(ParamReference {param_number: 0}),
|
|
||||||
// right: &Value::Param(ParamReference {param_number: 1}),
|
|
||||||
// operator: MathOperator::OP_ADD
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
// ]
|
|
||||||
// }),
|
|
||||||
|
|
||||||
// Expr::FunCall(
|
|
||||||
// FunCall {
|
|
||||||
// name: "adder",
|
|
||||||
// params: vec![Value::Var(VarReference {name: "goren"}), Value::Number(6)]
|
|
||||||
// }
|
|
||||||
// ),
|
|
||||||
|
|
||||||
// Expr::Breakpoint
|
|
||||||
// ]
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
// println!("{}", fc);
|
|
||||||
let parsed = "3*10+5";
|
|
||||||
|
|
||||||
let mut lexer = Token::lexer(parsed);
|
let mut lexer = Token::lexer(parsed);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue