Commit Graph

916 Commits

Author SHA1 Message Date
Stephen Chung
2fbc1b7910 Add missing pub to functions. 2020-08-24 10:38:15 +08:00
Stephen Chung
03237c9852 Merge branch 'plugins' into plugins_dev 2020-08-24 08:36:15 +08:00
J Henry Waugh
9fe3672514 string_more: add missing pub from crop_string 2020-08-23 17:49:50 -05:00
Stephen Chung
1dacf21a84 Fix no_std builds by pulling in num-traits. 2020-08-23 18:28:55 +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
4fff90d19b Merge branch 'master' into plugins 2020-08-23 17:54:02 +08:00
Stephen Chung
7cd345b128 Fix bug in closure capture for no_object. 2020-08-23 17:46:39 +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
196e145c96 Derive standard traits for Limits. 2020-08-23 16:29:32 +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
211ce54973 Move most packages to modules. 2020-08-22 22:26:49 +08:00
Stephen Chung
5d6fdba24d Merge branch 'plugins' into plugins_dev 2020-08-22 16:20:53 +08:00
J Henry Waugh
15a8f528ae Avoid export_fn+cfg attributes in Rhai packages 2020-08-21 23:26:24 -05:00
Stephen Chung
0b04d05afe Do not parse closures when allow_anonymous_fn is false. 2020-08-22 11:08:27 +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
6e54b22b31 Merge branch 'master' into plugins_dev 2020-08-20 17:02:57 +08:00
Stephen Chung
24610688d3 Fix no_std build. 2020-08-20 17:02:25 +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
980aba77a9 Use &mut. 2020-08-19 12:53:33 +08:00
Stephen Chung
c55b0d7883 Fix bug with plugin method call detection. 2020-08-19 12:50:23 +08:00
Stephen Chung
6a3e123306 Use split_first_mut instead of split_at_mut. 2020-08-18 23:19:26 +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
d024f912e0 Merge branch 'master' into plugins_dev 2020-08-18 22:02:44 +08:00
Stephen Chung
e3f2157c6a Treat leading #{ in Engine::parse_json. 2020-08-18 22:01:13 +08:00
Stephen Chung
09b75ed1a3 Fix bug in strings package. 2020-08-17 10:00:50 +08:00
Stephen Chung
810514dd31 Add get/set/index_get/index_set parameters to rhai_fn. 2020-08-17 00:13:52 +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
db9d8b81cf Move BasicStringsPackage to plugins. 2020-08-15 12:57:47 +08:00
J Henry Waugh
e4045256fe Fix type resolution issue with no_float enabled 2020-08-14 19:39:28 -05:00
J Henry Waugh
89de2fe6b2 Feature gate make_getter imports 2020-08-14 19:37:34 -05:00
J Henry Waugh
eabf9db263 Add missing num_traits import 2020-08-14 19:37:25 -05:00
J Henry Waugh
7fcbfcc7fd codegen: explicit import of format! macro 2020-08-14 19:37:25 -05:00
J Henry Waugh
1051a3f108 Add missing import of String and ToString 2020-08-14 19:37:25 -05:00
J Henry Waugh
e6a1b88b4c Fully feature gate array string functions 2020-08-14 19:37:25 -05:00
J Henry Waugh
4de02c2bd7 Remove extra import 2020-08-14 16:30:00 -05:00
Stephen Chung
489b1ca00e Add Module::combine. 2020-08-15 00:08:00 +08:00
Stephen Chung
209d1a174c Yet more packages into plugins. 2020-08-15 00:04:10 +08:00
Stephen Chung
ceb1a26733 Move more packages to plugins. 2020-08-14 18:58:34 +08:00
Stephen Chung
c0dc47c9db Convert some packages into plugins. 2020-08-14 13:43:26 +08:00
Stephen Chung
2495b367e5 Merge branch 'plugins' of https://github.com/schungx/rhai into plugins 2020-08-14 13:40:33 +08:00
J Henry Waugh
b27ebb318d Rearrange imports to support no_std 2020-08-13 23:04:30 -05: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
fdcaa90cd9 Clean up plugin module for no_module macro support 2020-08-12 23:57:57 -05:00
J Henry Waugh
28572544d8 Split register export macro, add Engine support 2020-08-12 23:36:35 -05:00
J Henry Waugh
59e3ca0e79 Remove Dynamic::downcast_clone 2020-08-11 19:09:49 -05:00
Stephen Chung
a5b4d61dff Fix docs. 2020-08-11 13:46:09 +08:00
Stephen Chung
564d3bc339 Add more closure tests. 2020-08-09 22:12:50 +08:00
Ilya Lakhin
39ee74112c no-closure feature issue fixed 2020-08-09 18:42:33 +07:00
Ilya Lakhin
20cff87e14 False-positive capturing prevention bug fix 2020-08-09 18:35:29 +07:00
Stephen Chung
0e344ff3eb Merge branch 'master' into plugins 2020-08-08 23:01:48 +08:00
Stephen Chung
da3cce58d3 Minor refactor. 2020-08-08 22:59:05 +08:00
Stephen Chung
e66873bb83
Merge pull request #27 from Eliah-Lakhin/capturing-bug
Function names capturing as external variables bug
2020-08-08 22:52:20 +08:00
Ilya Lakhin
45d021c7ef Function names capturing as external variables bug 2020-08-08 17:55:58 +07:00
Stephen Chung
f68c5a699d Fix sync feature. 2020-08-08 17:04:21 +08:00
Stephen Chung
fbad20eb0d Merge branch 'master' into plugins 2020-08-08 16:26:52 +08:00
Stephen Chung
5a1a141ce3 Improve shared value treatment. 2020-08-08 16:24:10 +08:00
Stephen Chung
7b258ac410 Add more inlining. 2020-08-08 11:46:30 +08:00
Stephen Chung
5e6d5e8e80 Expand getter/setter/indexer API. 2020-08-07 11:10:38 +08:00
J Henry Waugh
75bcbb74eb Fix unrelated CI failure for features 2020-08-06 19:41:19 -05:00
J Henry Waugh
be315aebaf Fix breakage due to write_lock() 2020-08-06 18:36:19 -05:00
Stephen Chung
6475e4e20e Merge branch 'master' into plugins 2020-08-06 23:17:20 +08:00
Stephen Chung
b604ea3e93 Fix serde doc test. 2020-08-06 22:47:10 +08:00
Stephen Chung
130bcfe293 Fix serde. 2020-08-06 21:19:54 +08:00
Stephen Chung
4465a44673 Fix typos. 2020-08-06 10:31:32 +08:00
Stephen Chung
26c5b10ef7 Merge branch 'master' into plugins 2020-08-06 10:31:15 +08:00
Stephen Chung
2f395492de Simply error code. 2020-08-06 10:17:32 +08:00
Stephen Chung
ffe52bf437 Allow omitting the alias in import statement. 2020-08-05 23:23:53 +08:00
Stephen Chung
ae11dbbefe Fix feature flags. 2020-08-05 22:53:01 +08:00
Stephen Chung
5ea08d2b50 Bump version. 2020-08-05 17:55:36 +08:00
Stephen Chung
8a0d0e3e20 Unbox error return for Engine::register_custom_syntax. 2020-08-05 10:00:20 +08:00
Stephen Chung
9f302d4ef5 Update docs and tests. 2020-08-04 18:39:24 +08:00
Stephen Chung
b0ab6e95f5 Fix currying in map closure calls. 2020-08-04 18:38:33 +08:00
Stephen Chung
24346b9728 Merge branch 'master' into plugins 2020-08-04 16:51:22 +08:00
Stephen Chung
4878a69503 Add docs for closures. 2020-08-04 16:27:55 +08:00
Stephen Chung
3d6c83c6d8 Fix serde builds. 2020-08-04 09:47:48 +08:00
Stephen Chung
4a7bf893e6 Refine flatten clone for scope. 2020-08-03 23:13:09 +08:00
Stephen Chung
2aa08c0dd9 get_constant_value for FnPointer. 2020-08-03 23:12:42 +08:00
Stephen Chung
3b6d35368f Handle shared for loop variable. 2020-08-03 23:11:38 +08:00
Stephen Chung
abe74e7f44 Handle Dynamic::from(FnPtr). 2020-08-03 23:11:24 +08:00
Stephen Chung
e1a70fe958 Add FnPtr to standard packages. 2020-08-03 23:11:08 +08:00
Stephen Chung
3fc35c4f87 Merge from master. 2020-08-03 13:28:29 +08:00
Stephen Chung
dddd8133df Set unshared value in let/const statement. 2020-08-03 12:38:56 +08:00
Stephen Chung
4079164bfd Implement closures. 2020-08-03 12:10:20 +08:00
J Henry Waugh
3136188801 Improve proc macro hygiene 2020-08-02 19:27:35 -05:00
Stephen Chung
096eb4493e Engine::load_package API change. 2020-08-02 18:55:22 +08:00
Stephen Chung
5eed5fe6a3 Add plugins test. 2020-08-02 18:53:25 +08:00
Stephen Chung
747c0345f2 Do not convert a function call into a method call if the object is shared. 2020-08-02 13:51:07 +08:00
Stephen Chung
b86c87253b Prevent data races. 2020-08-02 13:33:51 +08:00
J Henry Waugh
d01203cb5d New Procedural Macros Crate v0.1 2020-08-01 11:52:32 -05:00
Stephen Chung
1daf91df30 Avoid storing shared value inside shared value. 2020-08-01 22:28:17 +08:00
Stephen Chung
cc53b21731 Avoid hard-coding variable type for shared. 2020-08-01 22:28:13 +08:00
Stephen Chung
af2f8acb5d Refine indexer set. 2020-08-01 12:21:15 +08:00
Stephen Chung
a2858e0fd3 Refine feature gates 2020-08-01 12:19:27 +08:00
Stephen Chung
5873bccd50 Fix no_index and no_object. 2020-07-31 23:37:30 +08:00
Stephen Chung
60891e694f Streamline code and feature gates. 2020-07-31 22:30:23 +08:00
Stephen Chung
8d0623d07f Add is_shared function. 2020-07-31 18:43:34 +08:00
Stephen Chung
0295e109ad Fix features 2020-07-31 18:06:01 +08:00
Stephen Chung
d563b878aa Fix no_std builds. 2020-07-31 17:26:49 +08:00
Stephen Chung
df8587ac91 Make sure both shared and take can be called in both styles. 2020-07-31 17:06:40 +08:00
Stephen Chung
e70e0ff4e2 Fixup. 2020-07-31 16:39:38 +08:00
Stephen Chung
871fcb38be Minor style changes and make sure no_shared works on all. 2020-07-31 16:03:08 +08:00
Ilya Lakhin
5d1f5cc2b4 Dynamic::read renamed to Dynamic::clone_inner_data 2020-07-31 13:10:05 +07:00
Ilya Lakhin
89f75bbf0c Merge remote-tracking branch 'schungx/closures' into closures 2020-07-31 13:05:16 +07:00
Ilya Lakhin
4f771d904a Code cleanup 2020-07-31 12:09:32 +07:00
Ilya Lakhin
ca64668e58 take() keyword; shared test with registered functions with callbacks 2020-07-31 11:41:22 +07:00
Stephen Chung
49392d57d7 Fix no_std feature. 2020-07-31 12:40:16 +08:00
Stephen Chung
cb005506e2 Simplify function calling. 2020-07-31 12:11:16 +08:00
Ilya Lakhin
060dd33046 Shared Dynamic tests and fixes in Engine; Also fixed a bug in Parser variable capturing 2020-07-31 10:47:22 +07:00
Ilya Lakhin
aa87a7f5ef Fixes in Engine to properly interpret Shared Dynamic 2020-07-31 10:47:22 +07:00
Ilya Lakhin
e5fe222de3 Shared variant of Dynamic type; All read/write access operations in Dynamic backed by Read/Write lock guards; new shared() script function 2020-07-31 10:47:14 +07:00
Stephen Chung
a7ff207636 Use Scope::flatten_clone for capturing. 2020-07-30 23:29:30 +08:00
Stephen Chung
7d4620d0d9 Unbounded -> unbound. 2020-07-30 23:29:11 +08:00
Stephen Chung
98b294c699 Implement capturing. 2020-07-30 18:18:28 +08:00
Stephen Chung
e505a06839 Add comparison operators to ImmutableString. 2020-07-30 13:28:25 +08:00
Stephen Chung
691e04292f Put externals in ScriptFnDef. 2020-07-30 13:28:06 +08:00
J Henry Waugh
5785fa6b74 Fix Plugins API for no_std 2020-07-29 16:57:13 -05:00
Stephen Chung
6e663eecb4 Fix fn_call. 2020-07-29 23:39:32 +08:00
Stephen Chung
d63f926701 Merge branch 'master' into plugins 2020-07-29 23:37:51 +08:00
Stephen Chung
721c578407 Use HashMap for externals. 2020-07-29 23:34:48 +08:00
Stephen Chung
1465ba2315 Refactor auto-currying. 2020-07-29 22:43:50 +08:00
Stephen Chung
a5a3bbd399
Merge pull request #19 from Eliah-Lakhin/closures
Autocurry feature
2020-07-29 21:24:43 +08:00
Ilya Lakhin
8fc16b40e6 Code style issues fixed 2020-07-29 20:17:18 +07:00
Ilya Lakhin
a856a8bbcb max_expr_depth bug fix 2020-07-29 19:04:33 +07:00
Ilya Lakhin
48356abc83 Autocurry fixes and test 2020-07-29 18:52:54 +07:00
Ilya Lakhin
8e51988b66 A prototype of a new feature to automatically curry of external scope variables 2020-07-29 16:56:32 +07:00
Stephen Chung
afbcd0fc0b Replace StaticVec with SmallVec. 2020-07-29 16:10:06 +08:00
Stephen Chung
4510d3a659 Merge branch 'master' into plugins 2020-07-29 14:17:40 +08:00
Stephen Chung
e2daba55d7 Refine unicode-xid-ident feature writeup. 2020-07-29 13:57:17 +08:00
Stephen Chung
eeb86f5efb Merge branch 'master' of https://github.com/jonathandturner/rhai 2020-07-29 11:43:48 +08:00
ekicyou
288e0a4d14 add unicode_xid, test 2020-07-29 08:25:37 +09:00
ekicyou
9b0375b870 add unicode-xid 2020-07-29 07:03:21 +09:00
ekicyou
79022b1858 refactoring 2020-07-29 06:54:23 +09:00
ekicyou
c6d5bd000d move is_valid_identifier 2020-07-29 06:24:41 +09:00
ekicyou
56a8120d75 add get_identifier 2020-07-29 05:26:57 +09:00
Stephen Chung
411539f3be Minimize usage of downcast_ref. 2020-07-28 19:11:46 +08:00
Stephen Chung
37ea24afe9 Improve docs. 2020-07-28 19:11:37 +08:00
Stephen Chung
0c703c0361 Merge branch 'master' into plugins 2020-07-28 11:08:57 +08:00
Stephen Chung
b63ff56e09 Make sure we keep the starting position of each statement (for future uses). 2020-07-28 10:26:20 +08:00
Stephen Chung
b70fd35f4a Revise docs. 2020-07-28 10:25:57 +08:00
Stephen Chung
f05cd1fdf3 Add shared and sync to reserved keywords. 2020-07-28 10:25:26 +08:00