From 7b40ddc8455b61323a0353fdd2a9be896229ec6e Mon Sep 17 00:00:00 2001 From: John Date: Mon, 1 Apr 2024 04:20:26 -0500 Subject: [PATCH] cl-ast: destination side of type alias should be an identifier --- cl-ast/src/lib.rs | 2 +- cl-parser/src/parser.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cl-ast/src/lib.rs b/cl-ast/src/lib.rs index 700e669..0824635 100644 --- a/cl-ast/src/lib.rs +++ b/cl-ast/src/lib.rs @@ -90,7 +90,7 @@ pub enum ItemKind { #[derive(Clone, Debug, PartialEq, Eq)] pub struct Alias { - pub to: Box, + pub to: Identifier, pub from: Option>, } diff --git a/cl-parser/src/parser.rs b/cl-parser/src/parser.rs index f66407c..8a79bc2 100644 --- a/cl-parser/src/parser.rs +++ b/cl-parser/src/parser.rs @@ -307,7 +307,7 @@ impl<'t> Parser<'t> { const PARSING: Parsing = Parsing::Alias; self.match_kw(Keyword::Type, PARSING)?; let out = Ok(Alias { - to: self.ty()?.into(), + to: self.identifier()?, from: if self.match_type(Type::Eq, PARSING).is_ok() { Some(self.ty()?.into()) } else {