aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/ast/error.rs
diff options
context:
space:
mode:
authorTolmachev Igor <me@igorek.dev>2026-05-11 08:34:22 +0300
committerTolmachev Igor <me@igorek.dev>2026-05-11 08:34:22 +0300
commitabda8d00117072f7c03f57eaeca9cf44427078dc (patch)
treea7caf8c91932ce195398dbd63758a057720366a1 /compiler/src/ast/error.rs
parent7163aaebc993591db1cb4d7ae2be31669a0cb9a7 (diff)
downloadcrisp-abda8d00117072f7c03f57eaeca9cf44427078dc.tar.gz
crisp-abda8d00117072f7c03f57eaeca9cf44427078dc.zip
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.
Diffstat (limited to 'compiler/src/ast/error.rs')
-rw-r--r--compiler/src/ast/error.rs11
1 files changed, 7 insertions, 4 deletions
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 {
10 UnexpectedEscapeChar(char), 10 UnexpectedEscapeChar(char),
11 11
12 // Par 12 // Par
13 UnexpectedRightPar, 13 UnexpectedClosePar,
14 UnclosedLeftPar, 14 UnclosedPar,
15
16 UnexpectedToken,
15 17
16 UnexpectedEof, 18 UnexpectedEof,
17 19
@@ -26,8 +28,9 @@ impl fmt::Display for Error {
26 } 28 }
27 Error::UnclosedString(string) => write!(f, "unclosed string {string:?}"), 29 Error::UnclosedString(string) => write!(f, "unclosed string {string:?}"),
28 Error::UnexpectedEscapeChar(ch) => write!(f, "unexpected escape char {ch:?}"), 30 Error::UnexpectedEscapeChar(ch) => write!(f, "unexpected escape char {ch:?}"),
29 Error::UnexpectedRightPar => write!(f, "unexpected right par"), 31 Error::UnexpectedClosePar => write!(f, "unexpected `)`"),
30 Error::UnclosedLeftPar => write!(f, "unclosed left par"), 32 Error::UnclosedPar => write!(f, "unclosed `(`"),
33 Error::UnexpectedToken => write!(f, "unexpected token"),
31 Error::UnexpectedEof => write!(f, "unexpected eof"), 34 Error::UnexpectedEof => write!(f, "unexpected eof"),
32 Error::RecursionLimit => write!(f, "recursion limit"), 35 Error::RecursionLimit => write!(f, "recursion limit"),
33 } 36 }