Skip to content

Commit dc1102e

Browse files
committed
Bump Luau to 0.671
1 parent fbfdd28 commit dc1102e

File tree

16 files changed

+1051
-163
lines changed

16 files changed

+1051
-163
lines changed

luau/Ast/include/Luau/Ast.h

Lines changed: 87 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,25 @@ class AstExprFunction : public AstExpr
446446
AstStatBlock* body,
447447
size_t functionDepth,
448448
const AstName& debugname,
449-
const std::optional<AstTypeList>& returnAnnotation = {},
449+
AstTypePack* returnAnnotation,
450+
AstTypePack* varargAnnotation = nullptr,
451+
const std::optional<Location>& argLocation = std::nullopt
452+
);
453+
454+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
455+
AstExprFunction(
456+
const Location& location,
457+
const AstArray<AstAttr*>& attributes,
458+
const AstArray<AstGenericType*>& generics,
459+
const AstArray<AstGenericTypePack*>& genericPacks,
460+
AstLocal* self,
461+
const AstArray<AstLocal*>& args,
462+
bool vararg,
463+
const Location& varargLocation,
464+
AstStatBlock* body,
465+
size_t functionDepth,
466+
const AstName& debugname,
467+
const std::optional<AstTypeList>& returnAnnotation,
450468
AstTypePack* varargAnnotation = nullptr,
451469
const std::optional<Location>& argLocation = std::nullopt
452470
);
@@ -461,7 +479,9 @@ class AstExprFunction : public AstExpr
461479
AstArray<AstGenericTypePack*> genericPacks;
462480
AstLocal* self;
463481
AstArray<AstLocal*> args;
464-
std::optional<AstTypeList> returnAnnotation;
482+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
483+
std::optional<AstTypeList> returnAnnotation_DEPRECATED;
484+
AstTypePack* returnAnnotation = nullptr;
465485
bool vararg = false;
466486
Location varargLocation;
467487
AstTypePack* varargAnnotation;
@@ -929,6 +949,36 @@ class AstStatDeclareFunction : public AstStat
929949
public:
930950
LUAU_RTTI(AstStatDeclareFunction)
931951

952+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
953+
AstStatDeclareFunction(
954+
const Location& location,
955+
const AstName& name,
956+
const Location& nameLocation,
957+
const AstArray<AstGenericType*>& generics,
958+
const AstArray<AstGenericTypePack*>& genericPacks,
959+
const AstTypeList& params,
960+
const AstArray<AstArgumentName>& paramNames,
961+
bool vararg,
962+
const Location& varargLocation,
963+
AstTypePack* retTypes
964+
);
965+
966+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
967+
AstStatDeclareFunction(
968+
const Location& location,
969+
const AstArray<AstAttr*>& attributes,
970+
const AstName& name,
971+
const Location& nameLocation,
972+
const AstArray<AstGenericType*>& generics,
973+
const AstArray<AstGenericTypePack*>& genericPacks,
974+
const AstTypeList& params,
975+
const AstArray<AstArgumentName>& paramNames,
976+
bool vararg,
977+
const Location& varargLocation,
978+
AstTypePack* retTypes
979+
);
980+
981+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
932982
AstStatDeclareFunction(
933983
const Location& location,
934984
const AstName& name,
@@ -942,6 +992,7 @@ class AstStatDeclareFunction : public AstStat
942992
const AstTypeList& retTypes
943993
);
944994

995+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
945996
AstStatDeclareFunction(
946997
const Location& location,
947998
const AstArray<AstAttr*>& attributes,
@@ -971,10 +1022,12 @@ class AstStatDeclareFunction : public AstStat
9711022
AstArray<AstArgumentName> paramNames;
9721023
bool vararg = false;
9731024
Location varargLocation;
974-
AstTypeList retTypes;
1025+
AstTypePack* retTypes;
1026+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1027+
AstTypeList retTypes_DEPRECATED;
9751028
};
9761029

977-
struct AstDeclaredClassProp
1030+
struct AstDeclaredExternTypeProperty
9781031
{
9791032
AstName name;
9801033
Location nameLocation;
@@ -1000,16 +1053,16 @@ struct AstTableIndexer
10001053
std::optional<Location> accessLocation;
10011054
};
10021055

1003-
class AstStatDeclareClass : public AstStat
1056+
class AstStatDeclareExternType : public AstStat
10041057
{
10051058
public:
1006-
LUAU_RTTI(AstStatDeclareClass)
1059+
LUAU_RTTI(AstStatDeclareExternType)
10071060

1008-
AstStatDeclareClass(
1061+
AstStatDeclareExternType(
10091062
const Location& location,
10101063
const AstName& name,
10111064
std::optional<AstName> superName,
1012-
const AstArray<AstDeclaredClassProp>& props,
1065+
const AstArray<AstDeclaredExternTypeProperty>& props,
10131066
AstTableIndexer* indexer = nullptr
10141067
);
10151068

@@ -1018,7 +1071,7 @@ class AstStatDeclareClass : public AstStat
10181071
AstName name;
10191072
std::optional<AstName> superName;
10201073

1021-
AstArray<AstDeclaredClassProp> props;
1074+
AstArray<AstDeclaredExternTypeProperty> props;
10221075
AstTableIndexer* indexer;
10231076
};
10241077

@@ -1095,6 +1148,26 @@ class AstTypeFunction : public AstType
10951148
public:
10961149
LUAU_RTTI(AstTypeFunction)
10971150

1151+
AstTypeFunction(
1152+
const Location& location,
1153+
const AstArray<AstGenericType*>& generics,
1154+
const AstArray<AstGenericTypePack*>& genericPacks,
1155+
const AstTypeList& argTypes,
1156+
const AstArray<std::optional<AstArgumentName>>& argNames,
1157+
AstTypePack* returnTypes
1158+
);
1159+
1160+
AstTypeFunction(
1161+
const Location& location,
1162+
const AstArray<AstAttr*>& attributes,
1163+
const AstArray<AstGenericType*>& generics,
1164+
const AstArray<AstGenericTypePack*>& genericPacks,
1165+
const AstTypeList& argTypes,
1166+
const AstArray<std::optional<AstArgumentName>>& argNames,
1167+
AstTypePack* returnTypes
1168+
);
1169+
1170+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
10981171
AstTypeFunction(
10991172
const Location& location,
11001173
const AstArray<AstGenericType*>& generics,
@@ -1104,6 +1177,7 @@ class AstTypeFunction : public AstType
11041177
const AstTypeList& returnTypes
11051178
);
11061179

1180+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
11071181
AstTypeFunction(
11081182
const Location& location,
11091183
const AstArray<AstAttr*>& attributes,
@@ -1124,7 +1198,9 @@ class AstTypeFunction : public AstType
11241198
AstArray<AstGenericTypePack*> genericPacks;
11251199
AstTypeList argTypes;
11261200
AstArray<std::optional<AstArgumentName>> argNames;
1127-
AstTypeList returnTypes;
1201+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
1202+
AstTypeList returnTypes_DEPRECATED;
1203+
AstTypePack* returnTypes;
11281204
};
11291205

11301206
class AstTypeTypeof : public AstType
@@ -1483,7 +1559,7 @@ class AstVisitor
14831559
{
14841560
return visit(static_cast<AstStat*>(node));
14851561
}
1486-
virtual bool visit(class AstStatDeclareClass* node)
1562+
virtual bool visit(class AstStatDeclareExternType* node)
14871563
{
14881564
return visit(static_cast<AstStat*>(node));
14891565
}

luau/Ast/include/Luau/Cst.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,10 @@ class CstTypePackExplicit : public CstNode
473473
public:
474474
LUAU_CST_RTTI(CstTypePackExplicit)
475475

476-
CstTypePackExplicit(Position openParenthesesPosition, Position closeParenthesesPosition, AstArray<Position> commaPositions);
476+
explicit CstTypePackExplicit();
477+
explicit CstTypePackExplicit(Position openParenthesesPosition, Position closeParenthesesPosition, AstArray<Position> commaPositions);
477478

479+
bool hasParentheses;
478480
Position openParenthesesPosition;
479481
Position closeParenthesesPosition;
480482
AstArray<Position> commaPositions;

luau/Ast/include/Luau/Parser.h

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ class Parser
157157
// type function Name ... end
158158
AstStat* parseTypeFunction(const Location& start, bool exported, Position typeKeywordPosition);
159159

160-
AstDeclaredClassProp parseDeclaredClassMethod(const AstArray<AstAttr*>& attributes);
161-
AstDeclaredClassProp parseDeclaredClassMethod_DEPRECATED();
160+
AstDeclaredExternTypeProperty parseDeclaredExternTypeMethod(const AstArray<AstAttr*>& attributes);
161+
AstDeclaredExternTypeProperty parseDeclaredExternTypeMethod_DEPRECATED();
162162

163163

164164
// `declare global' Name: Type |
@@ -182,6 +182,14 @@ class Parser
182182
const Name* localName,
183183
const AstArray<AstAttr*>& attributes
184184
);
185+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
186+
std::pair<AstExprFunction*, AstLocal*> parseFunctionBody_DEPRECATED(
187+
bool hasself,
188+
const Lexeme& matchFunction,
189+
const AstName& debugname,
190+
const Name* localName,
191+
const AstArray<AstAttr*>& attributes
192+
);
185193

186194
// explist ::= {exp `,'} exp
187195
void parseExprList(TempVector<AstExpr*>& result, TempVector<Position>* commaPositions = nullptr);
@@ -219,8 +227,12 @@ class Parser
219227
TempVector<std::optional<Position>>* nameColonPositions = nullptr
220228
);
221229

222-
std::optional<AstTypeList> parseOptionalReturnType(Position* returnSpecifierPosition = nullptr);
223-
std::pair<Location, AstTypeList> parseReturnType();
230+
AstTypePack* parseOptionalReturnType(Position* returnSpecifierPosition = nullptr);
231+
AstTypePack* parseReturnType();
232+
233+
// Clip with FFlagLuauStoreReturnTypesAsPackOnAst
234+
std::optional<AstTypeList> parseOptionalReturnType_DEPRECATED(Position* returnSpecifierPosition = nullptr);
235+
std::pair<Location, AstTypeList> parseReturnType_DEPRECATED();
224236

225237
struct TableIndexerResult
226238
{
@@ -491,7 +503,7 @@ class Parser
491503
std::vector<CstTypeTable::Item> scratchCstTableTypeProps;
492504
std::vector<AstType*> scratchType;
493505
std::vector<AstTypeOrPack> scratchTypeOrPack;
494-
std::vector<AstDeclaredClassProp> scratchDeclaredClassProps;
506+
std::vector<AstDeclaredExternTypeProperty> scratchDeclaredClassProps;
495507
std::vector<AstExprTable::Item> scratchItem;
496508
std::vector<CstExprTable::Item> scratchCstItem;
497509
std::vector<AstArgumentName> scratchArgName;

0 commit comments

Comments
 (0)