commit 2d4e6a46cc8afd76c79d32e748e0851f668d116f
parent 27458ebc2b3ea4a789cebeb6b1f79658fa9f0ff5
Author: Sylvia Ivory <git@sivory.net>
Date: Mon, 23 Jun 2025 03:10:01 -0700
Add Luau support
Diffstat:
3 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -438,6 +438,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
[[package]]
+name = "libloading"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
+dependencies = [
+ "cfg-if",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
name = "linux-raw-sys"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -485,6 +495,15 @@ dependencies = [
]
[[package]]
+name = "luau0-src"
+version = "0.12.3+luau663"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76ae337c644bbf86a8d8e9ce3ee023311833d41741baf5e51acc31b37843aba1"
+dependencies = [
+ "cc",
+]
+
+[[package]]
name = "manen"
version = "0.1.0"
dependencies = [
@@ -536,6 +555,7 @@ dependencies = [
"anyhow",
"bstr",
"either",
+ "libloading",
"mlua-sys",
"num-traits",
"parking_lot",
@@ -553,6 +573,7 @@ dependencies = [
"cfg-if",
"lua-src",
"luajit-src",
+ "luau0-src",
"pkg-config",
]
diff --git a/Cargo.toml b/Cargo.toml
@@ -12,6 +12,9 @@ lua52 = ["mlua/lua52"]
lua51 = ["mlua/lua51"]
luajit = ["mlua/luajit"]
luajit52 = ["mlua/luajit52"]
+luau = ["mlua/luau"]
+luau-jit = ["mlua/luau-jit", "luau"]
+luau-vector4 = ["mlua/luau-vector4", "luau"]
[dependencies]
aho-corasick = "1.1.3"
diff --git a/src/inspect.rs b/src/inspect.rs
@@ -181,6 +181,24 @@ pub fn display_basic(val: &LuaValue, colorize: bool) -> String {
LuaValue::Integer(i) => Color::LightYellow.paint(i.to_string()),
LuaValue::Number(n) => Color::LightYellow.paint(n.to_string()),
LuaValue::String(s) => Color::Green.paint(format_string(s, colorize)),
+ #[cfg(feature = "luau")]
+ LuaValue::Vector(v) => {
+ let strings: &[AnsiString<'static>] = &[
+ Color::Default.paint("<"),
+ Color::LightYellow.paint(v.x().to_string()),
+ Color::Default.paint(", "),
+ Color::LightYellow.paint(v.y().to_string()),
+ Color::Default.paint(", "),
+ Color::LightYellow.paint(v.z().to_string()),
+ #[cfg(feature = "luau-vector4")]
+ Color::Default.paint(", "),
+ #[cfg(feature = "luau-vector4")]
+ Color::LightYellow.paint(v.w().to_string()),
+ Color::Default.paint(">"),
+ ];
+
+ return handle_strings(colorize, AnsiStrings(strings));
+ }
val => Color::LightGray.paint(val.to_string().unwrap_or_default()),
}];