diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-09 18:06:25 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-09 18:06:25 +0300 |
| commit | c628391e10c6db7ca8b979e20d5b09ac92251c96 (patch) | |
| tree | 508084a57b7d916b2140583bdb11c2b9526b682c /compiler/src/ast/error.rs | |
| parent | bf89132011e906384591bc85dead16d64a150a02 (diff) | |
| download | crisp-c628391e10c6db7ca8b979e20d5b09ac92251c96.tar.gz crisp-c628391e10c6db7ca8b979e20d5b09ac92251c96.zip | |
Add RecursionLimit parser error
Returns error after 256 levels of nesting to avoid stack overflow. The limit is hardcoded now, but
will become a compiler flag later.
Diffstat (limited to 'compiler/src/ast/error.rs')
| -rw-r--r-- | compiler/src/ast/error.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/ast/error.rs b/compiler/src/ast/error.rs index ced2231..21102ea 100644 --- a/compiler/src/ast/error.rs +++ b/compiler/src/ast/error.rs | |||
| @@ -19,6 +19,8 @@ pub enum Error { | |||
| 19 | UnclosedLeftPar, | 19 | UnclosedLeftPar, |
| 20 | 20 | ||
| 21 | UnexpectedEof, | 21 | UnexpectedEof, |
| 22 | |||
| 23 | RecursionLimit, | ||
| 22 | } | 24 | } |
| 23 | 25 | ||
| 24 | impl From<ParseFloatError> for Error { | 26 | impl From<ParseFloatError> for Error { |
