2020-09-08 23:03:38 +02:00
[ workspace ]
2021-03-12 06:26:47 +01:00
members = [ "." , "codegen" ]
2020-09-08 23:03:38 +02:00
2016-02-29 22:43:45 +01:00
[ package ]
name = "rhai"
2023-06-26 02:48:22 +02:00
version = "1.16.0"
2022-08-27 11:28:59 +02:00
rust-version = "1.61.0"
2019-09-18 12:21:07 +02:00
edition = "2018"
2022-07-21 02:35:56 +02:00
resolver = "2"
2020-09-09 03:12:28 +02:00
authors = [ "Jonathan Turner" , "Lukáš Hozda" , "Stephen Chung" , "jhwgh1968" ]
2016-03-16 15:00:57 +01:00
description = "Embedded scripting for Rust"
2021-02-27 05:52:20 +01:00
homepage = "https://rhai.rs"
2021-01-14 12:07:03 +01:00
repository = "https://github.com/rhaiscript"
2016-03-16 15:00:57 +01:00
readme = "README.md"
2020-03-22 03:18:16 +01:00
license = "MIT OR Apache-2.0"
2022-07-26 15:18:01 +02:00
include = [ "/src/**/*" , "/Cargo.toml" , "/README.md" , "LICENSE*" ]
2021-03-12 06:26:47 +01:00
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 15:47:13 +01:00
[ dependencies ]
2024-04-30 15:55:51 +02:00
smallvec = { version = "1.13" , default-features = false , features = [ "union" , "const_new" , "const_generics" ] }
ahash = { version = "0.8.11" , default-features = false , features = [ "compile-time-rng" ] }
2021-06-11 06:29:03 +02:00
num-traits = { version = "0.2" , default-features = false }
2024-04-30 15:55:51 +02:00
bitflags = { version = "2" , default-features = false }
2022-02-25 01:24:22 +01:00
smartstring = { version = "1" , default-features = false }
2022-12-03 10:03:15 +01:00
rhai_codegen = { version = "1.5.0" , path = "codegen" , default-features = false }
2022-01-30 02:41:51 +01:00
2023-05-02 19:14:34 +02:00
no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat" , version = "0.4.1" , default-features = false , features = [ "alloc" ] , optional = true }
2022-01-30 02:41:51 +01:00
libm = { version = "0.2" , default-features = false , optional = true }
2024-04-30 15:55:51 +02:00
hashbrown = { version = "0.14" , optional = true }
2022-01-30 02:41:51 +01:00
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 }
2024-04-30 15:55:51 +02:00
rust_decimal = { version = "1.35" , default-features = false , features = [ "maths" ] , optional = true }
2022-10-17 05:54:25 +02:00
getrandom = { version = "0.2" , optional = true }
2024-04-30 15:55:51 +02:00
rustyline = { version = "14" , optional = true }
2022-12-22 02:33:12 +01:00
document-features = { version = "0.2" , optional = true }
2020-03-17 19:26:11 +01:00
2021-12-02 07:10:53 +01:00
[ dev-dependencies ]
2024-04-30 15:55:51 +02:00
rmp-serde = "1.3"
2022-05-23 16:40:49 +02:00
serde_json = { version = "1.0" , default-features = false , features = [ "alloc" ] }
2021-12-02 07:10:53 +01:00
2020-03-18 03:50:51 +01:00
[ features ]
2022-12-22 02:33:12 +01:00
## Default features: `std`, uses runtime random numbers for hashing.
2022-10-12 02:13:27 +02:00
default = [ "std" , "ahash/runtime-rng" ] # ahash/runtime-rng trumps ahash/compile-time-rng
2022-12-22 02:33:12 +01:00
## Standard features: uses compile-time random number for hashing.
2022-10-12 02:13:27 +02:00
std = [ "ahash/std" , "num-traits/std" , "smartstring/std" ]
2022-12-22 02:33:12 +01:00
#! ### Enable Special Functionalities
## Require that all data types implement `Send + Sync` (for multi-threaded usage).
sync = [ ]
## Add support for the [`Decimal`](https://crates.io/crates/rust_decimal) data type (acts as the system floating-point type under `no_float`).
decimal = [ "rust_decimal" ]
## Enable serialization/deserialization of Rhai data types via [`serde`](https://crates.io/crates/serde).
serde = [ "dep:serde" , "smartstring/serde" , "smallvec/serde" ]
## Allow [Unicode Standard Annex #31](https://unicode.org/reports/tr31/) for identifiers.
unicode-xid-ident = [ "unicode-xid" ]
## Enable functions metadata (including doc-comments); implies [`serde`](#feature-serde).
metadata = [ "serde" , "serde_json" , "rhai_codegen/metadata" , "smartstring/serde" ]
## Expose internal data structures (e.g. `AST` nodes).
internals = [ ]
## Enable the debugging interface (implies [`internals`](#feature-internals)).
debugging = [ "internals" ]
## Features and dependencies required by `bin` tools: `decimal`, `metadata`, `serde`, `debugging` and [`rustyline`](https://crates.io/crates/rustyline).
bin-features = [ "decimal" , "metadata" , "serde" , "debugging" , "rustyline" ]
#! ### System Configuration Features
## Use `f32` instead of `f64` as the system floating-point number type.
f32_float = [ ]
## Use `i32` instead of `i64` for the system integer number type (useful for 32-bit architectures).
## All other integer types (e.g. `u8`) are disabled.
only_i32 = [ ]
## Disable all integer types (e.g. `u8`) other than `i64`.
only_i64 = [ ]
#! ### Disable Language Features
## Remove support for floating-point numbers.
no_float = [ ]
## Remove support for arrays and indexing.
no_index = [ ]
## Remove support for custom types, properties, method-style calls and object maps.
no_object = [ ]
## Remove support for time-stamps.
no_time = [ ]
## Remove support for script-defined functions (implies [`no_closure`](#feature-no_closure)).
no_function = [ "no_closure" ]
## Remove support for capturing external variables in anonymous functions (i.e. closures).
no_closure = [ ]
## Remove support for loading external modules.
no_module = [ ]
## Remove support for custom syntax.
no_custom_syntax = [ ]
#! ### Performance-Related Features
## Disable all safety checks.
unchecked = [ ]
## Do not track position when parsing.
no_position = [ ]
## Disable the script optimizer.
no_optimize = [ ]
#! ### Compiling for `no-std`
## Turn on `no-std` compilation (nightly only).
no_std = [ "no-std-compat" , "num-traits/libm" , "core-error" , "libm" , "hashbrown" , "no_time" ]
#! ### JavaScript Interface for WASM
## Use [`wasm-bindgen`](https://crates.io/crates/wasm-bindgen) as JavaScript interface.
wasm-bindgen = [ "getrandom/js" , "instant/wasm-bindgen" ]
## Use [`stdweb`](https://crates.io/crates/stdweb) as JavaScript interface.
stdweb = [ "getrandom/js" , "instant/stdweb" ]
2022-02-03 14:17:47 +01:00
2023-03-02 06:16:15 +01:00
#! ### Features used in testing environments only
## Running under a testing environment.
testing-environ = [ ]
2022-01-30 02:41:51 +01:00
[ [ bin ] ]
name = "rhai-repl"
required-features = [ "rustyline" ]
[ [ bin ] ]
name = "rhai-run"
[ [ bin ] ]
name = "rhai-dbg"
required-features = [ "debugging" ]
2022-07-26 11:05:42 +02:00
[ [ example ] ]
name = "serde"
required-features = [ "serde" ]
2022-07-25 19:01:06 +02:00
[ [ example ] ]
name = "definitions"
2022-07-28 11:58:22 +02:00
required-features = [ "metadata" , "internals" ]
2022-07-25 19:01:06 +02:00
2020-03-18 03:50:51 +01:00
[ profile . release ]
lto = "fat"
codegen-units = 1
2020-03-18 06:09:38 +01:00
#opt-level = "z" # optimize for size
#panic = 'abort' # remove stack backtrace for no-std
2020-03-18 03:50:51 +01:00
2022-01-12 01:12:28 +01:00
[ target . 'cfg(target_family = "wasm")' . dependencies ]
2024-04-30 15:55:51 +02:00
instant = { version = "0.1.12" } # WASM implementation of std::time::Instant
2021-02-19 08:50:48 +01:00
2020-07-25 09:52:27 +02:00
[ package . metadata . docs . rs ]
2022-12-22 02:33:12 +01:00
features = [ "document-features" , "metadata" , "serde" , "internals" , "decimal" , "debugging" ]
2022-03-30 06:08:30 +02: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.
2023-02-20 03:06:26 +01:00
rustyline = { git = "https://github.com/schungx/rustyline" , branch = "v11" }