Commit Graph

51 Commits

Author SHA1 Message Date
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
bc0d43d68f Simplify code. 2020-04-11 18:09:03 +08:00
Stephen Chung
4b2cff715e Optimize property access for object maps. 2020-04-10 21:02:13 +08:00
Stephen Chung
adbfceb5be Do not omit error enum variants. 2020-04-10 12:16:39 +08:00
Stephen Chung
3609150dcf Bump version to 0.12.0. 2020-04-09 18:45:49 +08:00
Stephen Chung
e0bb2e5c97 Change optimize_ast to take optimization level as parameter. 2020-04-08 09:30:50 +08:00
Stephen Chung
e795a50ae2 Make Engine reentrant to prepare for parallel execution. 2020-04-07 13:23:06 +08:00
Stephen Chung
e204ae1a2c Add 'in' expression. 2020-04-06 17:47:34 +08:00
Stephen Chung
32672b184b Avoid copying strings. 2020-04-06 12:29:01 +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
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
92b549b828 Add features info in docs. 2020-04-03 19:42:01 +08:00
Stephen Chung
d7ac57c060 Minor code cleanup. 2020-04-01 09:51:33 +08:00
Stephen Chung
45ee51874f Add object maps. 2020-03-29 23:53:35 +08:00
Stephen Chung
ef6c6ea6d2 Add no_object feature to disable objects. 2020-03-29 17:15:12 +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
5aea997672 Refine Scope API. 2020-03-25 11:27:18 +08:00
Stephen Chung
d21f66b911 Fixing lint warnings 2020-03-24 16:57:35 +08:00
Stephen Chung
3677bd3651 Make Token smaller by boxing LexError. 2020-03-24 09:49:37 +08:00
Stephen Chung
b6320c0eef Minor fine tuning. 2020-03-22 10:18:16 +08:00
Stephen Chung
283602cdd8 Do not call function when optimizing if there is a script-defined function overridding it. 2020-03-19 22:29:02 +08:00
Stephen Chung
6a6c5f30de Add eval function. 2020-03-19 19:53:42 +08:00
Stephen Chung
019e73bc7e Allow empty statements. 2020-03-18 18:41:18 +08:00
Stephen Chung
ca20faf170 Add code comments. 2020-03-18 10:43:59 +08:00
Stephen Chung
8efe080412 Handle break and return better. 2020-03-18 10:42:27 +08:00
Stephen Chung
b26ca753c2 Mandatory semiclolons separating statements. 2020-03-18 10:40:07 +08:00
Stephen Chung
c3d4a1b5e9 Optimize type_of. 2020-03-18 10:40:07 +08:00
Trangar
c8a9df0a0a Added no_std support 2020-03-17 19:26:11 +01:00
Stephen Chung
08abf07f83 Add string literal indexing and functon default value to optimizer. 2020-03-16 12:41:52 +08:00
Stephen Chung
372321dfe3 Add full optimization level for aggressive optimizing. 2020-03-15 22:39:58 +08:00
Stephen Chung
01cf777961 Use matches! macro. 2020-03-14 23:41:15 +08:00
Stephen Chung
dd36f3387a Fixup code to make sure all feature builds succeed. 2020-03-14 20:06:40 +08:00
Stephen Chung
360fab7760 Merge branch 'chained-assignments' 2020-03-14 14:41:48 +08:00
Stephen Chung
b3a22d942a Allow AST optimization based on external Scope. 2020-03-14 14:30:44 +08:00
Stephen Chung
d5adee2209 Allow chained assignments. 2020-03-14 11:51:45 +08:00
Stephen Chung
9844ae8665 Add constants. 2020-03-13 18:12:41 +08:00
Stephen Chung
9bd66c7db3 Minor improvements to the optimizer. 2020-03-12 23:46:52 +08:00
Stephen Chung
560da5fdc6 Allow call_fn with only one parameter; consume can retain functions, eval cannot. 2020-03-12 14:54:14 +08:00
Stephen Chung
66edd28fb3 Do not optimize AST for dump_ast. 2020-03-12 12:39:33 +08:00
Stephen Chung
a02c0cfaa0 More optimizations. 2020-03-11 23:43:10 +08:00
Stephen Chung
880bce1114 General cleanup. 2020-03-11 11:03:18 +08:00
Stephen Chung
e22aaca5c1 Make sure all tests run with all features. 2020-03-10 19:48:47 +08:00
Stephen Chung
cc772c6e2a Add no_float feature to disable floating-point. 2020-03-10 18:32:01 +08:00
Stephen Chung
52b5732bcb Add no_inidex feature to disable arrays and indexing. 2020-03-10 17:10:33 +08:00
Stephen Chung
2d80ee2f18 Refine optimizer. 2020-03-10 11:22:41 +08:00