2020-09-08 16:03:38 -05:00
|
|
|
[workspace]
|
2021-03-12 13:26:47 +08:00
|
|
|
members = [".", "codegen"]
|
2020-09-08 16:03:38 -05:00
|
|
|
|
2016-02-29 16:43:45 -05:00
|
|
|
[package]
|
|
|
|
name = "rhai"
|
2022-04-11 16:53:44 +08:00
|
|
|
version = "1.7.0"
|
2022-02-24 08:54:37 +08:00
|
|
|
rust-version = "1.57"
|
2019-09-18 11:21:07 +01:00
|
|
|
edition = "2018"
|
2020-09-09 09:12:28 +08:00
|
|
|
authors = ["Jonathan Turner", "Lukáš Hozda", "Stephen Chung", "jhwgh1968"]
|
2016-03-16 10:00:57 -04:00
|
|
|
description = "Embedded scripting for Rust"
|
2021-02-27 12:52:20 +08:00
|
|
|
homepage = "https://rhai.rs"
|
2021-01-14 19:07:03 +08:00
|
|
|
repository = "https://github.com/rhaiscript"
|
2016-03-16 10:00:57 -04:00
|
|
|
readme = "README.md"
|
2020-03-22 10:18:16 +08:00
|
|
|
license = "MIT OR Apache-2.0"
|
2021-03-12 13:26:47 +08:00
|
|
|
include = ["**/*.rs", "scripts/*.rhai", "**/*.md", "Cargo.toml"]
|
|
|
|
keywords = ["scripting", "scripting-engine", "scripting-language", "embedded"]
|
|
|
|
categories = ["no-std", "embedded", "wasm", "parser-implementations"]
|
2018-02-09 22:27:41 +01:00
|
|
|
|
2020-03-08 22:47:13 +08:00
|
|
|
[dependencies]
|
2021-11-25 17:09:00 +08:00
|
|
|
smallvec = { version = "1.7", default-features = false, features = ["union", "const_new" ] }
|
2021-03-21 23:51:24 +08:00
|
|
|
ahash = { version = "0.7", default-features = false }
|
2021-06-11 12:29:03 +08:00
|
|
|
num-traits = { version = "0.2", default-features = false }
|
2022-02-25 11:42:59 +08:00
|
|
|
bitflags = { version = "1", default-features = false }
|
2022-02-25 08:24:22 +08:00
|
|
|
smartstring = { version = "1", default-features = false }
|
2022-03-30 08:09:06 +08:00
|
|
|
rhai_codegen = { version = "1.4", path = "codegen", default-features = false }
|
2022-01-30 09:41:51 +08:00
|
|
|
|
|
|
|
no-std-compat = { version = "0.4", default-features = false, features = ["alloc"], optional = true }
|
|
|
|
libm = { version = "0.2", default-features = false, optional = true }
|
|
|
|
core-error = { version = "0.0", default-features = false, features = ["alloc"], optional = true }
|
|
|
|
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
|
|
|
|
serde_json = { version = "1.0", default-features = false, features = ["alloc"], optional = true }
|
|
|
|
unicode-xid = { version = "0.2", default-features = false, optional = true }
|
|
|
|
rust_decimal = { version = "1.16", default-features = false, features = ["maths"], optional = true }
|
2022-03-30 12:08:30 +08:00
|
|
|
rustyline = { version = "9", optional = true }
|
2020-03-17 19:26:11 +01:00
|
|
|
|
2021-12-02 14:10:53 +08:00
|
|
|
[dev-dependencies]
|
|
|
|
serde_bytes = "0.11"
|
|
|
|
|
2020-03-18 10:50:51 +08:00
|
|
|
[features]
|
2022-01-27 08:22:20 +08:00
|
|
|
default = []
|
2021-03-21 23:51:24 +08:00
|
|
|
unchecked = [] # unchecked arithmetic
|
|
|
|
sync = [] # restrict to only types that implement Send + Sync
|
2021-04-22 23:02:25 +08:00
|
|
|
no_position = [] # do not track position in the parser
|
2021-03-21 23:51:24 +08:00
|
|
|
no_optimize = [] # no script optimizer
|
|
|
|
no_float = [] # no floating-point
|
|
|
|
f32_float = [] # set FLOAT=f32
|
|
|
|
only_i32 = [] # set INT=i32 (useful for 32-bit systems)
|
|
|
|
only_i64 = [] # set INT=i64 (default) and disable support for all other integer types
|
2021-07-08 14:09:31 +08:00
|
|
|
decimal = ["rust_decimal"] # add the Decimal number type
|
2021-03-21 23:51:24 +08:00
|
|
|
no_index = [] # no arrays and indexing
|
|
|
|
no_object = [] # no custom objects
|
|
|
|
no_function = ["no_closure"] # no script-defined functions (meaning no closures)
|
|
|
|
no_closure = [] # no automatic sharing and capture of anonymous functions to external variables
|
|
|
|
no_module = [] # no modules
|
2021-03-12 13:26:47 +08:00
|
|
|
unicode-xid-ident = ["unicode-xid"] # allow Unicode Standard Annex #31 for identifiers.
|
2021-09-28 19:19:17 +08:00
|
|
|
metadata = ["serde", "serde_json", "rhai_codegen/metadata", "smartstring/serde"] # enable exporting functions metadata
|
2022-02-08 09:02:15 +08:00
|
|
|
internals = [] # expose internal data structures
|
2022-01-24 17:04:40 +08:00
|
|
|
debugging = ["internals"] # enable debugging
|
2020-03-18 10:50:51 +08:00
|
|
|
|
2022-02-03 21:17:47 +08:00
|
|
|
# compiling for no-std
|
2021-04-17 15:15:54 +08:00
|
|
|
no_std = ["no-std-compat", "num-traits/libm", "core-error", "libm", "ahash/compile-time-rng"]
|
2020-03-18 10:50:51 +08:00
|
|
|
|
2021-01-18 11:35:55 +08:00
|
|
|
# compiling for WASM
|
2021-03-12 13:26:47 +08:00
|
|
|
wasm-bindgen = ["instant/wasm-bindgen"]
|
|
|
|
stdweb = ["instant/stdweb"]
|
2021-01-18 11:35:55 +08:00
|
|
|
|
2022-02-03 21:17:47 +08:00
|
|
|
# compiling bin tools
|
|
|
|
bin-features = ["decimal", "metadata", "serde", "debugging", "rustyline"]
|
|
|
|
|
2022-01-30 09:41:51 +08:00
|
|
|
[[bin]]
|
|
|
|
name = "rhai-repl"
|
|
|
|
required-features = ["rustyline"]
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "rhai-run"
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
name = "rhai-dbg"
|
|
|
|
required-features = ["debugging"]
|
|
|
|
|
2020-03-18 10:50:51 +08:00
|
|
|
[profile.release]
|
|
|
|
lto = "fat"
|
|
|
|
codegen-units = 1
|
2020-03-18 13:09:38 +08:00
|
|
|
#opt-level = "z" # optimize for size
|
|
|
|
#panic = 'abort' # remove stack backtrace for no-std
|
2020-03-18 10:50:51 +08:00
|
|
|
|
2022-01-12 08:12:28 +08:00
|
|
|
[target.'cfg(target_family = "wasm")'.dependencies]
|
2021-07-30 17:36:32 +08:00
|
|
|
instant = { version = "0.1.10" } # WASM implementation of std::time::Instant
|
2021-02-19 15:50:48 +08:00
|
|
|
|
2020-07-25 15:52:27 +08:00
|
|
|
[package.metadata.docs.rs]
|
2022-01-24 17:04:40 +08:00
|
|
|
features = ["metadata", "serde", "internals", "decimal", "debugging"]
|
2022-03-30 12:08:30 +08:00
|
|
|
|
|
|
|
[patch.crates-io]
|
|
|
|
# Notice that a custom modified version of `rustyline` is used which supports bracketed paste on Windows.
|
|
|
|
# This can be moved to the official version when bracketed paste is added.
|
|
|
|
rustyline = { git = "https://github.com/schungx/rustyline" }
|