From e64c9c262b92f71ad7913299c1c971575d94715f 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 11:36:36 +0900 Subject: [PATCH] Implement instruction of `import` --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/main.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82b9aa2..cf2734c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,9 +144,9 @@ dependencies = [ [[package]] name = "sila-transpiler-infrastructure" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c508f7a663cc0fb17b7a86263fcd60535a4ba4462d959243d0059452674b55f3" +checksum = "5ca363c47ac41129a072ac46fda5846965435a205ac9e416ab129c913c4ad72b" [[package]] name = "syn" diff --git a/Cargo.toml b/Cargo.toml index bf1bb41..aa2c68d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,4 +5,4 @@ edition = "2021" [dependencies] pyo3 = "0.22.2" -sila-transpiler-infrastructure = "0.3.3" +sila-transpiler-infrastructure = "0.3.4" diff --git a/src/main.rs b/src/main.rs index 4fd3d8a..84e84c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,6 +68,8 @@ fn parse_program(source: String) -> Block { program.push(Instruction::While(expr, code_loop)) } else if code.starts_with("//") { program.push(Instruction::Comment(code[2..code.len()].trim().to_string())) + } else if code.starts_with("import") { + program.push(Instruction::Import(code[6..code.len()].trim().to_string())) } } program