From e0d913612be7bd6642eb464def3591467b535b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Sun, 7 Apr 2024 21:12:47 +0200 Subject: [PATCH] Box lua code and switch to lua-jit --- Cargo.toml | 2 +- src/syntax/syntax_tree/expression.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f485f88..2aa901a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ colored = "2.1.0" derive_more = { version = "0.99.17", default-features = false, features = ["deref", "from", "deref_mut"] } enum-as-inner = "0.6.0" getset = "0.1.2" -mlua = { version = "0.9.7", features = ["luau"], optional = true } +mlua = { version = "0.9.7", features = ["lua54", "vendored"], optional = true } serde = { version = "1.0.197", features = ["derive", "rc"], optional = true } shulkerbox = { path = "../shulkerbox", optional = true} strum = { version = "0.26.2", features = ["derive"] } diff --git a/src/syntax/syntax_tree/expression.rs b/src/syntax/syntax_tree/expression.rs index 6676ded..b3d48e9 100644 --- a/src/syntax/syntax_tree/expression.rs +++ b/src/syntax/syntax_tree/expression.rs @@ -47,13 +47,13 @@ impl SourceElement for Expression { /// Primary: /// FunctionCall /// ``` -#[allow(missing_docs, clippy::large_enum_variant)] +#[allow(missing_docs)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, EnumAsInner)] pub enum Primary { FunctionCall(FunctionCall), StringLiteral(StringLiteral), - Lua(LuaCode), + Lua(Box), } impl SourceElement for Primary { @@ -245,7 +245,7 @@ impl<'a> Parser<'a> { handler, )?; - Some(Primary::Lua(LuaCode { + Some(Primary::Lua(Box::new(LuaCode { lua_keyword, left_parenthesis: variables.open, variables: variables.list, @@ -253,7 +253,7 @@ impl<'a> Parser<'a> { left_brace: tree.open, code: tree.tree?, right_brace: tree.close, - })) + }))) } unexpected => {