Skip to content

Commit

Permalink
Migrate analysis errors to dedicated fns
Browse files Browse the repository at this point in the history
  • Loading branch information
jeaye committed Feb 13, 2025
1 parent 71565a1 commit 8fa87ab
Show file tree
Hide file tree
Showing 6 changed files with 277 additions and 163 deletions.
1 change: 1 addition & 0 deletions compiler+runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ add_library(
src/cpp/jank/error/report.cpp
src/cpp/jank/error/lex.cpp
src/cpp/jank/error/parse.cpp
src/cpp/jank/error/analyze.cpp
src/cpp/jank/read/source.cpp
src/cpp/jank/read/lex.cpp
src/cpp/jank/read/parse.cpp
Expand Down
41 changes: 41 additions & 0 deletions compiler+runtime/include/cpp/jank/error/analyze.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#pragma once

#include <jank/error.hpp>
#include <jank/read/lex.hpp>

namespace jank::error
{
error_ptr
analysis_invalid_def(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_fn(native_persistent_string const &message, read::source const &source);
error_ptr analysis_invalid_fn_parameters(native_persistent_string const &message,
read::source const &source);
error_ptr analysis_invalid_recur_position(native_persistent_string const &message,
read::source const &source);
error_ptr analysis_invalid_recur_from_try(native_persistent_string const &message,
read::source const &source);
error_ptr
analysis_invalid_recur_args(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_let(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_loop(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_if(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_quote(native_persistent_string const &message, read::source const &source);
error_ptr analysis_invalid_var_reference(native_persistent_string const &message,
read::source const &source);
error_ptr
analysis_invalid_throw(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_invalid_try(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_unresolved_var(native_persistent_string const &message, read::source const &source);
error_ptr
analysis_unresolved_symbol(native_persistent_string const &message, read::source const &source);
error_ptr internal_analysis_failure(native_persistent_string const &message);
error_ptr
internal_analysis_failure(native_persistent_string const &message, read::source const &source);
}
Loading

0 comments on commit 8fa87ab

Please sign in to comment.