Commit Graph

131 Commits

Author SHA1 Message Date
Stephen Chung
a9a95b3c2d Merge branch 'master' into plugins 2020-05-28 14:09:27 +08:00
Stephen Chung
b34d5fe3a1 Complete ImmutableString. 2020-05-26 14:14:03 +08:00
Stephen Chung
0374311cf6 Optimize hot path of operators calling. 2020-05-24 16:40:00 +08:00
Stephen Chung
a743c47345 Refactor. 2020-05-22 21:50:24 +08:00
Stephen Chung
2f0ab18b70 Merge register_result_fn and register_dynamic_fn. 2020-05-22 13:09:17 +08:00
Stephen Chung
cd570558c3 Remove count_args macro. 2020-05-21 09:31:31 +08:00
Stephen Chung
39cd1c8413 Merge branch 'master' into plugins 2020-05-21 09:30:03 +08:00
Stephen Chung
4a1fd66b9f Reduce Rc/Arc wrapping for functions. 2020-05-19 22:25:57 +08:00
Stephen Chung
3295060dba Unify all functions under CallableFunction type. 2020-05-19 19:03:06 +08:00
Stephen Chung
be97047e51 Limit modules loading. 2020-05-15 21:40:54 +08:00
Stephen Chung
cabceb7498 Better handling of errors during function calls. 2020-05-13 21:58:38 +08:00
Stephen Chung
30e5e2f034 Use modules to implement packages. 2020-05-13 19:21:42 +08:00
Stephen Chung
03c64688ad Fix sync feature. 2020-05-12 16:32:22 +08:00
Stephen Chung
414f3d3c23 Fix bug with calling a pure function method-call style. 2020-05-11 18:55:58 +08:00
Stephen Chung
4a8710a4a9 Create NativeCallable trait. 2020-05-11 13:36:50 +08:00
Stephen Chung
314ec5e4d2 Remove checks for number of arguments. 2020-05-11 10:29:33 +08:00
Stephen Chung
95490adf0b Merge branch 'master' into plugins 2020-05-10 00:14:03 +08:00
Stephen Chung
5f12391ec6 Use hashed lookup for module-qualified functions and variables. 2020-05-08 00:19:08 +08:00
Stephen Chung
c607c7c428 Move Engine functions and iterators lib to Packages API. 2020-05-07 15:25:50 +08:00
Stephen Chung
fa4d391e4b Merge branch 'master' into plugins 2020-05-06 20:00:02 +08:00
Stephen Chung
38e717a838 Build Module type plus engine hooks. 2020-05-05 15:00:10 +08:00
Stephen Chung
c03b162b7e Refactor code base and split into more module files. 2020-05-05 12:24:13 +08:00
Stephen Chung
d83b829810 Avoid copying arguments for function calls. 2020-05-03 16:54:24 +08:00
jhwgh1968
e59f6939f7 Added basic Plugin trait and test 2020-04-25 19:15:06 -05:00
Stephen Chung
b6d839c8a9 Fix no_std build. 2020-04-24 12:39:24 +08:00
Stephen Chung
69733688bf Make all public API's return Box<EvalAltResult> to reduce footprint. 2020-04-21 23:25:12 +08:00
Stephen Chung
0306d15c04 Split core and standard libraries into packages. 2020-04-21 00:11:25 +08:00
Stephen Chung
976f3a7f6d Avoid an allocation in each function registration. 2020-04-20 12:43:34 +08:00
Stephen Chung
642533aef6 Extract function registration into a macro to prepare for future packages support. 2020-04-19 22:58:44 +08:00
Stephen Chung
f5fff828e8 Box errors to reduce return type footprint. 2020-04-18 00:14:33 +08:00
Stephen Chung
f8e9d66a0b Remove lifetime from Engine. 2020-04-16 23:31:48 +08:00
Stephen Chung
a35518fe49 Split tokenizer into separate file, plus fix no_std feature. 2020-04-15 22:21:23 +08:00
Stephen Chung
5152a40e93 Change Dynamic to enum. 2020-04-12 23:00:06 +08:00
Stephen Chung
3609150dcf Bump version to 0.12.0. 2020-04-09 18:45:49 +08:00
Stephen Chung
518725e119 Add support for anonymous functions in Rust. 2020-04-08 23:01:48 +08:00
Stephen Chung
a79f2a209c Make Engine Send+Sync. 2020-04-03 17:17:00 +08:00
Stephen Chung
d7ac57c060 Minor code cleanup. 2020-04-01 09:51:33 +08:00
Stephen Chung
c17dc34f86 Refine code. 2020-03-30 22:19:37 +08:00
Stephen Chung
56df5c49c8 Encapsulate FunctionsLib to hold script-defined functions. 2020-03-26 20:26:05 +08:00
Stephen Chung
8679982b4b Use references for function call args. 2020-03-26 10:56:28 +08:00
Stephen Chung
2bb2e871ab Remove regnster_fn support for first argument of &type (not used). 2020-03-25 17:21:58 +08:00
Stephen Chung
180c4dee08 Document macros. 2020-03-25 11:24:06 +08:00
Stephen Chung
d21f66b911 Fixing lint warnings 2020-03-24 16:57:35 +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
a9c65a962c Split no_stdlib and no_std into two features. 2020-03-18 12:04:26 +08:00
Trangar
c8a9df0a0a Added no_std support 2020-03-17 19:26:11 +01:00
Stephen Chung
f80e499e84 Minor code cleanup. 2020-03-14 23:41:21 +08:00
Stephen Chung
880bce1114 General cleanup. 2020-03-11 11:03:18 +08:00
Stephen Chung
5b5fd162be Use ? operator in tests. 2020-03-09 21:09:53 +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
3e7adc2e51 More comments in code. 2020-03-08 19:54:02 +08:00
Stephen Chung
ba2aac4960 General code cleanup. 2020-03-04 23:06:05 +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
01bee6e16e Accept up to 20 parameters in functions. 2020-03-03 23:17:42 +08:00
Stephen Chung
71ec23e621 Minor code refactoring. 2020-03-03 16:24:03 +08:00
Stephen Chung
0e96e1080c Comprehensive error line number/character position during evaluation. 2020-03-02 22:13:14 +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
8723eedca9 Rename RegisterBoxFn to RegisterDynamicFn. 2020-02-28 23:38:39 +08:00
Stephen Chung
51abc4a2c1 Simplify API by introducing the Dynamic and Array type aliases. 2020-02-25 15:02:27 +08:00
Stephen Chung
157aa2be94 Add for statement and range function; New register_box_fn for functions returning Box<dyn Any> (which should not be boxed again); Register standard utility functions in library (e.g. print, string concat). 2020-02-23 22:48:46 +08:00
timfish
82fd20b2b1 Rust 2018 2019-09-18 11:21:07 +01:00
torkleyy
76a1e3056b Add better funcion call syntax 2017-12-20 22:16:53 +01:00
torkleyy
71ebd0d4d1 Use &mut Any instead of &mut Box<Any> 2017-12-20 21:52:26 +01:00
torkleyy
a0fb5036f6 Minor tweaks, fix bug 2017-12-20 16:32:04 +01:00
torkleyy
f09545921f Rewrite Rhai function dispatching 2017-12-20 12:16:14 +01:00
Lukáš Hozda
9448c19581 fix version in README, continue documenting 2017-10-30 13:08:40 +01:00
Lukáš Hozda
a1e92d006c clippy refactoring 2017-10-02 23:44:45 +02:00
jonathandturner
7a46c7d9bc Refactoring a bit of the string/char parser code. Fmt'd 2016-04-16 19:32:18 -07:00
jonathandturner
4e38b9e611 Clean up trailing space and fix rhai_runner print out 2016-04-13 18:01:08 -07:00
jonathandturner
b1ccaf4516 Add support for arrays 2016-03-26 10:46:28 -07:00
jonathandturner
254f4b081c Simplified function registration to not require explicit coercion step. Simplified eval to take &str instead of String 2016-03-16 18:07:08 -04:00
jonathandturner
fbb5b72f24 Add support for loop breaks and function returns 2016-03-03 09:31:42 -05:00
jonathandturner
a10b59d835 Refactor function lookup for better compile times and slightly cleaner code 2016-03-02 14:14:22 -05:00
jonathandturner
54279fd75f Add support for functions up to arity 6 2016-03-02 10:49:24 -05:00
jonathandturner
d8dd673459 Add support for functions declared in script 2016-03-01 20:45:02 -05:00
jonathandturner
a8fa76c2fc Support for methods. Started support for functions defined in script but not yet ready 2016-03-01 15:16:10 -05:00
jonathandturner
419781cfb6 Fill out support for operators 2016-03-01 09:40:48 -05:00
jonathandturner
6739706b64 Initial commit 2016-02-29 16:43:45 -05:00