-
Notifications
You must be signed in to change notification settings - Fork 248
Expand file tree
/
Copy pathCargo.toml
More file actions
193 lines (159 loc) · 7.52 KB
/
Copy pathCargo.toml
File metadata and controls
193 lines (159 loc) · 7.52 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[workspace]
members = [".", "codegen", "codegen/tests/custom_root"]
[package]
name = "rhai"
version = "1.26.0"
rust-version = "1.66.0"
edition = "2021"
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.4", default-features = false, features = ["compile-time-rng"] }
num-traits = { version = "0.2.14", default-features = false }
once_cell = { version = "1.20.1", default-features = false, features = ["race", "portable-atomic", "alloc"] }
bitflags = { version = "2.3.3", default-features = false }
smartstring = { version = "1.0.0", default-features = false }
rhai_codegen = { version = "3.2.0", path = "codegen" }
no-std-compat = { git = "https://gitlab.com/jD91mZM2/no-std-compat.git", version = "0.4.1", default-features = false, features = ["alloc"], optional = true }
libm = { version = "0.2.0", default-features = false, optional = true }
hashbrown = { version = "0.16.0", optional = true }
core-error = { version = "0.0.0", default-features = false, features = ["alloc"], optional = true }
serde = { version = "1.0.136", 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.24.0", default-features = false, features = ["maths"], optional = true }
getrandom = { version = "0.3.4", optional = true }
rustyline = { version = "15.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.1"
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", "rhai_codegen/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", "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"]
## 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", "grain"]
## Enable the experimental [`grain`](grain/index.html) bytecode VM
grain = []
#! ### 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/wasm_js"]
#! ### 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"]
# VM-versus-walker timings. Run with `--release`; `-- --check` exits non-zero
# on a case that has fallen below the floor recorded beside it.
[[example]]
name = "grain_bench"
required-features = ["grain"]
# A disassembler, for reading what a script lowered to.
[[example]]
name = "grain_dump"
required-features = ["grain"]
# The grain harnesses, as one binary. `tests/mod.rs` wraps them in an inline
# `mod grain`, which is what puts their module paths inside `tests/grain/`.
[[test]]
name = "grain"
path = "tests/mod.rs"
required-features = ["grain"]
# Its own binary, and not negotiable: it installs a counting global allocator
# and reads process-global counters as deltas around each call, so any test
# allocating on another thread corrupts every number it reports.
[[test]]
name = "grain_allocation_efficiency"
path = "tests/grain/allocation.rs"
required-features = ["grain"]
[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]
web-time = { version = "1.1.0" } # WASM implementation of std::time::Instant
[package.metadata.docs.rs]
features = ["document-features", "metadata", "serde", "internals", "decimal", "debugging", "grain"]
[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 = "v15_fake" }