Skip to content

Commit

Permalink
Merge pull request #407 from schungx/master
Browse files Browse the repository at this point in the history
Add no_position feature.
  • Loading branch information
schungx authored Apr 22, 2021
2 parents f7d523e + 1fbbb2a commit d579c1b
Show file tree
Hide file tree
Showing 49 changed files with 592 additions and 385 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- "--features metadata,serde,internals"
- "--features unchecked"
- "--features sync"
- "--features no_position"
- "--features no_optimize"
- "--features no_float"
- "--features f32_float,serde,metadata,internals"
Expand All @@ -34,8 +35,8 @@ jobs:
- "--features no_module"
- "--features no_closure"
- "--features unicode-xid-ident"
- "--features sync,no_function,no_float,no_optimize,no_module,no_closure,metadata,serde,unchecked"
- "--features no_function,no_float,no_index,no_object,no_optimize,no_module,no_closure,unchecked"
- "--features sync,no_function,no_float,no_position,no_optimize,no_module,no_closure,metadata,serde,unchecked"
- "--features no_function,no_float,no_position,no_index,no_object,no_optimize,no_module,no_closure,unchecked"
toolchain: [stable]
experimental: [false]
include:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ New features
------------

* A module called `global` is automatically created to hold global-level constants, which can then be accessed from functions.
* A new feature `no_position` is added to turn off position tracking during parsing to squeeze out the last drop of performance.


Version 0.20.0
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ rhai_codegen = { version = "0.3.4", path = "codegen", default_features = false }
default = ["smartstring/std", "ahash/std", "num-traits/std"] # remove 'smartstring/std' when smartstring is updated to support no-std
unchecked = [] # unchecked arithmetic
sync = [] # restrict to only types that implement Send + Sync
no_position = [] # do not track position in the parser
no_optimize = [] # no script optimizer
no_float = [] # no floating-point
f32_float = [] # set FLOAT=f32
Expand Down
4 changes: 2 additions & 2 deletions examples/arrays_and_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() -> Result<(), Box<EvalAltResult>> {
.register_fn("update", TestStruct::update);

let result = engine.eval::<TestStruct>(
r"
"
let x = new_ts();
x.update();
x
Expand All @@ -35,7 +35,7 @@ fn main() -> Result<(), Box<EvalAltResult>> {
println!("{:?}", result);

let result = engine.eval::<TestStruct>(
r"
"
let x = [ new_ts() ];
x[0].update();
x[0]
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_types_and_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() -> Result<(), Box<EvalAltResult>> {
.register_fn("update", TestStruct::update);

let result = engine.eval::<TestStruct>(
r"
"
let x = new_ts();
x.update();
x
Expand Down
Loading

0 comments on commit d579c1b

Please sign in to comment.