Commit Graph

503 Commits

Author SHA1 Message Date
Stephen Chung
2c0215ea3f Shrink arrays and use boxed slices. 2021-05-05 18:38:52 +08:00
Stephen Chung
bb5dc7b637 Add tag to Dynamic. 2021-05-02 23:57:35 +08:00
Stephen Chung
61b559a58f Refine op-assignment. 2021-04-24 11:55:40 +08:00
Stephen Chung
cc1f941875 Optimize op-assignment. 2021-04-23 23:37:10 +08:00
Stephen Chung
a54fbb32ff Add no_position feature. 2021-04-22 23:02:25 +08:00
Stephen Chung
815f7ba09e Remove Expr::FnPointer. 2021-04-20 23:40:52 +08:00
Stephen Chung
ce384d8bb0 Change FnPtr to SmartString. 2021-04-20 23:28:04 +08:00
Stephen Chung
8f1bff2ded Change hash to hashes. 2021-04-20 22:26:08 +08:00
Stephen Chung
8ff1f57900 Remove redundant std. 2021-04-20 19:19:35 +08:00
Stephen Chung
a186eb8d97 Fix hanging when parsing unterminated statements block. 2021-04-20 11:22:38 +08:00
Stephen Chung
01f0cc028b Use no-std-compat to build no-std. 2021-04-17 15:15:54 +08:00
Stephen Chung
2f2b7403cb Streamline as_mut to &mut. 2021-04-17 13:54:24 +08:00
Stephen Chung
2b10c5c6c1 Correct position of negative numbers. 2021-04-16 21:59:05 +08:00
Stephen Chung
208e5fdbf4 New switch errors. 2021-04-16 13:28:36 +08:00
Stephen Chung
1f987ec61a Streamine StmtBlock. 2021-04-16 13:15:11 +08:00
Stephen Chung
980a13ca42 Add switch case conditions. 2021-04-16 12:04:33 +08:00
Stephen Chung
8da4c0c2b2 Default switch case must be last. 2021-04-16 09:41:02 +08:00
Stephen Chung
6b4553ffc8 Fix panic with unterminated interpolated string. 2021-04-10 17:47:44 +08:00
Stephen Chung
40fda5139d Support negative index counting from end. 2021-04-10 15:00:03 +08:00
Stephen Chung
29d186b361 Put doc-comments under metadata flag. 2021-04-09 22:49:47 +08:00
Stephen Chung
f17a826f99 Refine debug print-out. 2021-04-06 23:18:41 +08:00
Stephen Chung
d3cfb3c605 Optimize position in variable access. 2021-04-05 23:59:15 +08:00
Stephen Chung
94fc5af285 Store short index in variable access. 2021-04-05 23:06:48 +08:00
Stephen Chung
00784d39ad PropertyExpected for map literal with interpolated key. 2021-04-05 14:51:26 +08:00
Stephen Chung
e6ea006ac6 Fix builds. 2021-04-05 00:05:56 +08:00
Stephen Chung
bc9c1ab850 Add external control interface for tokenizer. 2021-04-04 23:08:27 +08:00
Stephen Chung
20aaf1826a Fix builds. 2021-04-04 15:06:13 +08:00
Stephen Chung
e6c878edf3 Implement string interpolation. 2021-04-04 13:13:07 +08:00
Stephen Chung
a738f750f9 Implement string functions with to_string/to_debug. 2021-04-02 19:26:55 +08:00
Stephen Chung
a049f7b5ba Optimize data structures. 2021-03-30 23:55:29 +08:00
Stephen Chung
e36e490a30 Support back-tick at EOL for literal strings. 2021-03-30 13:59:27 +08:00
Stephen Chung
d756b7bac6 Rename FnWrongDefinition to WrongFnDefinition. 2021-03-30 11:39:00 +08:00
Stephen Chung
e306a92ea0 Change Map keys to Identifier. 2021-03-29 17:14:22 +08:00
Stephen Chung
41b48d591f Change to no_smartstring feature. 2021-03-29 17:13:54 +08:00
Stephen Chung
07efdddba3 Add smartstring default feature. 2021-03-29 13:40:33 +08:00
Stephen Chung
fc6c5ecd00 Fix no_closure builds. 2021-03-29 13:07:10 +08:00
Stephen Chung
e5249cc1ae Extract Identifier type. 2021-03-29 11:36:02 +08:00
Stephen Chung
241f5abe10 Change function call name into ImmutableString from Cow<str>. 2021-03-28 23:06:59 +08:00
Stephen Chung
7bdc2e3d20 Extract constant arguments from function calls. 2021-03-28 19:04:25 +08:00
Stephen Chung
c4fe1782df Streamline string handling. 2021-03-24 13:17:52 +08:00
Stephen Chung
0d7f2c16cc Reduce indirections. 2021-03-23 20:04:54 +08:00
Stephen Chung
f9429c06f9 Use template for object map literal. 2021-03-23 18:25:40 +08:00
Stephen Chung
f70225ca1d Change HashMap to BTreeMap. 2021-03-23 12:13:53 +08:00
Stephen Chung
6667a22c0c Code style and docs. 2021-03-17 13:30:47 +08:00
Stephen Chung
d9df6aabc8 Change precedence to own type. 2021-03-14 10:47:29 +08:00
Stephen Chung
85fcb74be9 Furtuer optimize data structure sizes. 2021-03-12 14:11:08 +08:00
Stephen Chung
728ed81173 Optimize layout. 2021-03-10 22:12:48 +08:00
Stephen Chung
cbad703b00 Flatten data structures and more aggressive inlining. 2021-03-10 13:32:09 +08:00
Stephen Chung
352408fd36 Flatten statement blocks. 2021-03-10 12:27:10 +08:00
Stephen Chung
2ff2789326 Fix Stmt size. 2021-03-09 23:48:40 +08:00
Stephen Chung
b11b8d6d39 Reduce redirections in Stmt. 2021-03-09 23:30:48 +08:00
Stephen Chung
975bb3d6bf Map in operator to contains function call. 2021-03-09 13:44:54 +08:00
Stephen Chung
62928f8613 Revise function hashing. 2021-03-08 15:30:32 +08:00
Stephen Chung
330d3f87af Use namespace for ScriptFnDef. 2021-03-07 22:10:54 +08:00
Stephen Chung
a126d05c3f Skip evaluate condition for loop statement. 2021-03-06 16:05:22 +08:00
Stephen Chung
0589572d19 Refine inlining. 2021-03-04 18:13:47 +08:00
Stephen Chung
4ac05aee8b Disallow implicit comparisons between different numeric types. 2021-02-24 15:45:29 +08:00
Stephen Chung
6f876e85cc Always call native for op-assignment operators. 2021-02-23 20:32:50 +08:00
Stephen Chung
bd5ff457d2 Built-in interop between FLOAT/Decimal and INT. 2021-02-19 11:47:26 +08:00
Stephen Chung
3650b04c38 Add Decimal number type. 2021-02-13 20:57:56 +08:00
Stephen Chung
e88e65f36e Fix bug with parsing empty statements. 2021-02-09 14:08:17 +08:00
Stephen Chung
7b87f81850 Add has_override and script calls to function resolution cache. 2021-02-07 15:09:27 +08:00
Stephen Chung
c5e2620d0f Minor code refactors. 2021-02-03 19:14:26 +08:00
Stephen Chung
42058836ba Fix panic in property access parsing error. 2021-01-31 18:44:50 +08:00
Stephen Chung
e902c74073 Add threading example. 2021-01-25 11:31:54 +08:00
Stephen Chung
c245fe88fd Allow stacking ! operators. 2021-01-24 21:21:15 +08:00
Stephen Chung
fe65bf6137 Fix bug in optimizer. 2021-01-12 23:52:50 +08:00
Stephen Chung
a5d6392107 Use NonZero for limits. 2021-01-06 13:46:53 +08:00
Stephen Chung
cf9d35166d Remove hashing of the entire script by making Expr and Stmt Hash. 2021-01-04 11:58:24 +08:00
Stephen Chung
e2a47b2a65 Disallow duplicated function definitions. 2021-01-03 20:54:08 +08:00
Stephen Chung
ef48f47b74 Refine docs and comments etc. 2021-01-02 23:30:10 +08:00
Stephen Chung
13f5cec291 Fix call stack limits. 2020-12-29 12:29:45 +08:00
Stephen Chung
eca8212f38 More code refinements. 2020-12-29 10:41:20 +08:00
Stephen Chung
e481a8019d Simplify code and better error messages. 2020-12-28 14:21:13 +08:00
Stephen Chung
5c813ca7c0 Code cleanup. 2020-12-28 09:49:54 +08:00
Stephen Chung
6b8d78d64c Streamline parsing. 2020-12-27 16:50:48 +08:00
Stephen Chung
48af8719e7 Fix closure property access. 2020-12-27 11:50:24 +08:00
Stephen Chung
66d3af256e Enhance custom operators. 2020-12-26 23:21:09 +08:00
Stephen Chung
dc4e52e795 Code enhancements. 2020-12-26 13:05:57 +08:00
Stephen Chung
822fe80105 Reduce redirections. 2020-12-25 11:02:29 +08:00
Stephen Chung
8f969b1ab5 Reduce indirections. 2020-12-24 23:22:50 +08:00
Stephen Chung
363085efc3 Map actual 0 hash to 42. 2020-12-24 18:43:04 +08:00
Stephen Chung
8506640073 Use NonZeroU64 for function hashes. 2020-12-24 16:32:43 +08:00
Stephen Chung
2e7ec8f1db IdentX -> Ident. 2020-12-22 16:45:56 +08:00
Stephen Chung
10da4d8976 LexError directly to ParseError. 2020-12-22 11:55:51 +08:00
Stephen Chung
2955a4ab64 Fix unary operators binding. 2020-12-21 17:39:37 +08:00
Stephen Chung
db7b9cb0f9 Native only if function call is not a valid identifier. 2020-12-18 23:03:56 +08:00
Stephen Chung
882b26d2a1 Change ScriptFnMetadata to hold references. 2020-12-18 16:31:44 +08:00
Stephen Chung
f8c14ba1c4 Add look-ahead to custom syntax parser. 2020-12-15 19:23:30 +08:00
Stephen Chung
ecc08271d9 Include actual tokens in custom syntax node. 2020-12-13 14:31:24 +08:00
Stephen Chung
87174de051 Add doc-comment to function metadata. 2020-12-12 20:09:29 +08:00
Stephen Chung
26449a9f1c Add ScriptFnMetadata. 2020-12-12 18:44:28 +08:00
Stephen Chung
bed29da71a Use ImmutableString. 2020-12-11 12:57:07 +08:00
Stephen Chung
dbee0eb0f5 Rename AccessType to ReadWrite and ReadOnly. 2020-12-09 18:37:52 +08:00
Stephen Chung
f22a04fc74 Move constancy into Dynamic. 2020-12-08 22:47:38 +08:00
Stephen Chung
36546c7325 Fix builds 2020-11-27 23:37:59 +08:00
Stephen Chung
a0979d0c35 Code cleanup 2020-11-25 09:36:06 +08:00
Stephen Chung
0046fe7e73 Prefer Engine::disable_symbol to disable eval. 2020-11-21 15:08:18 +08:00
Stephen Chung
2be757fda0 Make shadowing variables in custom syntax work. 2020-11-21 13:05:57 +08:00
Stephen Chung
6069a4cf55 do loop. 2020-11-20 22:23:37 +08:00