Skip to content

Commit fe30ac9

Browse files
author
梶塚太智
committed
Enhance the comment for function
1 parent ef7103b commit fe30ac9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ impl Executor {
829829
self.stack.push(Type::Number(len));
830830
}
831831

832-
// Define variable
832+
// Define variable at memory
833833
"var" => {
834834
let name = self.pop_stack().get_string();
835835
let data = self.pop_stack();
@@ -840,7 +840,7 @@ impl Executor {
840840
self.show_variables()
841841
}
842842

843-
// Get data type
843+
// Get data type of value
844844
"type" => {
845845
let result = match self.pop_stack() {
846846
Type::Number(_) => "number",
@@ -874,21 +874,21 @@ impl Executor {
874874
self.stack.push(Type::List(list))
875875
}
876876

877-
// Free memory
877+
// Free up memory space of variable
878878
"free" => {
879879
let name = self.pop_stack().get_string();
880880
self.memory.remove(name.as_str());
881881
self.show_variables();
882882
}
883883

884-
// Copy value
884+
// Copy stack's top value
885885
"copy" => {
886886
let data = self.pop_stack();
887887
self.stack.push(data.clone());
888888
self.stack.push(data);
889889
}
890890

891-
// Swap value
891+
// Swap stack's top 2 value
892892
"swap" => {
893893
let b = self.pop_stack();
894894
let a = self.pop_stack();
@@ -898,7 +898,7 @@ impl Executor {
898898

899899
// Commands of times
900900

901-
// Get now time
901+
// Get now time as unix epoch
902902
"now-time" => {
903903
self.stack.push(Type::Number(
904904
SystemTime::now()

0 commit comments

Comments
 (0)