diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-11 08:34:22 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-11 08:34:22 +0300 |
| commit | abda8d00117072f7c03f57eaeca9cf44427078dc (patch) | |
| tree | a7caf8c91932ce195398dbd63758a057720366a1 /compiler/src/ast/error.rs | |
| parent | 7163aaebc993591db1cb4d7ae2be31669a0cb9a7 (diff) | |
| download | crisp-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.rs | 11 |
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 | } |
