Skip to content

Commit

Permalink
Merge pull request #120 from schungx/master
Browse files Browse the repository at this point in the history
Add object maps.
  • Loading branch information
schungx committed Apr 1, 2020
2 parents 65c4639 + 246a865 commit d614d5d
Show file tree
Hide file tree
Showing 27 changed files with 1,291 additions and 715 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -20,13 +20,14 @@ categories = [ "no-std", "embedded", "parser-implementations" ]
num-traits = "0.2.11"

[features]
#default = ["no_function", "no_index", "no_float", "only_i32", "no_stdlib", "unchecked", "no_optimize"]
#default = ["no_function", "no_index", "no_object", "no_float", "only_i32", "no_stdlib", "unchecked", "no_optimize"]
default = []
unchecked = [] # unchecked arithmetic
no_stdlib = [] # no standard library of utility functions
no_index = [] # no arrays and indexing
no_float = [] # no floating-point
no_function = [] # no script-defined functions
no_object = [] # no custom objects
no_optimize = [] # no script optimizer
optimize_full = [] # set optimization level to Full (default is Simple) - this is a feature used only to simplify testing
only_i32 = [] # set INT=i32 (useful for 32-bit systems)
Expand Down
357 changes: 232 additions & 125 deletions README.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions examples/arrays_and_structs.rs
Expand Up @@ -15,6 +15,8 @@ impl TestStruct {
}
}

#[cfg(not(feature = "no_index"))]
#[cfg(not(feature = "no_object"))]
fn main() {
let mut engine = Engine::new();

Expand All @@ -32,3 +34,6 @@ fn main() {
engine.eval::<TestStruct>("let x = [new_ts()]; x[0].update(); x[0]")
);
}

#[cfg(any(feature = "no_index", feature = "no_object"))]
fn main() {}
4 changes: 4 additions & 0 deletions examples/custom_types_and_methods.rs
Expand Up @@ -15,6 +15,7 @@ impl TestStruct {
}
}

#[cfg(not(feature = "no_object"))]
fn main() -> Result<(), EvalAltResult> {
let mut engine = Engine::new();

Expand All @@ -29,3 +30,6 @@ fn main() -> Result<(), EvalAltResult> {

Ok(())
}

#[cfg(feature = "no_object")]
fn main() {}

0 comments on commit d614d5d

Please sign in to comment.