From b4b746d50668dd04d0bfca5f8b91ab6a38f0fc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=B6=E5=A1=9A=E5=A4=AA=E6=99=BA?= Date: Sat, 27 Jul 2024 00:24:13 +0900 Subject: [PATCH] Implement comment --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 008e5e4..6518585 100644 --- a/src/main.rs +++ b/src/main.rs @@ -67,6 +67,8 @@ fn parse_program(source: String) -> Block { .to_string(), ); program.push(Instruction::While(expr, code_loop)) + } else if code.starts_with("//") { + program.push(Instruction::Comment(code[5..code.len()].to_string())) } } program