Commit Graph

555 Commits

Author SHA1 Message Date
Stephen Chung
9844ae8665 Add constants. 2020-03-13 18:12:41 +08:00
Jarkko Kuukkanen
6c72e3c48b
Change filename to path for clarity 2020-03-13 12:07:51 +02:00
Jarkko Kuukkanen
8c1c37666d
Make every file evaluation use PathBuf instead of str 2020-03-13 11:53:14 +02:00
Stephen Chung
2a181e5aab FIX - fix minus/negative number conflict. 2020-03-13 16:54:00 +08:00
Stephen Chung
9bd66c7db3 Minor improvements to the optimizer. 2020-03-12 23:46:52 +08:00
Stephen Chung
91317c0d3e New sample script - primes.rhai. 2020-03-12 23:46:40 +08:00
Stephen Chung
da440a5dff Add optimization section to README. 2020-03-12 21:19:34 +08:00
Stephen Chung
7e9a4fd965 Improve repl with command to print AST. 2020-03-12 15:31:01 +08:00
Stephen Chung
55dcd2f0f4 Fix call_fn calls with only one argument. 2020-03-12 15:30:42 +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
e24d3a7ade Allow overloading of script functions. 2020-03-12 13:02:13 +08:00
Stephen Chung
1765d302b9 Minor refactor. 2020-03-12 12:40:28 +08:00
Stephen Chung
66edd28fb3 Do not optimize AST for dump_ast. 2020-03-12 12:39:33 +08:00
Stephen Chung
4662b9bd0c Fine tune some tests. 2020-03-12 12:35:30 +08:00
Stephen Chung
0d1a240292 Expand range function to cover all integer types. 2020-03-12 12:32:26 +08:00
Stephen Chung
a02c0cfaa0 More optimizations. 2020-03-11 23:43:10 +08:00
Stephen Chung
952932f64c Reduce cloning. 2020-03-11 23:43:04 +08:00
Stephen Chung
dbfc38763a Merge branch 'min-build' 2020-03-11 14:43:25 +08:00
Stephen Chung
fbb0808884 Merge branch 'master' of https://github.com/schungx/rhai 2020-03-11 14:36:10 +08:00
Stephen Chung
defa29b28f Do not track .cargo. 2020-03-11 14:29:21 +08:00
Stephen Chung
7c4d22d98a Add no_function feature to disable script-defined functions. 2020-03-11 13:28:12 +08:00
Stephen Chung
047f064cd1 Add dump_ast function for debugging. 2020-03-11 11:39:15 +08:00
Stephen Chung
880bce1114 General cleanup. 2020-03-11 11:03:18 +08:00
Stephen Chung
708c285a0a Add only_i32 and only_i64 features. 2020-03-10 23:06:20 +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
f3bcb2a10d Simplify call_fn API, no need to pass &mut references. 2020-03-10 14:09:05 +08:00
Stephen Chung
faf78ccdd3
Merge pull request #105 from schungx/master
Fixes and cleanup plus an optimizer.
2020-03-10 11:32:24 +08:00
Stephen Chung
711cd9bb1c Improve repl and rhai_runner examples with error messages. 2020-03-10 11:25:34 +08:00
Stephen Chung
2d80ee2f18 Refine optimizer. 2020-03-10 11:22:41 +08:00
Stephen Chung
feaad4e0da Group use of std under one root. 2020-03-10 10:07:44 +08:00
Stephen Chung
bae9946291 Allow engine to retain functions across runs. 2020-03-10 09:30:12 +08:00
Stephen Chung
55e7af7b04 Add AST optimizer. 2020-03-09 21:57:07 +08:00
Stephen Chung
c467ffd58d Comment out optimizer for successful build. 2020-03-09 21:52:43 +08:00
Stephen Chung
5b5fd162be Use ? operator in tests. 2020-03-09 21:09:53 +08:00
Stephen Chung
63482d5a79 Use ? operator for examples. 2020-03-09 16:54:43 +08:00
Stephen Chung
1ca9db4379 Fix i64.powi() to i64.pos() 2020-03-09 14:15:32 +08:00
Stephen Chung
a6899afb11 Refine README. 2020-03-09 12:53:07 +08:00
Stephen Chung
b9d562eba4 Add standard math functions and make power functions checked. 2020-03-09 11:42:10 +08:00
Stephen Chung
e54fb54da2 Catch indexing errors at compile time. 2020-03-09 10:41:17 +08:00
Stephen Chung
01d04f717b Natively handle negative numbers in tokenizer instead of the neg() function. 2020-03-09 10:10:19 +08:00
Stephen Chung
c5b40783ef Add unchecked feature to remove arithmetic operations checking. 2020-03-08 23:14:18 +08:00
Stephen Chung
b1b25d3043 Add fallible functions support and replace most arithmetic operations with checked versions. 2020-03-08 22:47:13 +08:00
Stephen Chung
3e7adc2e51 More comments in code. 2020-03-08 19:54:02 +08:00
Stephen Chung
daa581bac7 Add append to strings. 2020-03-08 09:19:04 +08:00
Stephen Chung
a264abffa4 Allow arbitrary number of indexing in dot getter chain. 2020-03-07 23:57:01 +08:00
Stephen Chung
eed7bef974 Allow chaining of indexing (one level) and dotting. 2020-03-07 22:50:46 +08:00
Stephen Chung
df6950f8f7 Fix arrayindexed property access. 2020-03-07 20:55:03 +08:00
Stephen Chung
d055638e83 Properly detect invalid assignment LHS at compile time. 2020-03-07 17:32:15 +08:00