Skip to content

Commit be42e0f

Browse files
committed
v0.12.1+luau658
1 parent df982e2 commit be42e0f

File tree

8 files changed

+46
-8
lines changed

8 files changed

+46
-8
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "luau0-src"
3-
version = "0.12.0+luau657"
3+
version = "0.12.1+luau658"
44
authors = ["Aleksandr Orlenko <[email protected]>"]
55
edition = "2021"
66
repository = "https://github.com/khvzak/luau-src-rs"

luau/Ast/src/Parser.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ LUAU_FASTFLAGVARIABLE(LuauAllowComplexTypesInGenericParams)
2323
LUAU_FASTFLAGVARIABLE(LuauErrorRecoveryForTableTypes)
2424
LUAU_FASTFLAGVARIABLE(LuauErrorRecoveryForClassNames)
2525
LUAU_FASTFLAGVARIABLE(LuauFixFunctionNameStartPosition)
26+
LUAU_FASTFLAGVARIABLE(LuauExtendStatEndPosWithSemicolon)
2627

2728
namespace Luau
2829
{
@@ -288,6 +289,10 @@ AstStatBlock* Parser::parseBlockNoScope()
288289
{
289290
nextLexeme();
290291
stat->hasSemicolon = true;
292+
if (FFlag::LuauExtendStatEndPosWithSemicolon)
293+
{
294+
stat->location.end = lexer.previousLocation().end;
295+
}
291296
}
292297

293298
body.push_back(stat);

luau/Common/include/Luau/ExperimentalFlags.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ inline bool isFlagExperimental(const char* flag)
1414
"LuauInstantiateInSubtyping", // requires some fixes to lua-apps code
1515
"LuauFixIndexerSubtypingOrdering", // requires some small fixes to lua-apps code since this fixes a false negative
1616
"StudioReportLuauAny2", // takes telemetry data for usage of any types
17+
"LuauTableCloneClonesType", // requires fixes in lua-apps code, terrifyingly
1718
"LuauSolverV2",
1819
// makes sure we always have at least one entry
1920
nullptr,

luau/VM/include/lua.h

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ LUA_API const float* lua_tovector(lua_State* L, int idx);
154154
LUA_API int lua_toboolean(lua_State* L, int idx);
155155
LUA_API const char* lua_tolstring(lua_State* L, int idx, size_t* len);
156156
LUA_API const char* lua_tostringatom(lua_State* L, int idx, int* atom);
157+
LUA_API const char* lua_tolstringatom(lua_State* L, int idx, size_t* len, int* atom);
157158
LUA_API const char* lua_namecallatom(lua_State* L, int* atom);
158159
LUA_API int lua_objlen(lua_State* L, int idx);
159160
LUA_API lua_CFunction lua_tocfunction(lua_State* L, int idx);

luau/VM/src/lapi.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,29 @@ const char* lua_tostringatom(lua_State* L, int idx, int* atom)
454454
return getstr(s);
455455
}
456456

457+
const char* lua_tolstringatom(lua_State* L, int idx, size_t* len, int* atom)
458+
{
459+
StkId o = index2addr(L, idx);
460+
461+
if (!ttisstring(o))
462+
{
463+
if (len)
464+
*len = 0;
465+
return NULL;
466+
}
467+
468+
TString* s = tsvalue(o);
469+
if (len)
470+
*len = s->len;
471+
if (atom)
472+
{
473+
updateatom(L, s);
474+
*atom = s->atom;
475+
}
476+
477+
return getstr(s);
478+
}
479+
457480
const char* lua_namecallatom(lua_State* L, int* atom)
458481
{
459482
TString* s = L->namecall;

luau/VM/src/ldebug.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,20 @@ int luaG_isnative(lua_State* L, int level)
422422
return (ci->flags & LUA_CALLINFO_NATIVE) != 0 ? 1 : 0;
423423
}
424424

425+
int luaG_hasnative(lua_State* L, int level)
426+
{
427+
if (unsigned(level) >= unsigned(L->ci - L->base_ci))
428+
return 0;
429+
430+
CallInfo* ci = L->ci - level;
431+
432+
Proto* proto = getluaproto(ci);
433+
if (proto == nullptr)
434+
return 0;
435+
436+
return (proto->execdata != nullptr);
437+
}
438+
425439
void lua_singlestep(lua_State* L, int enabled)
426440
{
427441
L->singlestep = bool(enabled);

luau/VM/src/ldebug.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ LUAI_FUNC bool luaG_onbreak(lua_State* L);
3131
LUAI_FUNC int luaG_getline(Proto* p, int pc);
3232

3333
LUAI_FUNC int luaG_isnative(lua_State* L, int level);
34+
LUAI_FUNC int luaG_hasnative(lua_State* L, int level);

luau/VM/src/lmathlib.cpp

-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <math.h>
88
#include <time.h>
99

10-
LUAU_FASTFLAGVARIABLE(LuauMathMap)
1110
LUAU_FASTFLAGVARIABLE(LuauMathLerp)
1211

1312
#undef PI
@@ -490,11 +489,5 @@ int luaopen_math(lua_State* L)
490489
lua_setfield(L, -2, "lerp");
491490
}
492491

493-
if (FFlag::LuauMathLerp)
494-
{
495-
lua_pushcfunction(L, math_lerp, "lerp");
496-
lua_setfield(L, -2, "lerp");
497-
}
498-
499492
return 1;
500493
}

0 commit comments

Comments
 (0)