Commit Graph

217 Commits

Author SHA1 Message Date
Stephen Chung
28de155f08 Add Expr::DynamicConstant. 2020-11-14 19:04:49 +08:00
Stephen Chung
55b4907f19 Add switch expression. 2020-11-13 18:32:18 +08:00
Stephen Chung
7d1b971b39 More interned strings. 2020-11-13 10:43:54 +08:00
Stephen Chung
41c815f355 Optimize in-place. 2020-11-12 12:37:42 +08:00
Stephen Chung
958762079e Change modules to namespace. 2020-11-10 23:26:50 +08:00
Stephen Chung
e69444293c Encapsulate imported modules into AST. 2020-11-09 21:52:23 +08:00
Stephen Chung
4b622a8830 Enable export let/export const short-hand. 2020-11-09 12:21:11 +08:00
Stephen Chung
b3d318ef7f Module resolver returns shared module. 2020-11-07 23:33:21 +08:00
Stephen Chung
07a8a43298 Optimize data structures. 2020-11-06 16:27:40 +08:00
Stephen Chung
b390586bcc Fix optimization of Stmt::Expr. 2020-11-04 13:11:37 +08:00
Stephen Chung
c287a61b93 Streamline ScriptFnDef. 2020-11-04 12:34:54 +08:00
Stephen Chung
2168fd5361 Expr::Stmt takes a statements block. 2020-11-04 11:49:02 +08:00
Stephen Chung
f74d947c6b Fix constant assignment. 2020-11-03 13:08:19 +08:00
Stephen Chung
b9de8eaa7f Minor code refactor. 2020-11-02 23:54:19 +08:00
Stephen Chung
cc304ba513 Fix serde build. 2020-11-02 13:18:37 +08:00
Stephen Chung
d7d6f74dfd Add constant NO_POS. 2020-11-02 12:50:27 +08:00
Stephen Chung
717e8e7eee Remove unnecessary clone. 2020-11-01 22:55:19 +08:00
Stephen Chung
c55fc5a9a5 Optimize Scope. 2020-11-01 22:46:46 +08:00
Stephen Chung
42eac410b7 Optimize Expr. 2020-10-31 23:26:21 +08:00
Stephen Chung
89811c8dfc Pack Stmt and Expr some more. 2020-10-31 14:13:45 +08:00
Stephen Chung
4e115d2bc2 Code structure refactor. 2020-10-29 11:37:51 +08:00
Stephen Chung
f5ffbfbe06 Code structure cleanup. 2020-10-28 22:18:44 +08:00
Stephen Chung
f56c3fe9cb Add Ident/IdentX to AST. 2020-10-28 19:11:17 +08:00
Stephen Chung
00b1051732 Optimize Stmt/Expr reflections. 2020-10-28 14:10:48 +08:00
Stephen Chung
51fca1e757 Move Assignment to Stmt. 2020-10-27 23:21:20 +08:00
Stephen Chung
fd2ba54b49 Introduce BinaryExpr. 2020-10-27 23:00:05 +08:00
Stephen Chung
f62f7908ab Pack Stmt tighter. 2020-10-27 19:23:43 +08:00
Stephen Chung
93b5df6b3c Pack Stmt structure. 2020-10-27 18:18:19 +08:00
Stephen Chung
01663a6581 Refine docs. 2020-10-27 11:30:38 +08:00
Stephen Chung
07bdb824fe Add try-catch. 2020-10-20 23:16:03 +08:00
Stephen Chung
92ba7b42d5 Implement namespaces chain. 2020-10-20 10:54:32 +08:00
Stephen Chung
3c7805d514 Encapsulate environment in ScriptFnDef. 2020-10-13 09:38:14 +08:00
Stephen Chung
612ecc4ebc Move StaticVec definition to lib.rs. 2020-10-10 13:41:55 +08:00
Stephen Chung
95c4ac4180 Fix no_float bug in time. 2020-10-09 13:47:35 +08:00
Stephen Chung
59b380b130 Allow propagation for pushed scope constants. 2020-10-09 13:26:32 +08:00
Stephen Chung
7ede299aae Allow expressions in constants. 2020-10-09 11:15:25 +08:00
Stephen Chung
1272eeb81a Add/remove #[inline] attributes. 2020-10-08 22:25:50 +08:00
Stephen Chung
ae1157a140 Remove Expr::get_constant_str and change Expr::get_constant_value not to panic. 2020-10-06 22:09:26 +08:00
Stephen Chung
b67a743306 Do not eagerly evaluate is_def_fn and is_def_var. 2020-10-05 12:14:34 +08:00
Stephen Chung
29bf790286 Fix no_function build. 2020-10-05 12:09:45 +08:00
Stephen Chung
0d0affd5e9 Eagerly evaluate built-in operators for OptimizationLevel::Simple. 2020-10-05 10:27:31 +08:00
Stephen Chung
03dce86328 Support Dynamic as function default return value. 2020-09-26 16:27:38 +08:00
Stephen Chung
6a53c446d3 Fix no_function build. 2020-09-24 23:32:54 +08:00
Stephen Chung
c4ec93080e New FileModuleResolver. 2020-09-24 22:50:28 +08:00
Stephen Chung
db59aed14e Fix bug in optimizer for if statements with empty true blocks. 2020-09-14 22:24:55 +08:00
Stephen Chung
ae11dbbefe Fix feature flags. 2020-08-05 22:53:01 +08:00
Stephen Chung
4079164bfd Implement closures. 2020-08-03 12:10:20 +08:00
Stephen Chung
60891e694f Streamline code and feature gates. 2020-07-31 22:30:23 +08:00
Stephen Chung
cb005506e2 Simplify function calling. 2020-07-31 12:11:16 +08:00
Stephen Chung
98b294c699 Implement capturing. 2020-07-30 18:18:28 +08:00
Stephen Chung
691e04292f Put externals in ScriptFnDef. 2020-07-30 13:28:06 +08:00
Stephen Chung
1465ba2315 Refactor auto-currying. 2020-07-29 22:43:50 +08:00
Stephen Chung
afbcd0fc0b Replace StaticVec with SmallVec. 2020-07-29 16:10:06 +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
a3a167424b Allow Rust functions in FnPtr::call_dynamic. 2020-07-27 12:52:32 +08:00
Stephen Chung
6b600704a3 Avoid warnings. 2020-07-26 15:53:22 +08:00
Stephen Chung
a58207aaa9 Change ScriptFnDef to use ImmutableString. 2020-07-25 14:06:13 +08:00
Stephen Chung
bff266d4e1 Move function calling to separate source file. 2020-07-23 18:40:42 +08:00
Stephen Chung
61a1355c59 Add no-std example. 2020-07-21 22:32:24 +08:00
Stephen Chung
e6c3f8134d Avoid copying property name for map property access. 2020-07-21 20:59:12 +08:00
Stephen Chung
cf36dc5a57 Support for anonymous functions. 2020-07-19 17:14:55 +08:00
Stephen Chung
8449f8c55e Make API chainable. 2020-07-12 11:46:53 +08:00
Stephen Chung
ebffbf0f98 Refine docs and add custom syntax. 2020-07-10 22:01:47 +08:00
Stephen Chung
99164ebceb Add custom syntax. 2020-07-09 19:54:28 +08:00
Stephen Chung
4052ad3df1 Assignments return () and no compound assignments. 2020-07-05 23:07:02 +08:00
Stephen Chung
d626bf9f5b Refine no_function feature. 2020-07-04 16:21:15 +08:00
Stephen Chung
aac04a5e53 Remove modules from Scope and use separate stack. 2020-06-27 23:56:24 +08:00
Stephen Chung
175c3ccaec OOP support. 2020-06-26 10:39:18 +08:00
Stephen Chung
58c198776f Code cleanup. 2020-06-25 11:07:46 +08:00
Stephen Chung
7cc1a3f5dc Change Map keys to ImmutableString to facilitate fast keys(). 2020-06-21 16:37:05 +08:00
Stephen Chung
56eb659d5a Unify all functions into CallableFunction type, remove FunctionsLib. 2020-06-05 15:14:42 +08:00
Stephen Chung
b70d38e820 Avoid passing position until error. 2020-06-01 15:25:22 +08:00
Stephen Chung
c6e5f672c9 More benchmarks and examples. 2020-05-31 23:44:49 +08:00
Stephen Chung
13c49387ef Add OptimizationLevel::is_simple 2020-05-31 12:36:31 +08:00
Stephen Chung
2bcc51cc45 Fix bug in index expressions. 2020-05-30 10:27:48 +08:00
Stephen Chung
95e67c48bd Optimize op-assignment statement. 2020-05-25 20:14:31 +08:00
Stephen Chung
99ea2b33c9 Use immutable strings. 2020-05-25 13:44:28 +08:00
Stephen Chung
0374311cf6 Optimize hot path of operators calling. 2020-05-24 16:40:00 +08:00
Stephen Chung
1798d4d6a0 Fix function call optimizations. 2020-05-24 11:57:46 +08:00
Stephen Chung
b49e1e199a Build-in certain common operators. 2020-05-23 18:59:28 +08:00
Stephen Chung
ab76a69b12 Avoid repeating empty TypeId's when calculating hash. 2020-05-19 20:07:51 +08:00
Stephen Chung
3295060dba Unify all functions under CallableFunction type. 2020-05-19 19:03:06 +08:00
Stephen Chung
a22f338b03 Back out NativeCallable trait. 2020-05-19 10:13:37 +08:00
Stephen Chung
8b5550eeb6 Complete StaticVec implementation. 2020-05-17 22:19:49 +08:00
Stephen Chung
a2c50879fe Fix dropping issues with StaticVec and use it everywhere. 2020-05-17 00:24:07 +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
9d8d074940 Consistent naming of methods. 2020-05-13 20:22:05 +08:00
Stephen Chung
30e5e2f034 Use modules to implement packages. 2020-05-13 19:21:42 +08:00
Stephen Chung
996a54279c Pre-calculate property getter/setter function names. 2020-05-13 10:19:18 +08:00
Stephen Chung
33c9be7efc Reformat. 2020-05-11 23:48:50 +08:00
Stephen Chung
4a8710a4a9 Create NativeCallable trait. 2020-05-11 13:36:50 +08:00
Stephen Chung
8aa0e2ceb4 Use StaticVec to avoid most allocations with function arguments. 2020-05-10 21:25:47 +08:00
Stephen Chung
80debbc432 Refactor. 2020-05-10 00:19:13 +08:00
Stephen Chung
a7bfac21bd Reducing boxing and sizes of Expr/Stmt. 2020-05-09 21:46:38 +08:00
Stephen Chung
79f39bd702 Pre-calculate function call hashes. 2020-05-09 16:15:50 +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
d75a8bc6cd Make sure all features compile correctly. 2020-05-06 19:45:17 +08:00
Stephen Chung
38e717a838 Build Module type plus engine hooks. 2020-05-05 15:00:10 +08:00