error fixing

This commit is contained in:
afonya 2025-06-16 22:11:01 +02:00
parent 52b2e6fcc0
commit de8a3c655b
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
4 changed files with 18 additions and 4 deletions

View file

@ -306,6 +306,11 @@ fn shunt(input: Vec<ASTPart>, ctx: &Context) -> ASTPart {
}
}
}
if output.len() == 0 {
let err = create_error(&format!("No expressions found after applying order of operations"), 0, ErrorType::SemanticError, ErrorSubType::NoExpression);
print_error(&err, &ctx);
process::exit(1);
}
return output[0].clone();
}
fn read_function(input: &Vec<Token>, pos: &mut usize, with_args: bool, ctx: &Context) -> ASTPart {