Commit Graph

80 Commits

Author SHA1 Message Date
Stephen Chung
976f3a7f6d Avoid an allocation in each function registration. 2020-04-20 12:43:34 +08:00
Stephen Chung
d3d62c7dd9 Anticipate number of functions to be registered. 2020-04-19 13:40:11 +08:00
Stephen Chung
f5fff828e8 Box errors to reduce return type footprint. 2020-04-18 00:14:33 +08:00
Stephen Chung
3a93ab8240 Make FunctionsLib a HashMap. 2020-04-16 23:58:57 +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
5796e520ec Support Dynamic return values. 2020-04-13 10:27:08 +08:00
Stephen Chung
5152a40e93 Change Dynamic to enum. 2020-04-12 23:00:06 +08:00
Stephen Chung
81894e52cb Do not optimize single-use AST's. 2020-04-10 21:02:38 +08:00
Stephen Chung
ff8eca8a5e Add parse_json. 2020-04-10 17:14:07 +08:00
Stephen Chung
adbfceb5be Do not omit error enum variants. 2020-04-10 12:16:39 +08:00
Stephen Chung
518725e119 Add support for anonymous functions in Rust. 2020-04-08 23:01:48 +08:00
Stephen Chung
660ce6cc79 Change parameter input to script. 2020-04-08 16:57:15 +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
44d6a5e466 Reduce cloning. 2020-04-05 17:44:48 +08:00
Stephen Chung
e0514a4ec0 Remove ref modifiers. 2020-04-05 12:37:07 +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
d1cffac420 Reduce overhead of Engine by not creating hash maps until used. 2020-04-04 13:05:20 +08:00
Stephen Chung
c6216c0823 Add back doc for on_print and on_debug. 2020-04-03 17:18:30 +08:00
Stephen Chung
a79f2a209c Make Engine Send+Sync. 2020-04-03 17:17:00 +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
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
9f3113b11c Encapsulate getters/setters. 2020-03-30 16:10:50 +08:00
Stephen Chung
ef6c6ea6d2 Add no_object feature to disable objects. 2020-03-29 17:15:12 +08:00
Stephen Chung
a541a4507f Remove internal function. 2020-03-27 16:46:19 +08:00
Stephen Chung
337a96394f Limit function calls depth. 2020-03-27 14:34:01 +08:00
Stephen Chung
56df5c49c8 Encapsulate FunctionsLib to hold script-defined functions. 2020-03-26 20:26:05 +08:00
Stephen Chung
a5a161ec88 Format getter/setter function name using constants. 2020-03-26 10:55:33 +08:00
Stephen Chung
d21f66b911 Fixing lint warnings 2020-03-24 16:57:35 +08:00
Stephen Chung
7b06715299 FIX - Errors in no_std. 2020-03-24 11:21:09 +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
ed996e71d6 Enable dot operations on constant variables. 2020-03-20 19:27:02 +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
019e73bc7e Allow empty statements. 2020-03-18 18:41:18 +08:00
Stephen Chung
a9c65a962c Split no_stdlib and no_std into two features. 2020-03-18 12:04:26 +08:00
Stephen Chung
d2951bfb6b Make sure return is not an error. 2020-03-18 10:40:07 +08:00
Trangar
c8a9df0a0a Added no_std support 2020-03-17 19:26:11 +01:00
Stephen Chung
706e0a0c4c Make sure return is not an error. 2020-03-17 16:52:06 +08:00
Stephen Chung
372321dfe3 Add full optimization level for aggressive optimizing. 2020-03-15 22:39:58 +08:00
Stephen Chung
360fab7760 Merge branch 'chained-assignments' 2020-03-14 14:41:48 +08:00
Stephen Chung
cb6171ebcd Merge branch 'constants' 2020-03-14 14:33:56 +08:00
Stephen Chung
b3a22d942a Allow AST optimization based on external Scope. 2020-03-14 14:30:44 +08:00