From 8b6de6961f7f7de71aca67db7fb81d5facef82af Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 18 Sep 2019 01:51:23 -0700 Subject: [PATCH] ItemId type --- schala-lang/language/src/ast.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/schala-lang/language/src/ast.rs b/schala-lang/language/src/ast.rs index 8fc50c2ee..491776a 100644 --- a/schala-lang/language/src/ast.rs +++ b/schala-lang/language/src/ast.rs @@ -7,6 +7,18 @@ use crate::symbol_table::FullyQualifiedSymbolName; mod operators; pub use operators::*; +/// An abstract identifier for an AST node +#[derive(Debug, PartialEq, Clone)] +pub struct ItemId { + idx: u32, +} + +impl ItemId { + pub fn new(n: u32) -> ItemId { + ItemId { idx: n } + } +} + #[derive(Clone, Debug, PartialEq)] pub struct Meta { pub n: T,