Skip to content

Commit 0851d89

Browse files
committed
Fix build
1 parent 00dacc9 commit 0851d89

1 file changed

Lines changed: 23 additions & 19 deletions

File tree

src/luaHandler.cpp

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66

77
#include "scriptCompiler.hpp"
8-
#include "sol/sol.hpp"
98

9+
#include "sol/sol.hpp"
1010
extern std::queue<std::filesystem::path> tasks;
1111
extern void processFile(ScriptCompiler& comp, std::filesystem::path path);
1212
extern std::filesystem::path outputDir;
@@ -335,17 +335,29 @@ LuaHandler::LuaHandler() {
335335
"file_offset", sol::readonly(&sqf::runtime::diagnostics::diag_info::file_offset)
336336
);
337337

338-
339-
340-
341-
342-
343-
344-
345-
346-
347-
338+
lua.new_usertype<OptimizerModuleBase::Node>(
339+
"OptimizerNode", sol::no_constructor,
340+
"type", sol::var(&OptimizerModuleBase::Node::type),
341+
"file", sol::var(&OptimizerModuleBase::Node::file),
342+
"line", sol::var(&OptimizerModuleBase::Node::line),
343+
"offset", sol::var(&OptimizerModuleBase::Node::offset),
344+
"children", sol::var(&OptimizerModuleBase::Node::children),
345+
"constant", sol::var(&OptimizerModuleBase::Node::constant),
346+
"areChildrenConstant", &OptimizerModuleBase::Node::areChildrenConstant
347+
);
348348

349+
lua.new_enum("InstructionType"
350+
"OptimizerNode", sol::no_constructor,
351+
"endStatement", InstructionType::endStatement,
352+
"push", InstructionType::push,
353+
"callUnary", InstructionType::callUnary,
354+
"callBinary", InstructionType::callBinary,
355+
"callNular", InstructionType::callNular,
356+
"assignTo", InstructionType::assignTo,
357+
"assignToLocal", InstructionType::assignToLocal,
358+
"getVariable", InstructionType::getVariable,
359+
"makeArray" , InstructionType::makeArray
360+
);
349361

350362
lua["ASC"] = LuaASC{};
351363
}
@@ -357,14 +369,6 @@ void LuaHandler::LoadFromFile(std::filesystem::path filePath) {
357369
}
358370

359371

360-
void LuaHandler::ScanFiles() {
361-
362-
auto fx = lua.get<sol::function>("ScanFiles");
363-
if (fx.valid())
364-
fx();
365-
366-
}
367-
368372
void LuaHandler::SetupCompiler(ScriptCompiler& compiler) {
369373
if (!isActive)
370374
return;

0 commit comments

Comments
 (0)