-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8234d62
commit 314ab57
Showing
6 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
pub struct Module { | ||
|
||
} | ||
|
||
pub trait FileHost { | ||
fn get(&mut self, path: String) -> String; | ||
fn exists(&mut self, path: String) -> bool; | ||
fn create(&mut self, path: String, content: String); | ||
fn get_mod(&self, path: String) -> Module; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
pub use parser; | ||
pub mod symbol; | ||
pub mod file_host; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
pub use parser::ast::model::*; | ||
|
||
pub enum SymbolDeclaration { | ||
Expression(ASTExpression), | ||
Statement(ASTStatement), | ||
Typing(ASTTypings) | ||
} | ||
|
||
pub enum SymbolKind { | ||
Struct{ | ||
properties: Vec<(String, Symbol)>, | ||
impls: Vec<Symbol> | ||
}, | ||
Enum{ | ||
members: Vec<(String, Symbol)>, | ||
impls: Vec<Symbol> | ||
}, | ||
Fn{ | ||
parameters: Vec<(String, Symbol)>, | ||
return_type: Symbol | ||
}, | ||
Module{ | ||
elements: Vec<Symbol> | ||
} | ||
} | ||
|
||
pub struct Symbol { | ||
pub name: String, | ||
pub id: u32, | ||
pub kind: Box<SymbolKind>, | ||
pub type_params: Vec<Symbol>, | ||
pub declaration: Option<SymbolDeclaration> | ||
} | ||
|
||
pub struct SymbolInstance { | ||
pub id: u32, | ||
pub type_params: Vec<Symbol> | ||
} | ||
|
||
pub struct SymbolAlias { | ||
pub name: String, | ||
pub id: u32 | ||
} |