a
This commit is contained in:
parent
cbce074ff1
commit
5ff5239482
1 changed files with 17 additions and 0 deletions
17
src/ast.rs
17
src/ast.rs
|
@ -24,10 +24,27 @@ pub struct Item {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ItemKind {
|
pub enum ItemKind {
|
||||||
|
Import(Import),
|
||||||
FuncDef(FuncDef),
|
FuncDef(FuncDef),
|
||||||
StructDef(StructDef),
|
StructDef(StructDef),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ===============================================
|
||||||
|
// Import
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Import {
|
||||||
|
pub(crate) from: String,
|
||||||
|
pub(crate) items: ImportItem,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum ImportItem {
|
||||||
|
SelfItem(Option<String>),
|
||||||
|
Item(String, Option<String>),
|
||||||
|
Module(String, Vec<ImportItem>),
|
||||||
|
}
|
||||||
|
|
||||||
// ===============================================
|
// ===============================================
|
||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue