WIP commit - adding ItemId to Expression
This commit is contained in:
parent
c12cb99b24
commit
642f21d298
@ -160,17 +160,18 @@ pub enum Variant {
|
|||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub struct Expression {
|
pub struct Expression {
|
||||||
|
pub id: ItemId,
|
||||||
pub kind: ExpressionKind,
|
pub kind: ExpressionKind,
|
||||||
pub type_anno: Option<TypeIdentifier>
|
pub type_anno: Option<TypeIdentifier>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Expression {
|
impl Expression {
|
||||||
pub fn new(kind: ExpressionKind) -> Expression {
|
pub fn new(id: ItemId, kind: ExpressionKind) -> Expression {
|
||||||
Expression { kind, type_anno: None }
|
Expression { id, kind, type_anno: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_anno(kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
pub fn with_anno(id: ItemId, kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
||||||
Expression { kind, type_anno: Some(type_anno) }
|
Expression { id, kind, type_anno: Some(type_anno) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user