Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/VM/src/lvm.h
2725 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
// This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
3
#pragma once
4
5
#include "lobject.h"
6
#include "ltm.h"
7
8
#define tostring(L, o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o)))
9
10
#define tonumber(o, n) (ttype(o) == LUA_TNUMBER || (((o) = luaV_tonumber(o, n)) != NULL))
11
12
#define equalobj(L, o1, o2) (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2))
13
14
LUAI_FUNC int luaV_strcmp(const TString* ls, const TString* rs);
15
LUAI_FUNC int luaV_lessthan(lua_State* L, const TValue* l, const TValue* r);
16
LUAI_FUNC int luaV_lessequal(lua_State* L, const TValue* l, const TValue* r);
17
LUAI_FUNC int luaV_equalval(lua_State* L, const TValue* t1, const TValue* t2);
18
19
template<TMS op>
20
void luaV_doarithimpl(lua_State* L, StkId ra, const TValue* rb, const TValue* rc);
21
22
LUAI_FUNC void luaV_dolen(lua_State* L, StkId ra, const TValue* rb);
23
LUAI_FUNC const TValue* luaV_tonumber(const TValue* obj, TValue* n);
24
LUAI_FUNC const float* luaV_tovector(const TValue* obj);
25
LUAI_FUNC int luaV_tostring(lua_State* L, StkId obj);
26
LUAI_FUNC void luaV_gettable(lua_State* L, const TValue* t, TValue* key, StkId val);
27
LUAI_FUNC void luaV_settable(lua_State* L, const TValue* t, TValue* key, StkId val);
28
LUAI_FUNC void luaV_concat(lua_State* L, int total, int last);
29
LUAI_FUNC void luaV_getimport(lua_State* L, LuaTable* env, TValue* k, StkId res, uint32_t id, bool propagatenil);
30
LUAI_FUNC void luaV_prepareFORN(lua_State* L, StkId plimit, StkId pstep, StkId pinit);
31
LUAI_FUNC void luaV_callTM(lua_State* L, int nparams, int res);
32
LUAI_FUNC void luaV_tryfuncTM(lua_State* L, StkId func);
33
34
LUAI_FUNC void luau_execute(lua_State* L);
35
LUAI_FUNC int luau_precall(lua_State* L, struct lua_TValue* func, int nresults);
36
LUAI_FUNC void luau_poscall(lua_State* L, StkId first);
37
LUAI_FUNC void luau_callhook(lua_State* L, lua_Hook hook, void* userdata);
38
39