Commit Graph

393 Commits

Author SHA1 Message Date
Stephen Chung
b75964e383 Add Dynamic::UNIT. 2020-11-15 23:14:29 +08:00
Stephen Chung
a63f14b59c Expr::Switch -> Stmt::Switch. 2020-11-14 23:43:36 +08:00
Stephen Chung
c104afbdce Fix switch test. 2020-11-14 18:30:26 +08:00
Stephen Chung
89254a04c4 Fix tests. 2020-11-14 17:22:01 +08:00
Stephen Chung
83c7c101d1 Add docs and tests for switch. 2020-11-14 09:38:16 +08:00
Stephen Chung
55b4907f19 Add switch expression. 2020-11-13 18:32:18 +08:00
Stephen Chung
41c815f355 Optimize in-place. 2020-11-12 12:37:42 +08:00
Stephen Chung
7b27dcdd62 Fix error messages. 2020-11-11 13:25:45 +08:00
Stephen Chung
821e64adc4 Allow multiple exports. 2020-11-09 14:38:33 +08:00
Stephen Chung
487a073caf Fix recursive file import bug. 2020-11-08 23:00:03 +08:00
Stephen Chung
c6ef2d1e95 Add test to make sure call_fn does not pollute scope. 2020-11-06 13:41:04 +08:00
Stephen Chung
32f41c69bd Refine code and docs. 2020-11-03 21:50:14 +08:00
Stephen Chung
f74d947c6b Fix constant assignment. 2020-11-03 13:08:19 +08:00
Stephen Chung
d7d6f74dfd Add constant NO_POS. 2020-11-02 12:50:27 +08:00
Stephen Chung
3485f9b00b Fix test. 2020-11-01 16:02:10 +08:00
Stephen Chung
a2e2b5e2ef Add f32_float feature. 2020-11-01 15:48:48 +08:00
Stephen Chung
427af14f1b Don't wrap system errors from function calls. 2020-10-28 14:10:46 +08:00
Stephen Chung
4b087d0e69 Fix test. 2020-10-27 23:45:04 +08:00
Stephen Chung
01663a6581 Refine docs. 2020-10-27 11:30:38 +08:00
Stephen Chung
54d68c1061 Fix bug. 2020-10-26 21:49:49 +08:00
Stephen Chung
b607a3a9ba Add raw API for custom syntax. 2020-10-25 21:57:18 +08:00
Stephen Chung
2c7c719cd5 Minor cleanup before release. 2020-10-22 12:26:44 +08:00
Stephen Chung
ce03a4fda5 Fix throw test. 2020-10-20 23:30:01 +08:00
Stephen Chung
07bdb824fe Add try-catch. 2020-10-20 23:16:03 +08:00
Stephen Chung
5ee9dfc5cd 1) Change namespaces to iter_namespaces
2) throw can throw any value
2020-10-20 18:09:26 +08:00
Stephen Chung
92ba7b42d5 Implement namespaces chain. 2020-10-20 10:54:32 +08:00
Stephen Chung
a9fd0ff4de Encapsulate scope into EvalContext;
Fix bug with custom syntax delta.
2020-10-19 19:11:55 +08:00
Stephen Chung
c8c4ca21ad Update docs. 2020-10-19 14:26:15 +08:00
Stephen Chung
8a17856f27 Fix test. 2020-10-18 22:38:15 +08:00
Stephen Chung
ea814779bf Fix test. 2020-10-18 22:24:01 +08:00
Stephen Chung
82e6dd446a Encapsulate register_fn_raw parameters into NativeCallContext. 2020-10-18 17:02:17 +08:00
Stephen Chung
d88adfd73d Fix test. 2020-10-16 21:26:38 +08:00
Stephen Chung
f995d09d8b Fix bug with calling scripted function. 2020-10-16 21:16:06 +08:00
Stephen Chung
fb05e811b7 Map::keys and Map::values can be used method-call style. 2020-10-15 22:11:40 +08:00
Stephen Chung
1c86c66f1a Add more functions to arrays. 2020-10-13 10:57:29 +08:00
Stephen Chung
747fda1ec7 Add filter, map, reduce to Array. 2020-10-12 22:49:51 +08:00
Stephen Chung
fd5a932611 Implement variable resolver. 2020-10-11 21:58:11 +08:00
Stephen Chung
c463e42987 Fix serde test. 2020-10-10 14:15:23 +08:00
Stephen Chung
d511aac7a4 Reduce max call stack size for debug. 2020-10-08 23:00:01 +08:00
Stephen Chung
e34a370f33 Test optimizer with overriding operator. 2020-10-08 10:34:32 +08:00
Stephen Chung
d35c216465 Add README's. 2020-10-07 22:56:21 +08:00
Stephen Chung
8809d25d3c Add Dynamic::from(&str) 2020-10-06 21:25:05 +08:00
Stephen Chung
82d48df734 Merge data type mismatch errors. 2020-10-05 13:45:57 +08:00
Stephen Chung
9664ae42a7 Add is_def_XXX tests. 2020-10-03 21:59:19 +08:00
Stephen Chung
eec3f4e1bf Module:;eval_ast_as_new defaults to merging namespaces. 2020-10-03 11:42:54 +08:00
Stephen Chung
2fd30321a8 Fix test. 2020-10-02 15:31:59 +08:00
Stephen Chung
d2c94ba07c Add more module tests. 2020-10-02 14:55:02 +08:00
Stephen Chung
e526b53b42 No need to merge module if empty. 2020-09-30 09:57:21 +08:00
Stephen Chung
64c421b3d7 Revise docs. 2020-09-28 22:14:19 +08:00
Stephen Chung
726b030616 Implement +/- operators for timestamp. 2020-09-26 19:45:33 +08:00
Stephen Chung
371b7fd00b Fix tests. 2020-09-26 00:46:47 +08:00
Stephen Chung
4efe6b90e7 Add string::split(). 2020-09-25 23:02:49 +08:00
Stephen Chung
f406fc0ac0 Fix function calls. 2020-09-25 19:07:24 +08:00
Stephen Chung
d91d983c74 Enable dots on numbers to parse as method calls. 2020-09-23 22:48:28 +08:00
Stephen Chung
ed38b50490 Add parse_int and parse_float. 2020-09-23 12:00:03 +08:00
Stephen Chung
83f9df2852 Fix op-assignment overrides. 2020-09-21 16:15:52 +08:00
Stephen Chung
1ae6af5289 Merge branch 'plugins_dev' of https://github.com/schungx/rhai into plugins 2020-09-20 14:32:44 +08:00
Stephen Chung
2ba875a177 Use take_string for &str and String parameters. 2020-09-20 14:23:14 +08:00
Stephen Chung
bf245a798b Enable String parameters. 2020-09-20 10:51:37 +08:00
Stephen Chung
39546b7053 Enable &str and String parameters in module functions. 2020-09-19 18:12:23 +08:00
Stephen Chung
d1d3aaf374 Add cast to type for constants to avoid mis-typing. 2020-09-16 21:53:22 -05:00
Stephen Chung
7ceb624ec1 Add combine_with_exported_module. 2020-09-16 21:53:22 -05:00
Stephen Chung
6126f0cb10 Add cast to type for constants to avoid mis-typing. 2020-09-16 21:53:22 -05:00
Stephen Chung
f1d85ae99c Add combine_with_exported_module. 2020-09-16 21:53:22 -05:00
Stephen Chung
6dc5a81d53 Add cast to type for constants to avoid mis-typing. 2020-09-16 21:50:49 -05:00
Stephen Chung
848bdf3f01 Add combine_with_exported_module. 2020-09-16 21:50:44 -05:00
Ilya Lakhin
4bb1a34abb Fixes bug in Module::set_fn_4_mut 2020-09-15 10:14:34 +07:00
Stephen Chung
b311688fee Fix test. 2020-09-11 22:56:19 +08:00
Stephen Chung
6c69a40083 Allow scripted functions in packages. 2020-09-11 22:32:59 +08:00
Stephen Chung
dbfd3df810 Support multiple names in rhai_fn. 2020-09-07 17:08:37 -05:00
Stephen Chung
99b8228630 Use smallvec/union for nightly builds. 2020-09-05 17:55:35 +08:00
Stephen Chung
ae953315fe Refine plugins doc. 2020-09-04 15:42:31 +08:00
Stephen Chung
3902e49a7d Fix bug in right-shifts. 2020-08-23 18:04:19 +08:00
Stephen Chung
a72f797da1 Merge branch 'plugins' into plugins_dev 2020-08-23 17:54:37 +08:00
Stephen Chung
57acd618de Merge branch 'master' into plugins 2020-08-23 17:24:27 +08:00
Stephen Chung
e2f271644a Expand packages and raw Engine write-up. 2020-08-23 17:22:39 +08:00
Stephen Chung
f4c74cc03b Add external closure test. 2020-08-23 16:29:15 +08:00
Stephen Chung
c62914b91a Merge branch 'master' into plugins_dev 2020-08-22 23:04:34 +08:00
Stephen Chung
86c7862ac4 Merge branch 'master' into plugins 2020-08-22 23:03:32 +08:00
Stephen Chung
177a0de23c Fix closure test. 2020-08-22 23:01:25 +08:00
Stephen Chung
3042e3d9db Merge branch 'master' into plugins_dev 2020-08-22 22:51:41 +08:00
Stephen Chung
0ece75aba3 Allow module access in closures. 2020-08-22 22:44:24 +08:00
Stephen Chung
0b04d05afe Do not parse closures when allow_anonymous_fn is false. 2020-08-22 11:08:27 +08:00
Stephen Chung
5b3467631f No need for rhai_mod if not renaming. 2020-08-22 10:44:51 +08:00
Stephen Chung
08977e2a62 Use combine_flatten for plugin modules. 2020-08-21 21:48:45 +08:00
Stephen Chung
3c0d431fd2 Merge branch 'plugins' into plugins_dev 2020-08-20 22:14:56 +08:00
Stephen Chung
729ab99ec3 Refine packages. 2020-08-20 22:11:41 +08:00
Stephen Chung
7c1d4efeb7 Merge branch 'master' into plugins_dev 2020-08-20 16:54:00 +08:00
Stephen Chung
ac6d519d28 Fix bug that consumes first argument in module-qualified call. 2020-08-20 16:26:10 +08:00
Stephen Chung
eedebf11d2 Fix plugins test. 2020-08-19 13:39:20 +08:00
Stephen Chung
c5360db185 Handle #{ in Engine::parse_json, restrict to object hashes only. 2020-08-18 23:07:17 +08:00
Stephen Chung
772e44aa3d Test getter. 2020-08-18 09:25:43 +08:00
Stephen Chung
e75d91e9bf Bring more functions into modules in plugins via rhai_fn(name) attribute. 2020-08-16 23:41:59 +08:00
Stephen Chung
209d1a174c Yet more packages into plugins. 2020-08-15 00:04:10 +08:00
Stephen Chung
c0dc47c9db Convert some packages into plugins. 2020-08-14 13:43:26 +08:00
Stephen Chung
d2ea981fac Merge branch 'master' into plugins 2020-08-14 11:45:52 +08:00
Stephen Chung
b956639c2a Move some math functions into plugins. 2020-08-13 14:57:46 +08:00
J Henry Waugh
0fb61eab00 Fix plugin test 2020-08-12 23:47:57 -05:00
J Henry Waugh
a25f6b35a1 Add new macro_register test which runs in no_std 2020-08-12 23:46:12 -05:00
J Henry Waugh
1a2ef7b531 Fix macro_unroll test 2020-08-12 23:40:50 -05:00