Compare commits
2 commits
e258f6208d
...
ae9634fee6
Author | SHA1 | Date | |
---|---|---|---|
ae9634fee6 | |||
d6a10ea2cc |
3 changed files with 8 additions and 4 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -99,7 +99,7 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
|||
|
||||
[[package]]
|
||||
name = "granite"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "granite"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
|
|
@ -183,8 +183,12 @@ fn execute(program: Program) {
|
|||
let label_loc = labels.get(&statement.arguments[0]).unwrap();
|
||||
current_statement = label_loc.clone();
|
||||
} else {
|
||||
println!("Numerical type issues.");
|
||||
exit(1);
|
||||
let binding = statement.arguments[0].clone().parse::<usize>();
|
||||
if binding.is_ok() { current_statement = binding.unwrap(); }
|
||||
else {
|
||||
println!("Numerical type issues.");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
} else if statement.operator == "a" {
|
||||
if vars.contains_key(&statement.arguments[0]) && vars.contains_key(&statement.arguments[1]) {
|
||||
|
|
Loading…
Reference in a new issue