Add variable resolution; the error behavior is pretty bad here.
This commit is contained in:
@@ -38,13 +38,14 @@ impl FromStr for Program {
|
||||
|
||||
#[test]
|
||||
fn order_of_operations() {
|
||||
let muladd1 = "1 + 2 * 3;";
|
||||
let muladd1 = "x = 1 + 2 * 3;";
|
||||
let testfile = 0;
|
||||
assert_eq!(
|
||||
Program::from_str(muladd1).unwrap(),
|
||||
Program {
|
||||
statements: vec![Statement::Expr(
|
||||
statements: vec![Statement::Binding(
|
||||
Location::InFile(testfile, 0),
|
||||
"x".to_string(),
|
||||
Expression::Primitive(
|
||||
Location::InFile(testfile, 2),
|
||||
"+".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user