diff --git a/Ast/src/Parser.cpp b/Ast/src/Parser.cpp index b7ef27ed..7e10eb0a 100644 --- a/Ast/src/Parser.cpp +++ b/Ast/src/Parser.cpp @@ -2778,8 +2778,10 @@ AstExpr* Parser::parseInterpString() case Lexeme::InterpStringEnd: break; case Lexeme::BrokenInterpDoubleBrace: + nextLexeme(); return reportExprError(location, {}, ERROR_INVALID_INTERP_DOUBLE_BRACE); case Lexeme::BrokenString: + nextLexeme(); return reportExprError(location, {}, "Malformed interpolated string, did you forget to add a '}'?"); default: return reportExprError(location, {}, "Malformed interpolated string, got %s", lexer.current().toString().c_str()); diff --git a/tests/Parser.test.cpp b/tests/Parser.test.cpp index b6c096ed..5d85fe34 100644 --- a/tests/Parser.test.cpp +++ b/tests/Parser.test.cpp @@ -953,6 +953,8 @@ TEST_CASE_FIXTURE(Fixture, "parse_interpolated_string_without_end_brace") } catch (const ParseErrors& e) { + CHECK_EQ(e.getErrors().size(), 1); + auto error = e.getErrors().front(); CHECK_EQ("Malformed interpolated string, did you forget to add a '}'?", error.getMessage()); return error.getLocation().begin.column;