Commit Graph

657 Commits

Author SHA1 Message Date
Stephen Chung
dee66a409f Add case alternatives for switch. 2022-07-04 17:42:24 +08:00
Stephen Chung
0031678cd4 Fix shared variable assignment. 2022-06-26 18:09:15 +08:00
Stephen Chung
335957fbc2 Enable modifying constant shared values. 2022-06-26 17:04:08 +08:00
Stephen Chung
2b44778a5c Add elvis operator for indexing. 2022-06-12 00:32:12 +08:00
Stephen Chung
b9cbeb65d6 Use Option instead of once/empty. 2022-06-11 16:01:15 +08:00
Stephen Chung
8999872d62 Add null coalescing operator. 2022-06-10 11:22:33 +08:00
Stephen Chung
0f1e51b1c9 Support Elvis operator. 2022-06-10 10:26:06 +08:00
Stephen Chung
dcaac20eb9 Strict mode in functions check for static modules. 2022-06-09 17:59:28 +08:00
Stephen Chung
84e3296559 Fix bug on chaining function calls returning shared values. 2022-06-07 11:31:46 +08:00
Stephen Chung
6ebe002b18 Check for missing docs. 2022-06-05 18:17:44 +08:00
Stephen Chung
e4d492c727 Fix no_object build. 2022-05-23 22:58:15 +08:00
Geoffroy Couprie
f2b5566c0b use smartstring's deserializer to support non borrowed strings
The map visitor for Dynamic was expecting a &str for the key, but the
serde_json deserializer internally uses a Cow string, which can be
Borrowed or Owned. In the case of Owned, the serde_json key deserializer
is calling visit_string on the Visitor, which for &str will result in
the error:
Error("invalid type: string \"a\", expected a borrowed string", line: 0,
column: 0)

smartstring actually has its own Visitor implementation that handles
both cases, so we can use it instead of an explicit conversion.
2022-05-23 16:40:49 +02:00
Stephen Chung
1abec0a8a8 Allow initialization of EvalState tag and separate debugger state into separate variable. 2022-05-21 21:44:12 +08:00
Stephen Chung
5435fdb8c8 Fix tests. 2022-05-21 11:57:23 +08:00
Stephen Chung
9c1a49da0b Fix AST combine. 2022-05-21 11:31:15 +08:00
Stephen Chung
42d2718e24 Fix test. 2022-05-19 16:56:22 +08:00
Stephen Chung
a53bcc2e1d Add EvalAltResult::IndexNotFound. 2022-05-19 10:02:12 +08:00
Stephen Chung
591f7d7362 Add tests for index type checks. 2022-05-17 15:20:32 +08:00
Stephen Chung
b23d64bec0 Fix bug with using self-contained AST with call_fn. 2022-05-05 21:34:15 +08:00
Stephen Chung
516f5a82a0 Use tag for debugger state. 2022-05-03 21:55:01 +08:00
Stephen Chung
4f74d2f96a Minor cleanup. 2022-05-02 12:14:53 +08:00
Stephen Chung
c69f98c2c4 Add custom state. 2022-05-02 00:03:45 +08:00
Stephen Chung
5a75479119 Fix bug in Scope cloning. 2022-04-23 11:53:17 +08:00
Stephen Chung
a6c2c00479 Allow variables in scope for strict vars. 2022-04-22 12:12:36 +08:00
Stephen Chung
6f4cc91451 Fix builds. 2022-04-21 16:01:20 +08:00
Stephen Chung
6b8ddd925b Allow scope constants in strict variables mode. 2022-04-21 13:21:53 +08:00
Stephen Chung
4f2764d233 Revise parse_json. 2022-04-21 10:04:57 +08:00
Stephen Chung
5e4f27ae25 Add Token::Unit. 2022-04-21 10:04:46 +08:00
Stephen Chung
3ff1ce0a19 Fix compound assignments with indexers. 2022-04-14 22:55:39 +08:00
Stephen Chung
42f977862f Add Dynamic parameters to qualified function calls. 2022-04-08 16:42:53 +08:00
Stephen Chung
95753bb9c3 Use global module constants in optimization. 2022-03-28 12:53:52 +08:00
Stephen Chung
5caf20d26b Search for global variables in global modules. 2022-03-27 21:49:34 +08:00
Stephen Chung
fefa633cf0 Add type alias support for plugin modules. 2022-03-19 09:43:18 +08:00
Stephen Chung
1e4abd012c Minor refactor. 2022-03-09 09:25:55 +08:00
Stephen Chung
0335035b0f Fix bug with eager optimization of method calls. 2022-03-04 12:22:44 +08:00
Stephen Chung
8205547d8a Use bitflags. 2022-02-25 11:42:59 +08:00
Stephen Chung
dd566ed1e1 Fix builds. 2022-02-19 12:26:17 +08:00
Stephen Chung
67a6638818 Allow variable to overwrite constant when shadowing. 2022-02-18 19:14:42 +08:00
Stephen Chung
bb04fab011 Optimize variable shadowing. 2022-02-18 15:04:46 +08:00
Stephen Chung
0d2e3d82f3 Reduce size of Stmt. 2022-02-16 17:51:14 +08:00
Stephen Chung
fb9964e1a3 Revise on_def_var API. 2022-02-15 10:56:05 +08:00
Stephen Chung
5bb6ce835f Run var def filter during parsing. 2022-02-13 18:46:25 +08:00
Stephen Chung
340a047369 Add fail on invalid property for maps. 2022-02-09 13:12:43 +08:00
Stephen Chung
7686ca619a Use .. for (_). 2022-02-08 09:46:14 +08:00
Stephen Chung
f8cee0fe4e Simplify using .. 2022-02-08 09:02:15 +08:00
Stephen Chung
40bec9f017 Fix tests. 2022-02-04 23:02:00 +08:00
Stephen Chung
be9356727f Add variable definition filter. 2022-02-04 22:59:41 +08:00
Stephen Chung
3be27746e0 Add allow_shadowing. 2022-02-04 13:20:47 +08:00
Stephen Chung
e0ed713bb6 Fix builds. 2022-02-02 14:57:30 +08:00
Stephen Chung
4a80483749 Support call stack and FunctionExit for native functions. 2022-02-02 14:47:35 +08:00