diff --git a/Cargo.toml b/Cargo.toml index c619201..71e5e90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ version = "4.0.0-19359309" description = "C/Rust like programming language that compiles into Lua code" edition = "2021" rust-version = "1.65" -authors = ["Maiori"] +authors = ["Felicia.iso"] repository = "https://github.com/ClueLang/Clue" license = "MIT" keywords = ["language", "programming-language", "lua", "compiler", "transpiler"] @@ -16,8 +16,11 @@ categories = ["compilers"] [workspace.dependencies] ahash = "0.8.2" -clap = { version = "3.2.25", features = ["derive", "cargo"] } -colored = "2.0.0" +clap = { version = "4.4.11", features = ["derive", "cargo", "wrap_help"] } +colored = "2.1.0" +crossbeam-queue = "0.3.10" +flume = "0.11.0" +num_cpus = "1.16.0" [profile.release] lto = true diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 748ad77..58a839f 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -15,13 +15,13 @@ categories.workspace = true extended-description = "Clue is a programming language that compiles blazingly fast into Lua code with a syntax similar to languages like C or Rust." [dependencies] -flume = "0.10.14" -num_cpus = "1.14.0" -crossbeam-queue = "0.3.8" +flume.workspace = true +num_cpus.workspace = true +crossbeam-queue.workspace = true ahash.workspace = true clue_core = { path = "../core", version = "4.0.0-19359309", default-features = false } clap.workspace = true -mlua = { version = "0.8.3", features = ["luajit", "vendored"], optional = true } +mlua = { version = "0.9.2", features = ["luajit", "vendored"], optional = true } colored.workspace = true [features] diff --git a/cli/src/main.rs b/cli/src/main.rs index 115989a..72ade65 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,6 +1,6 @@ #![allow(clippy::blocks_in_if_conditions)] -use clap::{crate_version, Parser, ValueEnum}; +use clap::{crate_version, Parser, ValueEnum, builder::ArgPredicate}; use clue_core::{ check, compiler::*, @@ -28,13 +28,12 @@ enum ColorMode { #[clap( version, about = "C/Rust like programming language that compiles into Lua code\nMade by Felicia.iso\nhttps://github.com/ClueLang/Clue", - long_about = None )] struct Cli { - /// The path to the directory where the *.clue files are located. - /// Every directory inside the given directory will be checked too. - /// If the path points to a single *.clue file, only that file will be compiled. - #[clap(default_value_if("--license", None, Some("test")))] + /// The path to the directory where the *.clue files are located, + /// every directory inside the given directory will be checked too; + /// if the path points to a single *.clue file, only that file will be compiled + #[clap(default_value_if("--license", ArgPredicate::IsPresent, Some("test")))] //FIXME path: PathBuf, /// The name the output file will have diff --git a/core/Cargo.toml b/core/Cargo.toml index f094baa..d2ac806 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -12,20 +12,20 @@ keywords.workspace = true categories.workspace = true [dependencies] -phf = { version = "0.11", features = ["macros"] } +phf = { version = "0.11.2", features = ["macros"] } utf8-decode = "1.0.1" ahash.workspace = true clap.workspace = true rpmalloc = { version = "0.2.2", optional = true } -serde = { version = "1.0.159", optional = true } -serde_json = { version = "1.0.96", optional = true } +serde = { version = "1.0.193", optional = true } +serde_json = { version = "1.0.108", optional = true } colored.workspace = true [dev-dependencies] -criterion = "0.4.0" -num_cpus = "1.15.0" -flume = "0.10.14" -crossbeam-queue = "0.3.8" +criterion = "0.5.1" +num_cpus.workspace = true +flume.workspace = true +crossbeam-queue.workspace = true [[bench]] name = "bench" diff --git a/core/src/env.rs b/core/src/env.rs index 6b1a857..9159724 100644 --- a/core/src/env.rs +++ b/core/src/env.rs @@ -18,23 +18,23 @@ use clap::ValueEnum; pub enum ContinueMode { #[default] #[clap(name = "simple")] - /// Simple: This mode uses the native continue keyword. - /// This can only be used in implementations which support it (like BLUA). + /// This mode uses the native continue keyword, + /// this can only be used in implementations which support it (Works in BLUA) Simple, /// DEPRECATED /// - /// LuaJIT: Same as `Goto`, only for compatibility reasons + /// Same as `Goto`, only for compatibility reasons LuaJIT, #[clap(name = "goto")] - /// Goto: Clue will use goto continue; and a ::continue:: label when compiling `continue` keywords - /// instead of assuming the version of Lua you're compiling to has a proper continue keyword. - /// This will work with most versions of Lua (Lua 5.2, LuaJIT). + /// Clue will use `goto continue;` and a `::continue::` label when compiling `continue` keywords + /// instead of assuming the version of Lua you're compiling to has a proper continue keyword + /// (Works in Lua 5.2+ and LuaJIT) Goto, - /// Moonscript: This approach is guaranteed to work with any version of Lua although - /// it has a performance impact because it uses an additional loop. + /// This approach is guaranteed to work with any version of Lua although + /// it has a performance impact because it uses an additional loop MoonScript, } @@ -61,22 +61,11 @@ pub enum LuaSTD { /// The Lua version to target pub enum LuaVersion { #[default] - /// LuaJIT LuaJIT, - - /// Lua 5.4 Lua54, - - /// Lua 5.3 Lua53, - - /// Lua 5.2 Lua52, - - /// Lua 5.1 Lua51, - - /// BLUA BLUA, } @@ -98,18 +87,17 @@ impl Display for LuaVersion { /// The mode to use for bitwise operations pub enum BitwiseMode { #[default] - /// Clue: This mode uses the bitwise operators from Clue as is with no change - /// Works in BLUA + /// Use the bitwise operators from Clue as is with no change (Works in BLUA) Clue, #[clap(name = "library")] - /// Library: This mode uses the bit library to perform bitwise operations - /// Works in LuaJIT (bit), Lua 5.2 (bit32) + /// This mode uses the bit library to perform bitwise operations + /// (Works in LuaJIT (using bit) and Lua 5.2 (using bit32)) Library, #[clap(name = "vanilla")] - /// Vanilla: This mode uses the bitwise operators from standard Lua - /// Works in Lua 5.3+ + /// This mode uses the bitwise operators from standard Lua + /// (Works in Lua 5.3+) Vanilla, } diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 0d9ac5f..c64d1fe 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -15,13 +15,13 @@ categories.workspace = true crate-type = ["cdylib", "rlib"] [dependencies] -serde = "1.0.159" -wasm-bindgen = "0.2.84" +serde = "1.0.193" +wasm-bindgen = "0.2.89" clue_core = { path = "../core", version = "4.0.0-19359309", default-features = false, features = [ "serde", ] } -serde-wasm-bindgen = "0.5.0" -getrandom = { version = "0.2.3", features = ["js"] } +serde-wasm-bindgen = "0.6.3" +getrandom = { version = "0.2.11", features = ["js"] } [dev-dependencies] -wasm-bindgen-test = "0.3.34" +wasm-bindgen-test = "0.3.39"