Skip to content

Commit a209a6d

Browse files
committed
Add type skeleton in HIR
1 parent 621fe8c commit a209a6d

File tree

11 files changed

+697
-47
lines changed

11 files changed

+697
-47
lines changed

optd-dsl/src/analyzer/hir.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*pub type Identifier = String;
2+
3+
pub enum Expr {
4+
IfThenElse {
5+
cond: Typed<Expr>,
6+
then: Typed<Expr>,
7+
otherwise: Typed<Expr>,
8+
},
9+
Ref(Identifier),
10+
Value(i64),
11+
}
12+
13+
#[derive(Clone, PartialEq, Eq, Debug)]
14+
pub struct Typed<T> {
15+
pub value: Box<T>,
16+
pub ty: Type,
17+
}
18+
19+
impl<T> Typed<T> {
20+
pub fn new(value: T, ty: Type) -> Self {
21+
Self {
22+
value: Box::new(value),
23+
ty,
24+
}
25+
}
26+
}
27+
28+
pub struct HIR {}
29+
*/

optd-dsl/src/analyzer/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod hir;
2+
pub mod r#type;

0 commit comments

Comments
 (0)