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)]
|
||||
pub struct Expression {
|
||||
pub id: ItemId,
|
||||
pub kind: ExpressionKind,
|
||||
pub type_anno: Option<TypeIdentifier>
|
||||
}
|
||||
|
||||
impl Expression {
|
||||
pub fn new(kind: ExpressionKind) -> Expression {
|
||||
Expression { kind, type_anno: None }
|
||||
pub fn new(id: ItemId, kind: ExpressionKind) -> Expression {
|
||||
Expression { id, kind, type_anno: None }
|
||||
}
|
||||
|
||||
pub fn with_anno(kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
||||
Expression { kind, type_anno: Some(type_anno) }
|
||||
pub fn with_anno(id: ItemId, kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression {
|
||||
Expression { id, kind, type_anno: Some(type_anno) }
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user