mirror of
https://github.com/azur1s/bobbylisp.git
synced 2024-10-16 02:37:40 -05:00
very bumpy
This commit is contained in:
parent
b52661c9d9
commit
070b8b259c
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -152,7 +152,7 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
|
|||
|
||||
[[package]]
|
||||
name = "hazure"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"codegen",
|
||||
|
|
|
@ -27,6 +27,13 @@ impl std::fmt::Display for Value {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum IRKind {
|
||||
Value { value: Value },
|
||||
Vector { values: Vec<Self> },
|
||||
Unary { op: String, right: Box<Self> },
|
||||
Binary { op: String, left: Box<Self>, right: Box<Self> },
|
||||
Call { name: String, args: Vec<Self> },
|
||||
Intrinsic { name: String, args: Vec<Self> },
|
||||
|
||||
Define {
|
||||
public: bool,
|
||||
name: String,
|
||||
|
@ -42,16 +49,9 @@ pub enum IRKind {
|
|||
body: Box<Self>
|
||||
},
|
||||
|
||||
Call { name: String, args: Vec<Self> },
|
||||
Intrinsic { name: String, args: Vec<Self> },
|
||||
Do { body: Vec<Self> },
|
||||
If { cond: Box<Self>, body: Box<Self>, else_body: Box<Self> },
|
||||
Case { cond: Box<Self>, cases: Vec<(Box<Self>, Box<Self>)>, default: Box<Self> },
|
||||
Unary { op: String, right: Box<Self> },
|
||||
Binary { op: String, left: Box<Self>, right: Box<Self> },
|
||||
|
||||
Value { value: Value },
|
||||
Vector { values: Vec<Self> },
|
||||
Do { body: Vec<Self> },
|
||||
|
||||
Return { value: Box<Self> },
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ fn gen_type_hint(type_hint: &str) -> String {
|
|||
"bool" => "boolean".to_string(),
|
||||
"string" => "string".to_string(),
|
||||
"void" => "void".to_string(),
|
||||
// TODO: Un-hardcode vector type
|
||||
// TODO: Un-hardcode types
|
||||
"vec_int" => "number[]".to_string(),
|
||||
"vec_bool" => "boolean[]".to_string(),
|
||||
"vec_str" => "string[]".to_string(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "hazure"
|
||||
license = "MIT OR Apache-2.0"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
@ -22,4 +22,4 @@ diagnostic = { path = "../diagnostic" }
|
|||
|
||||
# Codegen
|
||||
hir = { path = "../hir" }
|
||||
codegen = { path = "../codegen" }
|
||||
codegen = { path = "../codegen" }
|
||||
|
|
Loading…
Reference in a new issue