From 5ff5239482a8154761921103458df9bb2a46f888 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 10 Jul 2023 07:04:24 -0500 Subject: [PATCH] a --- src/ast.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ast.rs b/src/ast.rs index 7a98721..3fd0d71 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -24,10 +24,27 @@ pub struct Item { #[derive(Debug)] pub enum ItemKind { + Import(Import), FuncDef(FuncDef), StructDef(StructDef), } +// =============================================== +// Import + +#[derive(Debug)] +pub struct Import { + pub(crate) from: String, + pub(crate) items: ImportItem, +} + +#[derive(Debug)] +pub enum ImportItem { + SelfItem(Option), + Item(String, Option), + Module(String, Vec), +} + // =============================================== // Functions