mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Remove support for f arg
for now, RFC update incoming
This commit is contained in:
parent
1be19b5248
commit
fcc5ca1cf1
3 changed files with 18 additions and 22 deletions
|
@ -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<AstExprCall>(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<AstExprCall>(Location(func->location, expr->location), func, copy(&expr, 1), self, Location(argStart, argEnd));
|
||||
}
|
||||
else
|
||||
{
|
||||
return reportFunctionArgsError(func, self);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue