Commit Graph

248 Commits

Author SHA1 Message Date
Stephen Chung
ff8eca8a5e Add parse_json. 2020-04-10 17:14:07 +08:00
Stephen Chung
5d611d1674 Add docs on JSON parsing. 2020-04-10 15:18:26 +08:00
Stephen Chung
adbfceb5be Do not omit error enum variants. 2020-04-10 12:16:39 +08:00
Stephen Chung
3609150dcf Bump version to 0.12.0. 2020-04-09 18:45:49 +08:00
Stephen Chung
34ef2d6e00 Rename AnonymousFn to Func 2020-04-09 10:38:33 +08:00
Stephen Chung
518725e119 Add support for anonymous functions in Rust. 2020-04-08 23:01:48 +08:00
Stephen Chung
bcff6bfd71 Remove no_stdlib feature in favor of Engine::new_raw(). 2020-04-08 10:19:03 +08:00
Stephen Chung
e0bb2e5c97 Change optimize_ast to take optimization level as parameter. 2020-04-08 09:30:50 +08:00
Stephen Chung
9f3646d9ec Keep only one call_fn, adds tuples of one and zero. 2020-04-07 21:50:33 +08:00
Stephen Chung
e795a50ae2 Make Engine reentrant to prepare for parallel execution. 2020-04-07 13:23:06 +08:00
Stephen Chung
e204ae1a2c Add 'in' expression. 2020-04-06 17:47:34 +08:00
Stephen Chung
2bb195cd65 Add doc tests to Scope. 2020-04-05 23:43:40 +08:00
Stephen Chung
c4498d147d Add set_value to Scope. 2020-04-05 19:17:48 +08:00
Stephen Chung
3f247fd695 Allow passing in custom Scope to call_fn. 2020-04-05 12:17:31 +08:00
Stephen Chung
29150faef2 Improve AST evaluation efficiency by sharing functions. 2020-04-04 22:00:44 +08:00
Stephen Chung
12a379dd57 Add stepped range function and keys/values for maps. 2020-04-04 12:20:24 +08:00
Stephen Chung
a79f2a209c Make Engine Send+Sync. 2020-04-03 17:17:00 +08:00
Stephen Chung
0873bdc152 Add sync feature to make Dynamic, Scope and AST Send + Sync. 2020-04-02 19:40:02 +08:00
Stephen Chung
5e7c9b47d5 Rename downcast to try_cast and add cast for Dynamic. 2020-04-02 12:35:44 +08:00
Stephen Chung
c4a51b1390 Add append/mixin functions for arrays and maps. 2020-04-01 22:56:54 +08:00
Stephen Chung
4ea2fb88ae Add continue statement. 2020-04-01 16:22:18 +08:00
Stephen Chung
d7ac57c060 Minor code cleanup. 2020-04-01 09:51:33 +08:00
Stephen Chung
dcf5eaf64d Add to_string to prepare for string interpolation. 2020-03-31 10:00:17 +08:00
Stephen Chung
01c0b51017 Change object maps to #{ ... } 2020-03-30 17:40:26 +08:00
Stephen Chung
fce51758d1 Add support for string literal property names in object maps. 2020-03-30 12:14:59 +08:00
Stephen Chung
45ee51874f Add object maps. 2020-03-29 23:53:35 +08:00
Stephen Chung
ef6c6ea6d2 Add no_object feature to disable objects. 2020-03-29 17:15:12 +08:00
Stephen Chung
ef6dd9414a Allow if expressions. 2020-03-27 23:47:23 +08:00
Stephen Chung
337a96394f Limit function calls depth. 2020-03-27 14:34:01 +08:00
Stephen Chung
bcab024d22 Add info to pull directly from GitHub. 2020-03-24 09:49:19 +08:00
Stephen Chung
1b4bcbcfdf Add evaluate expressions. 2020-03-22 21:03:58 +08:00
Stephen Chung
b6320c0eef Minor fine tuning. 2020-03-22 10:18:16 +08:00
Stephen Chung
bd6eb27154 Undo secion changes to README on optimization levels. 2020-03-21 00:40:49 +08:00
Stephen Chung
ed996e71d6 Enable dot operations on constant variables. 2020-03-20 19:27:02 +08:00
Stephen Chung
16ea8f416e Revise section on function side effects because Rhai functions cannot mutate state. 2020-03-19 22:29:24 +08:00
Stephen Chung
6a6c5f30de Add eval function. 2020-03-19 19:53:42 +08:00
Stephen Chung
cc8ec12691 Add more comments and examples. 2020-03-19 13:52:10 +08:00
Stephen Chung
0dc51f8e59 Removee debug_msgs feature. 2020-03-18 22:03:50 +08:00
Stephen Chung
3518c5a630 Bump version to 0.11.0. 2020-03-18 12:13:44 +08:00
Stephen Chung
e7c669343e Add no_std example. 2020-03-18 12:09:34 +08:00
Stephen Chung
ecded729ad Finalize no_std support. 2020-03-18 10:50:51 +08:00
Stephen Chung
777f66ff3c Add section on statements and variables. 2020-03-18 10:42:27 +08:00
Stephen Chung
abe5365bfd Improve error messages to lists. 2020-03-18 10:40:07 +08:00
Stephen Chung
d4311bddb0 Put comments into example scripts. 2020-03-18 10:40:07 +08:00
Stephen Chung
35e354eb41 Refine README. 2020-03-16 12:42:01 +08:00
Stephen Chung
372321dfe3 Add full optimization level for aggressive optimizing. 2020-03-15 22:39:58 +08:00
Stephen Chung
973153e832 Add no_optimize feature to disable optimizations. 2020-03-14 20:06:10 +08:00
Stephen Chung
26bdc8ba08 FIX - fixes panic when constant array is assigned to. Refine README section on constants. 2020-03-14 19:46:44 +08:00
Stephen Chung
cb6171ebcd Merge branch 'constants' 2020-03-14 14:33:56 +08:00
Stephen Chung
c7a6777b70
Merge branch 'master' into master 2020-03-13 18:27:53 +08:00
Stephen Chung
9844ae8665 Add constants. 2020-03-13 18:12:41 +08:00
Jarkko Kuukkanen
6c72e3c48b
Change filename to path for clarity 2020-03-13 12:07:51 +02:00
Stephen Chung
91317c0d3e New sample script - primes.rhai. 2020-03-12 23:46:40 +08:00
Stephen Chung
da440a5dff Add optimization section to README. 2020-03-12 21:19:34 +08:00
Stephen Chung
560da5fdc6 Allow call_fn with only one parameter; consume can retain functions, eval cannot. 2020-03-12 14:54:14 +08:00
Stephen Chung
e24d3a7ade Allow overloading of script functions. 2020-03-12 13:02:13 +08:00
Stephen Chung
7c4d22d98a Add no_function feature to disable script-defined functions. 2020-03-11 13:28:12 +08:00
Stephen Chung
708c285a0a Add only_i32 and only_i64 features. 2020-03-10 23:06:20 +08:00
Stephen Chung
e22aaca5c1 Make sure all tests run with all features. 2020-03-10 19:48:47 +08:00
Stephen Chung
cc772c6e2a Add no_float feature to disable floating-point. 2020-03-10 18:32:01 +08:00
Stephen Chung
52b5732bcb Add no_inidex feature to disable arrays and indexing. 2020-03-10 17:10:33 +08:00
Stephen Chung
f3bcb2a10d Simplify call_fn API, no need to pass &mut references. 2020-03-10 14:09:05 +08:00
Stephen Chung
711cd9bb1c Improve repl and rhai_runner examples with error messages. 2020-03-10 11:25:34 +08:00
Stephen Chung
63482d5a79 Use ? operator for examples. 2020-03-09 16:54:43 +08:00
Stephen Chung
a6899afb11 Refine README. 2020-03-09 12:53:07 +08:00
Stephen Chung
b9d562eba4 Add standard math functions and make power functions checked. 2020-03-09 11:42:10 +08:00
Stephen Chung
c5b40783ef Add unchecked feature to remove arithmetic operations checking. 2020-03-08 23:14:18 +08:00
Stephen Chung
b1b25d3043 Add fallible functions support and replace most arithmetic operations with checked versions. 2020-03-08 22:47:13 +08:00
Stephen Chung
daa581bac7 Add append to strings. 2020-03-08 09:19:04 +08:00
Stephen Chung
ea82ee81d6 Fix call_fn to take &ast instead of ast. 2020-03-07 00:29:45 +08:00
Stephen Chung
42fe5e8b95 Add documentation of call_fn to README. 2020-03-06 11:26:58 +08:00
Stephen Chung
883f08c026 Enable more indexing expressions. 2020-03-05 20:28:03 +08:00
Stephen Chung
c9395049e2 Remove no-std feature and rename stdlib to no_stdlib. 2020-03-05 10:18:46 +08:00
Stephen Chung
bb56a7a843 Code refactor, bug fixes, code docs. 2020-03-04 22:00:01 +08:00
Stephen Chung
3af421ae5f Fix problems with script-defined functions. 2020-03-03 23:31:16 +08:00
Stephen Chung
71a3c79915 Fix number parsing. 2020-03-03 21:39:25 +08:00
Stephen Chung
9f80bf03c4 Add throw. 2020-03-03 18:15:20 +08:00
Stephen Chung
e2cb111e4b Add type_of function. 2020-03-03 17:28:38 +08:00
Stephen Chung
95d0b2e620 Better error messages for function definitions. 2020-03-03 16:23:55 +08:00
Stephen Chung
a1591ae45b Better API for Scope. 2020-03-03 15:20:20 +08:00
Stephen Chung
ed8d2ac20f Add else if control flow. 2020-03-02 17:04:56 +08:00
Stephen Chung
318bf97986 Bump version to 0.10.1. 2020-03-02 15:20:29 +08:00
Stephen Chung
a5e09295f8 Allow comparisons between different types (returning false). 2020-03-02 14:28:42 +08:00
Stephen Chung
22a505b57b Short-curcuit boolean operators. 2020-03-02 12:08:03 +08:00
Stephen Chung
b152ed88f0 Move built-in functions into separate module. 2020-03-01 17:37:47 +08:00
Stephen Chung
e93fd7d3fe Properly handle char types. 2020-03-01 13:30:22 +08:00
Stephen Chung
8128c0cf24 Add pad and truncate array functions. 2020-02-25 16:23:59 +08:00
Stephen Chung
80a9abada6 Introduce to_int and to_float conersion functions. 2020-02-25 15:02:50 +08:00
Stephen Chung
2e296ff9d7 Fix MarkDown style. 2020-02-25 15:01:50 +08:00
Stephen Chung
7893a9734b Minor fixes to README. 2020-02-25 11:23:46 +08:00
Stephen Chung
f8485932b5 Add documentation on pre-compilation. 2020-02-25 11:08:40 +08:00
Stephen Chung
a0c5635712 Update README with new features. 2020-02-25 10:43:13 +08:00
timfish
82fd20b2b1 Rust 2018 2019-09-18 11:21:07 +01:00
timfish
d7d0507f5a Fix readme and a couple of mis-named types? 2019-09-16 22:14:14 +01:00
Hugo Locurcio
e3bee78030
Fix mixed indentation in the README
This makes the Loop example script display correctly on GitHub.
2019-09-09 17:21:46 +02:00
Jonathan Turner
daadb4c9ef Bump version 2019-07-23 19:55:58 +12:00
DYM
eda257a810
libs.rs >> awesome-rust
libs.rs is DEPRECATED in favour of https://github.com/rust-unofficial/awesome-rust
2018-03-01 18:51:01 +01:00
nabijaczleweli
14f31f4232
Syntax highligh TOML as TOML in README 2017-12-21 14:24:54 +01:00
Lukáš Hozda
f8606aec4c bump version once again, since operators were renamed 2017-12-21 12:33:12 +01:00
Lukáš Hozda
13f7f43f98 bump version, since @torkleyy provided some major improvements, also a breaking change (FnRegister -> RegisterFn); fix typo in readme 2017-12-21 11:24:30 +01:00
Lukáš Hozda
df6ac00a67 update README 2017-11-04 11:18:56 +01:00
Lukáš Hozda
8e4ded77b0 I believe latest additions warrant a version increment 2017-11-02 08:34:32 +01:00
Lukáš Hozda
9448c19581 fix version in README, continue documenting 2017-10-30 13:08:40 +01:00
Lukáš Hozda
1b22cab7dd add loops and comments and a list of example scripts and how to run them to README 2017-10-28 21:59:14 +02:00
Lukáš Hozda
5bfee9688e add REPL example to README 2017-10-15 17:52:02 +02:00
Lukáš Hozda
13a3ba6f77 add a section about examples to README, add imports to tests.rs 2017-10-15 17:48:53 +02:00
Lukáš Hozda
d2ae2c6057 bump version in README, add TODO 2017-10-13 21:52:07 +02:00
Lukáš Hozda
92465e899e 'var' -> 'let' in README 2017-10-02 18:46:35 +02:00
Jonathan Turner
2a28209b38 Add string concat/compare. Bump to 0.4 2016-08-17 18:33:31 -07:00
jonathandturner
02e67963e7 Update readme for release 2016-04-13 18:52:12 -07:00
Jonathan Turner
be3d360913 Update README.md 2016-03-31 07:07:33 -07:00
Jonathan Turner
efb7b31487 Update README.md 2016-03-31 07:06:39 -07:00
Jonathan Turner
ef3ea34d13 Update README.md 2016-03-31 07:03:03 -07:00
Jonathan Turner
f4690017c5 Update README.md 2016-03-31 07:01:58 -07:00
Jonathan Turner
8663c33e01 Update README.md 2016-03-31 06:59:54 -07:00
Jonathan Turner
b286f87c1b Update README.md 2016-03-26 20:27:34 -07:00
Jonathan Turner
53be2c9a2a Update README.md 2016-03-26 13:45:24 -07:00
Jonathan Turner
6a3b6ebe95 Update README.md 2016-03-26 13:43:39 -07:00
Jonathan Turner
05b63ef21b Update README.md 2016-03-26 13:43:06 -07:00
Jonathan Turner
281ee84963 Update README.md
Update docs for 0.2
2016-03-26 13:42:54 -07:00
Jonathan Turner
60eea0dcc4 Update README.md 2016-03-15 10:07:01 -04:00
Jonathan Turner
50bf1ceae3 Update README.md 2016-03-14 11:31:24 -04:00
jonathandturner
6ccb4ac297 Caps 2016-03-10 16:57:38 -05:00
jonathandturner
bcdcc3c148 Remove unnecessary references to Debug 2016-03-10 16:48:56 -05:00
jonathandturner
21567b7518 Add member/method example 2016-03-10 16:25:03 -05:00
Jonathan Turner
23460c51fb Update README.md 2016-03-04 08:27:06 -05:00
Jonathan Turner
06014204e2 Update README.md 2016-03-04 08:15:19 -05:00
Jonathan Turner
6549b3e2e0 Update README.md 2016-03-04 08:13:57 -05:00
Jonathan Turner
ed2ab3c09b Update README.md 2016-03-04 08:10:53 -05:00
Jonathan Turner
02f65df0f2 Update README.md 2016-03-04 08:09:10 -05:00
Jonathan Turner
5545f9ee5a Update README.md 2016-03-04 08:08:34 -05:00
Jonathan Turner
75f7d803ac Update README.md 2016-03-03 23:04:35 -05:00
Jonathan Turner
a913050bec Update README.md 2016-03-03 23:04:25 -05:00
Jonathan Turner
803b1db1ea Update README.md 2016-03-03 16:08:51 -05:00
Jonathan Turner
1d12141f0b Update README.md 2016-03-03 11:21:14 -05:00
Jonathan Turner
1b392da803 Update README.md 2016-03-03 11:07:45 -05:00
Jonathan Turner
3e70879eae Update README.md 2016-03-03 10:14:11 -05:00
Jonathan Turner
906ee14138 Update README.md 2016-03-03 10:10:08 -05:00
Jonathan Turner
3e009ea895 Update README.md 2016-03-03 10:01:09 -05:00
Jonathan Turner
b2e5dc2efc Update README.md 2016-03-03 10:00:41 -05:00
Jonathan Turner
e4369723e4 Update README.md 2016-03-03 10:00:29 -05:00
Jonathan Turner
f69788264e Update README.md 2016-03-03 09:59:53 -05:00
Jonathan Turner
2d0e7329a5 Update README.md 2016-03-02 15:08:35 -05:00
Jonathan Turner
ab441dfb0c Update README.md 2016-03-02 15:00:06 -05:00
Jonathan Turner
132a640df2 Update README.md 2016-03-02 14:53:12 -05:00
Jonathan Turner
0fb8b9a394 Update README.md 2016-03-02 14:40:39 -05:00
Jonathan Turner
2222991a92 Update README.md 2016-03-02 14:40:07 -05:00
jonathandturner
6739706b64 Initial commit 2016-02-29 16:43:45 -05:00