Compare commits

..

No commits in common. "main" and "v0.1.0" have entirely different histories.
main ... v0.1.0

3 changed files with 12 additions and 15 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.10.0", features = ["lua54", "vendored"], optional = true } mlua = { version = "0.9.7", features = ["lua54", "vendored"], optional = true }
path-absolutize = "3.1.1" path-absolutize = "3.1.1"
pathdiff = "0.2.2" pathdiff = "0.2.1"
serde = { version = "1.0.214", features = ["derive", "rc"], optional = true } serde = { version = "1.0.197", 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.65" thiserror = "1.0.58"
tracing = "0.1.40" tracing = "0.1.40"

View File

@ -14,10 +14,6 @@ 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

@ -59,7 +59,7 @@ mod enabled {
err err
})?; })?;
self.handle_lua_result(lua_result).map_err(|err| { self.handle_lua_result(dbg!(lua_result)).map_err(|err| {
handler.receive(err.clone()); handler.receive(err.clone());
err err
}) })
@ -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())), Value::String(s) => Ok(Some(s.to_string_lossy().into_owned())),
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,11 +95,12 @@ mod enabled {
| Value::Table(_) | Value::Table(_)
| Value::Thread(_) | Value::Thread(_)
| Value::UserData(_) | Value::UserData(_)
| Value::LightUserData(_) | Value::LightUserData(_) => {
| Value::Other(..) => Err(TranspileError::LuaRuntimeError(LuaRuntimeError { 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()),
})), }))
}
} }
} }
} }