-
Notifications
You must be signed in to change notification settings - Fork 180
/
Cargo.toml
170 lines (139 loc) · 6.83 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
[workspace]
members = [".", "codegen"]
[package]
name = "rhai"
version = "1.20.0"
rust-version = "1.66.0"
edition = "2018"
resolver = "2"
authors = ["Jonathan Turner", "Lukáš Hozda", "Stephen Chung", "jhwgh1968"]
description = "Embedded scripting for Rust"
homepage = "https://rhai.rs"
repository = "https://github.com/rhaiscript/rhai"
readme = "README.md"
license = "MIT OR Apache-2.0"
include = ["/src/**/*", "/Cargo.toml", "/README.md", "LICENSE*"]
keywords = ["scripting", "scripting-engine", "scripting-language", "embedded"]
categories = ["no-std", "embedded", "wasm", "parser-implementations"]
[dependencies]
smallvec = { version = "1.7.0", default-features = false, features = ["union", "const_new", "const_generics"] }
thin-vec = { version = "0.2.13", default-features = false }
ahash = { version = "0.8.2", default-features = false, features = ["compile-time-rng"] }
num-traits = { version = "0.2.0", default-features = false }
once_cell = { version = "1.20.1", default-features = false, features = ["race", "portable-atomic", "alloc"] }
bitflags = { version = "2.0.0", default-features = false }
smartstring = { version = "1.0.0", default-features = false }
rhai_codegen = { version = "2.1.0", path = "codegen" }
no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat", version = "0.4.1", default-features = false, features = ["alloc"], optional = true }
libm = { version = "0.2.0", default-features = false, optional = true }
hashbrown = { version = "0.15.0", optional = true }
core-error = { version = "0.0.0", default-features = false, features = ["alloc"], optional = true }
serde = { version = "1.0.96", default-features = false, features = ["derive", "alloc"], optional = true }
serde_json = { version = "1.0.45", default-features = false, features = ["alloc"], optional = true }
unicode-xid = { version = "0.2.0", default-features = false, optional = true }
rust_decimal = { version = "1.16.0", default-features = false, features = ["maths"], optional = true }
getrandom = { version = "0.2.0", optional = true }
rustyline = { version = "13.0.0", optional = true }
document-features = { version = "0.2.0", optional = true }
arbitrary = { version = "1.3.2", optional = true, features = ["derive"] }
[dev-dependencies]
rmp-serde = "1.1.0"
serde_json = { version = "1.0.45", default-features = false, features = ["alloc"] }
[features]
## Default features: `std`, uses runtime random numbers for hashing.
default = ["std", "ahash/runtime-rng"] # ahash/runtime-rng trumps ahash/compile-time-rng
## Standard features: uses compile-time random number for hashing.
std = ["once_cell/std", "ahash/std", "num-traits/std", "smartstring/std"]
#! ### Enable Special Functionalities
## Require that all data types implement `Send + Sync` (for multi-threaded usage).
sync = ["no-std-compat/compat_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", "thin-vec/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"]
## Enable fuzzing via the [`arbitrary`](https://crates.io/crates/arbitrary) crate.
fuzz = ["arbitrary", "rust_decimal/rust-fuzz", "serde"]
#! ### 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"]
#! ### Features used in testing environments only
## Compiled with a non-stable compiler (i.e. beta or nightly)
unstable = []
## Running under a testing environment.
testing-environ = []
[[bin]]
name = "rhai-repl"
required-features = ["rustyline"]
[[bin]]
name = "rhai-run"
[[bin]]
name = "rhai-dbg"
required-features = ["debugging"]
[[example]]
name = "serde"
required-features = ["serde"]
[[example]]
name = "definitions"
required-features = ["metadata", "internals"]
[profile.release]
lto = "fat"
codegen-units = 1
#opt-level = "z" # optimize for size
#panic = 'abort' # remove stack backtrace for no-std
[target.'cfg(target_family = "wasm")'.dependencies]
instant = { version = "0.1.10" } # WASM implementation of std::time::Instant
[package.metadata.docs.rs]
features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging"]
[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", branch = "v13" }
# Patch SmartString to resolve an UB issue.
#smartstring = { git = "https://github.com/bodil/smartstring", ref = "refs/pull/34/head" }