@@ -19,9 +19,7 @@ LUAU_FASTINTVARIABLE(LuauParseErrorLimit, 100)
1919// See docs/SyntaxChanges.md for an explanation.
2020LUAU_FASTFLAGVARIABLE (LuauSolverV2)
2121LUAU_DYNAMIC_FASTFLAGVARIABLE (DebugLuauReportReturnTypeVariadicWithTypeSuffix, false )
22- LUAU_FASTFLAGVARIABLE (DebugLuauStringSingletonBasedOnQuotes)
23- LUAU_FASTFLAGVARIABLE (LuauExplicitTypeExpressionInstantiation)
24- LUAU_FASTFLAGVARIABLE (LuauAutocompleteAttributes)
22+ LUAU_FASTFLAGVARIABLE (LuauExplicitTypeInstantiationSyntax)
2523LUAU_FASTFLAG (LuauStandaloneParseType)
2624LUAU_FASTFLAGVARIABLE (LuauCstStatDoWithStatsStart)
2725
@@ -951,15 +949,7 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
951949
952950 nextLexeme ();
953951
954- if (FFlag::LuauAutocompleteAttributes)
955- {
956- attributes.push_back (allocator.alloc <AstAttr>(loc, type.value_or (AstAttr::Type::Unknown), empty, AstName (name)));
957- }
958- else
959- {
960- if (type)
961- attributes.push_back (allocator.alloc <AstAttr>(loc, *type, empty));
962- }
952+ attributes.push_back (allocator.alloc <AstAttr>(loc, type.value_or (AstAttr::Type::Unknown), empty, AstName (name)));
963953 }
964954 else
965955 {
@@ -989,30 +979,14 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
989979
990980 std::optional<AstAttr::Type> type = validateAttribute (nameLoc, attrName, attributes, args);
991981
992- if (FFlag::LuauAutocompleteAttributes)
993- {
994- attributes.push_back (
995- allocator.alloc <AstAttr>(Location (nameLoc, argsLocation), type.value_or (AstAttr::Type::Unknown), args, AstName (attrName))
996- );
997- }
998- else
999- {
1000- if (type)
1001- attributes.push_back (allocator.alloc <AstAttr>(Location (nameLoc, argsLocation), *type, args));
1002- }
982+ attributes.push_back (
983+ allocator.alloc <AstAttr>(Location (nameLoc, argsLocation), type.value_or (AstAttr::Type::Unknown), args, AstName (attrName))
984+ );
1003985 }
1004986 else
1005987 {
1006988 std::optional<AstAttr::Type> type = validateAttribute (nameLoc, attrName, attributes, empty);
1007- if (FFlag::LuauAutocompleteAttributes)
1008- {
1009- attributes.push_back (allocator.alloc <AstAttr>(nameLoc, type.value_or (AstAttr::Type::Unknown), empty, AstName (attrName)));
1010- }
1011- else
1012- {
1013- if (type)
1014- attributes.push_back (allocator.alloc <AstAttr>(nameLoc, *type, empty));
1015- }
989+ attributes.push_back (allocator.alloc <AstAttr>(nameLoc, type.value_or (AstAttr::Type::Unknown), empty, AstName (attrName)));
1016990 }
1017991
1018992 if (lexer.current ().type == ' ,' )
@@ -1029,13 +1003,10 @@ void Parser::parseAttribute(TempVector<AstAttr*>& attributes)
10291003 {
10301004 report (Location (open.location , lexer.current ().location ), " Attribute list cannot be empty" );
10311005
1032- if (FFlag::LuauAutocompleteAttributes)
1033- {
1034- // autocomplete expects at least one unknown attribute.
1035- attributes.push_back (
1036- allocator.alloc <AstAttr>(Location (open.location , lexer.current ().location ), AstAttr::Type::Unknown, empty, nameError)
1037- );
1038- }
1006+ // autocomplete expects at least one unknown attribute.
1007+ attributes.push_back (
1008+ allocator.alloc <AstAttr>(Location (open.location , lexer.current ().location ), AstAttr::Type::Unknown, empty, nameError)
1009+ );
10391010 }
10401011
10411012 expectMatchAndConsume (' ]' , open);
@@ -3115,7 +3086,7 @@ AstExpr* Parser::parsePrimaryExpr(bool asStatement)
31153086 {
31163087 expr = parseFunctionArgs (expr, false );
31173088 }
3118- else if (FFlag::LuauExplicitTypeExpressionInstantiation && lexer.current ().type == ' <' && lexer.lookahead ().type == ' <' )
3089+ else if (FFlag::LuauExplicitTypeInstantiationSyntax && lexer.current ().type == ' <' && lexer.lookahead ().type == ' <' )
31193090 {
31203091 expr = parseExplicitTypeInstantiationExpr (start, *expr);
31213092 }
@@ -3141,7 +3112,7 @@ AstExpr* Parser::parseMethodCall(Position start, AstExpr* expr)
31413112 Name index = parseIndexName (" method name" , opPosition);
31423113 AstExpr* func = allocator.alloc <AstExprIndexName>(Location (start, index.location .end ), expr, index.name , index.location , opPosition, ' :' );
31433114
3144- if (FFlag::LuauExplicitTypeExpressionInstantiation )
3115+ if (FFlag::LuauExplicitTypeInstantiationSyntax )
31453116 {
31463117 AstArray<AstTypeOrPack> typeArguments;
31473118 CstTypeInstantiation* cstTypeArguments = options.storeCstData ? allocator.alloc <CstTypeInstantiation>() : nullptr ;
@@ -3949,38 +3920,17 @@ AstExpr* Parser::parseString()
39493920 Location location = lexer.current ().location ;
39503921
39513922 AstExprConstantString::QuoteStyle style;
3952- if (FFlag::DebugLuauStringSingletonBasedOnQuotes)
3953- {
3954- switch (lexer.current ().type )
3955- {
3956- case Lexeme::InterpStringSimple:
3957- style = AstExprConstantString::QuotedSimple;
3958- break ;
3959- case Lexeme::RawString:
3960- style = AstExprConstantString::QuotedRaw;
3961- break ;
3962- case Lexeme::QuotedString:
3963- style = lexer.current ().getQuoteStyle () == Lexeme::QuoteStyle::Single ? AstExprConstantString::QuotedSingle
3964- : AstExprConstantString::QuotedSimple;
3965- break ;
3966- default :
3967- LUAU_ASSERT (false && " Invalid string type" );
3968- }
3969- }
3970- else
3923+ switch (lexer.current ().type )
39713924 {
3972- switch (lexer.current ().type )
3973- {
3974- case Lexeme::QuotedString:
3975- case Lexeme::InterpStringSimple:
3976- style = AstExprConstantString::QuotedSimple;
3977- break ;
3978- case Lexeme::RawString:
3979- style = AstExprConstantString::QuotedRaw;
3980- break ;
3981- default :
3982- LUAU_ASSERT (false && " Invalid string type" );
3983- }
3925+ case Lexeme::QuotedString:
3926+ case Lexeme::InterpStringSimple:
3927+ style = AstExprConstantString::QuotedSimple;
3928+ break ;
3929+ case Lexeme::RawString:
3930+ style = AstExprConstantString::QuotedRaw;
3931+ break ;
3932+ default :
3933+ LUAU_ASSERT (false && " Invalid string type" );
39843934 }
39853935
39863936 CstExprConstantString::QuoteStyle fullStyle;
@@ -4142,7 +4092,7 @@ LUAU_NOINLINE AstExpr* Parser::parseExplicitTypeInstantiationExpr(Position start
41424092
41434093AstArray<AstTypeOrPack> Parser::parseTypeInstantiationExpr (CstTypeInstantiation* cstNodeOut, Location* endLocationOut)
41444094{
4145- LUAU_ASSERT (FFlag::LuauExplicitTypeExpressionInstantiation );
4095+ LUAU_ASSERT (FFlag::LuauExplicitTypeInstantiationSyntax );
41464096
41474097 LUAU_ASSERT (lexer.current ().type == ' <' && lexer.lookahead ().type == ' <' );
41484098
0 commit comments