From abda8d00117072f7c03f57eaeca9cf44427078dc Mon Sep 17 00:00:00 2001 From: Tolmachev Igor Date: Mon, 11 May 2026 08:34:22 +0300 Subject: Replace generic list AST with typed expression tree Each form (fn, let, for, set, do, call) now has its own variant with named fields instead of being a plain list. --- compiler/src/ast/error.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'compiler/src/ast/error.rs') diff --git a/compiler/src/ast/error.rs b/compiler/src/ast/error.rs index 38b3916..5598376 100644 --- a/compiler/src/ast/error.rs +++ b/compiler/src/ast/error.rs @@ -10,8 +10,10 @@ pub enum Error { UnexpectedEscapeChar(char), // Par - UnexpectedRightPar, - UnclosedLeftPar, + UnexpectedClosePar, + UnclosedPar, + + UnexpectedToken, UnexpectedEof, @@ -26,8 +28,9 @@ impl fmt::Display for Error { } Error::UnclosedString(string) => write!(f, "unclosed string {string:?}"), Error::UnexpectedEscapeChar(ch) => write!(f, "unexpected escape char {ch:?}"), - Error::UnexpectedRightPar => write!(f, "unexpected right par"), - Error::UnclosedLeftPar => write!(f, "unclosed left par"), + Error::UnexpectedClosePar => write!(f, "unexpected `)`"), + Error::UnclosedPar => write!(f, "unclosed `(`"), + Error::UnexpectedToken => write!(f, "unexpected token"), Error::UnexpectedEof => write!(f, "unexpected eof"), Error::RecursionLimit => write!(f, "recursion limit"), } -- cgit v1.3