commit 3ad4efc31101146bdeffa4ec6d4e75a4e85572be
parent 7ab3c6c97f0bbe22992f9f2c8b8f0b9b989c87d0
Author: ~karx <karx@tilde.team>
Date: Tue, 16 Mar 2021 12:47:39 -0500
Add comments to code
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
@@ -141,6 +141,7 @@ impl Program {
}
fn run_external(&mut self, arguments: String) {
+ // Split arguments by -
let argument_vec: Vec<&str> = arguments.split("-").collect();
println!("{}", argument_vec.len());
let filename = argument_vec[0];
@@ -151,6 +152,7 @@ impl Program {
prog.run();
if argument_vec.len() > 1 {
+ // Start from the second element
for name in argument_vec[1..].iter() {
let kind = match name.chars().nth(0) {
Some(content) => content,
@@ -173,11 +175,12 @@ impl Program {
None => panic!("ValueError: function {} has not been defined in {}!", name_to_import, filename)
}
} else {
+ // Skip unknown types
continue;
}
}
} else {
- // implied catch-all
+ // implied catch-all, might be unintuitive
for (key, value) in prog.vars.iter() {
self.vars.insert(*key, value.to_string());
}