-
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.
Closes #22
- Loading branch information
Showing
16 changed files
with
376 additions
and
411 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pub mod import_bucket; | ||
pub mod modules; | ||
pub mod name_lookup; | ||
pub mod registry; | ||
pub mod registries; | ||
|
||
pub mod stages; |
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 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,23 @@ | ||
use surotto::{simple::SimpleSurotto, simple_key}; | ||
|
||
use super::{ | ||
modules::{Module, ModuleId}, | ||
stages::{ | ||
refine::registries::{Entity, Type}, | ||
rough::registries::{RoughEntity, RoughType}, | ||
}, | ||
}; | ||
|
||
pub type ModuleRegistry = SimpleSurotto<ModuleId, Module>; | ||
pub type RoughTypeRegistry<'ast> = SimpleSurotto<TypeId, RoughType<'ast>>; | ||
pub type RoughEntityRegistry<'ast> = SimpleSurotto<EntityId, RoughEntity<'ast>>; | ||
pub type RefinedTypeRegistry<'ir> = SimpleSurotto<TypeId, Type<'ir>>; | ||
pub type RefinedEntityRegistry<'ir> = SimpleSurotto<EntityId, Entity<'ir>>; | ||
|
||
simple_key!( | ||
pub struct TypeId; | ||
); | ||
|
||
simple_key!( | ||
pub struct EntityId; | ||
); |
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ pub mod rough; | |
|
||
pub mod flatten_lookup; | ||
|
||
pub mod refine_types; | ||
pub mod refine; |
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 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,51 @@ | ||
use crate::{ | ||
ast::PortKind, | ||
ir::registries::{EntityId, TypeId}, | ||
symbol::Ident, | ||
}; | ||
|
||
#[derive(Debug)] | ||
pub enum Type<'ir> { | ||
Record(Record<'ir>), | ||
Enum(Enum<'ir>), | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Entity<'ir> { | ||
pub type_id: EntityId, | ||
pub name: Ident, | ||
pub ports: &'ir [Port], | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Port { | ||
// TODO: we should agree on whether to use ast types in ir or ir types in ast, not both. | ||
pub kind: PortKind, | ||
pub name: Ident, | ||
pub ty: Option<TypeId>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Record<'ir> { | ||
pub type_id: TypeId, | ||
pub name: Ident, | ||
pub fields: &'ir [Field], | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Field { | ||
pub name: Ident, | ||
pub ty: Option<TypeId>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Enum<'ir> { | ||
pub type_id: TypeId, | ||
pub name: Ident, | ||
pub variants: &'ir [Variant], | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Variant { | ||
pub ident: Ident, | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.