Skip to content

Commit 0a77872

Browse files
author
梶塚太智
committed
コメントを強化
1 parent 0f8ea6a commit 0a77872

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/main.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ impl Executor {
208208
// タブや改行・全角スペースを半角スペースに変換する
209209
let code = code.replace(['\n', '\t', '\r', ' '], " ");
210210

211-
let mut syntax = Vec::new();
212-
let mut buffer = String::new();
213-
let mut in_brackets = 0;
214-
let mut in_parentheses = 0;
215-
let mut in_hash = false;
211+
let mut syntax = Vec::new(); // トークン列
212+
let mut buffer = String::new(); //トークンの仮保存
213+
let mut in_brackets = 0; // 文字列のネスト構造
214+
let mut in_parentheses = 0; // リストのネスト構造
215+
let mut in_hash = false; // コメントか否か
216216

217217
for c in code.chars() {
218218
match c {
@@ -267,11 +267,12 @@ impl Executor {
267267
self.show_stack(); // スタック内部を表示する
268268
self.log_print(format!(" ← {}\n", token));
269269

270-
// 加工用の文字ベクタ
270+
// トークン処理用の文字ベクタ
271271
let chars: Vec<char> = token.chars().collect();
272272

273+
// トークンが何なのか判定する
273274
if let Ok(i) = token.parse::<f64>() {
274-
// 数値に変換できたらスタックに積む
275+
// 数値をスタックに積む
275276
self.stack.push(Type::Number(i));
276277
} else if token == "true" || token == "false" {
277278
// 論理値をスタックに積む

0 commit comments

Comments
 (0)