diff --git a/Ast/src/Parser.cpp b/Ast/src/Parser.cpp index 621b0374..668c2a5e 100644 --- a/Ast/src/Parser.cpp +++ b/Ast/src/Parser.cpp @@ -2004,13 +2004,7 @@ AstExpr* Parser::parsePrimaryExpr(bool asStatement) expr = parseFunctionArgs(expr, false); } - else if ( - lexer.current().type == '{' - || lexer.current().type == Lexeme::RawString - || lexer.current().type == Lexeme::QuotedString - || lexer.current().type == Lexeme::InterpStringBegin - || lexer.current().type == Lexeme::InterpStringSimple - ) + else if (lexer.current().type == '{' || lexer.current().type == Lexeme::RawString || lexer.current().type == Lexeme::QuotedString) { expr = parseFunctionArgs(expr, false); } @@ -2317,14 +2311,6 @@ AstExpr* Parser::parseFunctionArgs(AstExpr* func, bool self) return allocator.alloc(Location(func->location, expr->location), func, copy(&expr, 1), self, argLocation); } - else if (FFlag::LuauInterpolatedStringBaseSupport && (lexer.current().type == Lexeme::InterpStringBegin || lexer.current().type == Lexeme::InterpStringSimple)) - { - Position argStart = lexer.current().location.end; - AstExpr* expr = parseInterpString(); - Position argEnd = lexer.previousLocation().end; - - return allocator.alloc(Location(func->location, expr->location), func, copy(&expr, 1), self, Location(argStart, argEnd)); - } else { return reportFunctionArgsError(func, self); diff --git a/tests/Parser.test.cpp b/tests/Parser.test.cpp index d81989da..2dd47708 100644 --- a/tests/Parser.test.cpp +++ b/tests/Parser.test.cpp @@ -1028,6 +1028,23 @@ TEST_CASE_FIXTURE(Fixture, "parse_interpolated_string_as_type_fail") } } +TEST_CASE_FIXTURE(Fixture, "parse_interpolated_string_call_without_parens") +{ + ScopedFastFlag sff{"LuauInterpolatedStringBaseSupport", true}; + + try + { + parse(R"( + _ = print `{42}` + )"); + FAIL("Expected ParseErrors to be thrown"); + } + catch (const ParseErrors& e) + { + CHECK_EQ("Expected identifier when parsing expression, got `{", e.getErrors().front().getMessage()); + } +} + TEST_CASE_FIXTURE(Fixture, "parse_nesting_based_end_detection") { try diff --git a/tests/conformance/stringinterp.lua b/tests/conformance/stringinterp.lua index 539505f4..efb25bae 100644 --- a/tests/conformance/stringinterp.lua +++ b/tests/conformance/stringinterp.lua @@ -54,13 +54,6 @@ end assertEq(shadowsString("hello"), "Value is hello") assertEq(shadowsString(1), "Value is 1") -local function identity(x) - return x -end - -assertEq(identity`text`, "text") -assertEq(identity`foo{"bar"}`, "foobar") - assertEq(`\u{0041}\t`, "A\t") return "OK"