diff --git a/Cargo.toml b/Cargo.toml index a758929..541c098 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,13 +32,13 @@ derive_more = { version = "1.0.0", default-features = false, features = ["deref" enum-as-inner = "0.6.0" getset = "0.1.2" itertools = "0.13.0" -mlua = { version = "0.9.7", features = ["lua54", "vendored"], optional = true } +mlua = { version = "0.10.0", features = ["lua54", "vendored"], optional = true } path-absolutize = "3.1.1" -pathdiff = "0.2.1" -serde = { version = "1.0.197", features = ["derive", "rc"], optional = true } +pathdiff = "0.2.2" +serde = { version = "1.0.214", features = ["derive", "rc"], optional = true } shulkerbox = { version = "0.1.0", default-features = false, optional = true } strsim = "0.11.1" strum = { version = "0.26.2", features = ["derive"] } strum_macros = "0.26.4" -thiserror = "1.0.58" +thiserror = "1.0.65" tracing = "0.1.40" diff --git a/README.md b/README.md index 13a8eda..0be9b75 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ shulkerscript = "0.1.0" A VS Code extension is available [here](https://marketplace.visualstudio.com/items?itemName=moritz-hoelting.shulkerscript-lang) to provide syntax highlighting and snippets for Shulkerscript files. +## Usage + +Read the [documentation](https://shulkerscript.hoelting.dev) for more information on the language and cli. + ## Features ### Functions diff --git a/src/transpile/lua.rs b/src/transpile/lua.rs index b98e8cb..7270a80 100644 --- a/src/transpile/lua.rs +++ b/src/transpile/lua.rs @@ -81,7 +81,7 @@ mod enabled { fn handle_lua_result(&self, value: Value) -> TranspileResult> { match value { Value::Nil => Ok(None), - Value::String(s) => Ok(Some(s.to_string_lossy().into_owned())), + Value::String(s) => Ok(Some(s.to_string_lossy())), Value::Integer(i) => Ok(Some(i.to_string())), Value::Number(n) => Ok(Some(n.to_string())), Value::Function(f) => self.handle_lua_result(f.call(()).map_err(|err| { @@ -95,12 +95,11 @@ mod enabled { | Value::Table(_) | Value::Thread(_) | Value::UserData(_) - | Value::LightUserData(_) => { - Err(TranspileError::LuaRuntimeError(LuaRuntimeError { - code_block: self.span(), - error_message: format!("invalid return type {}", value.type_name()), - })) - } + | Value::LightUserData(_) + | Value::Other(..) => Err(TranspileError::LuaRuntimeError(LuaRuntimeError { + code_block: self.span(), + error_message: format!("invalid return type {}", value.type_name()), + })), } } }