mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Only get one error rather than two
This commit is contained in:
parent
3b26ab85a0
commit
83dad7bdf3
2 changed files with 4 additions and 0 deletions
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue