@@ -338,6 +338,7 @@ enum class ConstantNumberParseResult
338338 Malformed,
339339 BinOverflow,
340340 HexOverflow,
341+ IntOverflow,
341342};
342343
343344class AstExprConstantNumber : public AstExpr
@@ -353,6 +354,18 @@ class AstExprConstantNumber : public AstExpr
353354 ConstantNumberParseResult parseResult;
354355};
355356
357+ class AstExprConstantInteger : public AstExpr
358+ {
359+ public:
360+ LUAU_RTTI (AstExprConstantInteger)
361+
362+ AstExprConstantInteger (const Location& location, int64_t value, ConstantNumberParseResult parseResult = ConstantNumberParseResult::Ok);
363+
364+ void visit (AstVisitor* visitor) override ;
365+
366+ int64_t value;
367+ ConstantNumberParseResult parseResult;
368+ };
356369class AstExprConstantString : public AstExpr
357370{
358371public:
@@ -819,13 +832,15 @@ class AstStatLocal : public AstStat
819832 const Location& location,
820833 const AstArray<AstLocal*>& vars,
821834 const AstArray<AstExpr*>& values,
822- const std::optional<Location>& equalsSignLocation
835+ const std::optional<Location>& equalsSignLocation,
836+ bool isConst = false
823837 );
824838
825839 void visit (AstVisitor* visitor) override ;
826840
827841 AstArray<AstLocal*> vars;
828842 AstArray<AstExpr*> values;
843+ bool isConst;
829844
830845 std::optional<Location> equalsSignLocation;
831846};
@@ -932,12 +947,13 @@ class AstStatLocalFunction : public AstStat
932947public:
933948 LUAU_RTTI (AstStatLocalFunction)
934949
935- AstStatLocalFunction (const Location& location, AstLocal* name, AstExprFunction* func);
950+ AstStatLocalFunction (const Location& location, AstLocal* name, AstExprFunction* func, bool isConst = false );
936951
937952 void visit (AstVisitor* visitor) override ;
938953
939954 AstLocal* name;
940955 AstExprFunction* func;
956+ bool isConst;
941957};
942958
943959class AstStatTypeAlias : public AstStat
@@ -1052,20 +1068,21 @@ class AstStatDeclareFunction : public AstStat
10521068 AstTypePack* retTypes;
10531069};
10541070
1071+ enum class AstTableAccess
1072+ {
1073+ Read = 0b01 ,
1074+ Write = 0b10 ,
1075+ ReadWrite = 0b11 ,
1076+ };
1077+
10551078struct AstDeclaredExternTypeProperty
10561079{
10571080 AstName name;
10581081 Location nameLocation;
10591082 AstType* ty = nullptr ;
10601083 bool isMethod = false ;
10611084 Location location;
1062- };
1063-
1064- enum class AstTableAccess
1065- {
1066- Read = 0b01 ,
1067- Write = 0b10 ,
1068- ReadWrite = 0b11 ,
1085+ AstTableAccess access = AstTableAccess::ReadWrite;
10691086};
10701087
10711088struct AstTableIndexer
@@ -1413,6 +1430,10 @@ class AstVisitor
14131430 {
14141431 return visit (static_cast <AstExpr*>(node));
14151432 }
1433+ virtual bool visit (class AstExprConstantInteger * node)
1434+ {
1435+ return visit (static_cast <AstExpr*>(node));
1436+ }
14161437 virtual bool visit (class AstExprConstantString * node)
14171438 {
14181439 return visit (static_cast <AstExpr*>(node));
0 commit comments