-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: experiment with semantic analysis ideas.
- Loading branch information
Showing
11 changed files
with
330 additions
and
60 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 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,14 @@ | ||
[package] | ||
name = "fuse_ir" | ||
version = "0.0.0" | ||
description.workspace = true | ||
authors.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
fuse_ast = { workspace = true } | ||
fuse_common = { workspace = true } | ||
fuse_visitor = { workspace = true } | ||
|
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,21 @@ | ||
use fuse_ast::Identifier; | ||
|
||
pub enum PrimitiveType { | ||
Number, | ||
String, | ||
Boolean, | ||
} | ||
|
||
impl PrimitiveType { | ||
/// All of the primitive types | ||
pub const ALL: [Self; 3] = [Self::Number, Self::Boolean, Self::String]; | ||
|
||
pub fn from_identifier(ident: &Identifier) -> Option<Self> { | ||
match ident.name.as_str() { | ||
"number" => Some(Self::Number), | ||
"string" => Some(Self::String), | ||
"boolean" => Some(Self::Boolean), | ||
_ => None, | ||
} | ||
} | ||
} |
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,3 @@ | ||
mod ir; | ||
|
||
pub use ir::*; |
Empty file.
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,13 @@ | ||
[package] | ||
name = "fuse_semantic" | ||
version = "0.0.0" | ||
description.workspace = true | ||
authors.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
edition.workspace = true | ||
|
||
[dependencies] | ||
fuse_ast = { workspace = true } | ||
fuse_common = { workspace = true } | ||
fuse_visitor = { workspace = true } |
Oops, something went wrong.