From 642f21d2985035844669ba71a119e63ca8fcc019 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 18 Sep 2019 10:09:33 -0700 Subject: [PATCH] WIP commit - adding ItemId to Expression --- schala-lang/language/src/ast.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/schala-lang/language/src/ast.rs b/schala-lang/language/src/ast.rs index bf77ef1..01cab96 100644 --- a/schala-lang/language/src/ast.rs +++ b/schala-lang/language/src/ast.rs @@ -160,17 +160,18 @@ pub enum Variant { #[derive(Debug, PartialEq, Clone)] pub struct Expression { + pub id: ItemId, pub kind: ExpressionKind, pub type_anno: Option } 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) } } }