update mlua to 0.10.0

This commit is contained in:
Moritz Hölting 2024-10-30 20:44:05 +01:00
parent aed758101c
commit 8d359f9969
3 changed files with 14 additions and 11 deletions

View File

@ -32,13 +32,13 @@ derive_more = { version = "1.0.0", default-features = false, features = ["deref"
enum-as-inner = "0.6.0" enum-as-inner = "0.6.0"
getset = "0.1.2" getset = "0.1.2"
itertools = "0.13.0" 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" path-absolutize = "3.1.1"
pathdiff = "0.2.1" pathdiff = "0.2.2"
serde = { version = "1.0.197", features = ["derive", "rc"], optional = true } serde = { version = "1.0.214", features = ["derive", "rc"], optional = true }
shulkerbox = { version = "0.1.0", default-features = false, optional = true } shulkerbox = { version = "0.1.0", default-features = false, optional = true }
strsim = "0.11.1" strsim = "0.11.1"
strum = { version = "0.26.2", features = ["derive"] } strum = { version = "0.26.2", features = ["derive"] }
strum_macros = "0.26.4" strum_macros = "0.26.4"
thiserror = "1.0.58" thiserror = "1.0.65"
tracing = "0.1.40" tracing = "0.1.40"

View File

@ -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. 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 ## Features
### Functions ### Functions

View File

@ -81,7 +81,7 @@ mod enabled {
fn handle_lua_result(&self, value: Value) -> TranspileResult<Option<String>> { fn handle_lua_result(&self, value: Value) -> TranspileResult<Option<String>> {
match value { match value {
Value::Nil => Ok(None), 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::Integer(i) => Ok(Some(i.to_string())),
Value::Number(n) => Ok(Some(n.to_string())), Value::Number(n) => Ok(Some(n.to_string())),
Value::Function(f) => self.handle_lua_result(f.call(()).map_err(|err| { Value::Function(f) => self.handle_lua_result(f.call(()).map_err(|err| {
@ -95,12 +95,11 @@ mod enabled {
| Value::Table(_) | Value::Table(_)
| Value::Thread(_) | Value::Thread(_)
| Value::UserData(_) | Value::UserData(_)
| Value::LightUserData(_) => { | Value::LightUserData(_)
Err(TranspileError::LuaRuntimeError(LuaRuntimeError { | Value::Other(..) => Err(TranspileError::LuaRuntimeError(LuaRuntimeError {
code_block: self.span(), code_block: self.span(),
error_message: format!("invalid return type {}", value.type_name()), error_message: format!("invalid return type {}", value.type_name()),
})) })),
}
} }
} }
} }