Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jackparsonss committed Jun 28, 2024
1 parent 01e0bb9 commit 2089765
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/errors/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ DEF_COMPILE_TIME_EXCEPTION(MainError);

DEF_COMPILE_TIME_EXCEPTION(SymbolError);

DEF_COMPILE_TIME_EXCEPTION(LexerError);

DEF_COMPILE_TIME_EXCEPTION(SyntaxError);

DEF_COMPILE_TIME_EXCEPTION(TypeError);
Expand Down
2 changes: 1 addition & 1 deletion src/errors/syntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void LexerErrorListener::syntaxError(antlr4::Recognizer* recognizer,
size_t char_position_in_line,
const std::string& msg,
std::exception_ptr e) {
throw SyntaxError(line, msg);
throw LexerError(line, msg);
}

void underline_error(antlr4::Recognizer* recognizer,
Expand Down
7 changes: 3 additions & 4 deletions tests/input/function/return.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
fn foo(): i32 {
return 90;
fn foo(let x: i32): i32 {
return x;
}

fn main(): i32 {
print(foo())

println(foo(90));
return 0;
}
2 changes: 1 addition & 1 deletion tests/output/function/return.out
Original file line number Diff line number Diff line change
@@ -1 +1 @@
90
90

0 comments on commit 2089765

Please sign in to comment.