Stephen Chung
4ec16d14e0
Fix custom syntax bug.
2023-04-25 23:14:08 +08:00
Stephen Chung
0206f776db
Add is_symbol_disabled and is_custom_keyword.
2023-04-11 11:38:48 +08:00
Stephen Chung
2e724b804e
Remove indirection.
2023-03-23 13:37:10 +08:00
Stephen Chung
41636eac55
Fine tune table-driven tokenizing.
2023-03-15 17:22:11 +08:00
Stephen Chung
fa4096e91e
Fine tune Engine size.
2023-03-07 16:52:37 +08:00
Stephen Chung
00f2b07d38
All symbols to start a custom syntax.
2023-02-20 13:28:17 +08:00
Stephen Chung
00c434eb71
Use Option<Token> instead of Token::NONE.
2022-12-27 22:51:38 +08:00
Stephen Chung
bb1136e8ad
Refine what can be called in method style.
2022-12-27 22:06:51 +08:00
Stephen Chung
30ff208104
Improve reify! syntax.
2022-12-09 16:41:01 +08:00
Stephen Chung
de0707f64f
Use macro auto_restore!.
2022-12-04 14:06:54 +08:00
Stephen Chung
0c85f0c796
Code cleanup and refactor.
2022-11-28 23:24:22 +08:00
Stephen Chung
d645d8271c
More code refactor.
2022-11-25 20:42:16 +08:00
Stephen Chung
6600862c22
Satisfy clippy.
2022-11-25 09:46:13 +08:00
Stephen Chung
2bf8e610a3
Reduce size of Engine.
2022-11-24 22:58:42 +08:00
Stephen Chung
3e7408511e
Satisfy more clippy.
2022-11-23 16:14:11 +08:00
Stephen Chung
ce046422f0
Add Dynamic::is_XXX API.
2022-11-09 12:44:57 +08:00
Stephen Chung
32493524ed
Code cleanup.
2022-10-30 22:16:09 +08:00
Stephen Chung
c9184db4d2
Refine native/script code splits.
2022-10-30 15:45:25 +08:00
Stephen Chung
c24794187f
Reduce unnecessary generics.
2022-10-20 15:31:57 +08:00
Stephen Chung
6c777e68d3
Refine inlining.
2022-09-28 12:06:22 +08:00
Stephen Chung
b56a9c22f3
Refactor.
2022-09-25 12:24:03 +08:00
Stephen Chung
c1ae9e0405
Add state to custom syntax.
2022-09-12 12:03:32 +08:00
Stephen Chung
bf5d6ab35a
Shut up clippy.
2022-08-27 16:26:41 +08:00
Stephen Chung
be448dfe4d
Use identifiers in format!
2022-08-11 19:01:23 +08:00
Stephen Chung
2f948a784c
Clean up more clippy.
2022-07-27 18:04:59 +08:00
Stephen Chung
39dee556c4
Clean up clippy.
2022-07-27 16:04:24 +08:00
Stephen Chung
8215c75a17
Merge branch 'main' of https://github.com/rhaiscript/rhai
2022-07-20 21:09:03 +08:00
quake
8d91e7eb63
chore: clippy fix useless_conversion
2022-07-20 21:28:40 +09:00
quake
299777f1c9
chore: clippy fix needless_borrow
2022-07-20 21:16:35 +09:00
Stephen Chung
ff6954d9d5
Fix doc comment links.
2022-07-18 23:01:03 +08:00
Stephen Chung
dda7bc7b85
Add eval_expression_tree_raw.
2022-07-06 12:56:15 +08:00
Stephen Chung
b4dbc7619a
Add no_custom_syntax.
2022-07-05 22:59:03 +08:00
Stephen Chung
7068775f19
Use locked_read.
2022-06-26 14:10:09 +08:00
Stephen Chung
7c8c6659ae
Better encapsulate EvalContext.
2022-05-17 16:21:17 +08:00
Stephen Chung
4194e2c048
Refine data structures.
2022-05-07 15:54:44 +08:00
Stephen Chung
4f74d2f96a
Minor cleanup.
2022-05-02 12:14:53 +08:00
Stephen Chung
daf73d5341
Make caches optional for EvalContext.
2022-04-16 23:32:14 +08:00
Stephen Chung
855cb76246
Rename EvalState to Caches.
2022-04-16 16:36:53 +08:00
Stephen Chung
8bda8c64df
Refine data structures
2022-03-05 17:57:23 +08:00
Stephen Chung
0e9a16e437
Add checks for is_empty.
2022-03-03 13:02:57 +08:00
Stephen Chung
73f10b8adc
Minor housekeeping.
2022-02-24 10:36:20 +08:00
Stephen Chung
97a8fd3d5b
Improve reify syntax.
2022-02-08 09:25:53 +08:00
Stephen Chung
f8cee0fe4e
Simplify using ..
2022-02-08 09:02:15 +08:00
Stephen Chung
becbfa8930
Fix errors.
2022-02-06 23:02:59 +08:00
Nathan Kent
86d86a85e4
Remove unsound casting functions
...
The casting functions in `unsafe.rs` were unsound (i.e., they allowed
safe code to cause undefined behavior). While they did appear to be used
in a way that wouldn't cause UB the fact that there exists unsound
functions is unsettling.
This commit removes those functions and replaces it with a macro that
performs the same reification - the difference is that the macro call
will also include the checks which are required to prevent UB. A macro
was chosen instead of a function for two reasons:
1. A macro can keep the same code generation whereas a function would
require going through an `Option` which has negative impacts on code
generation (niche values cause poor DCE).
2. There exist other `unsafe` code blocks in the crate and an attempt to
make Rhai 100% safe is completely out-of-scope for this merge
request, so we may as well use `unsafe` in the macro.
Regarding (2) above, I may come back at a later date with a 100% safe
`reify` function but only once the other `unsafe` blocks are removed.
For posterity, said function would look something like:
```rust
fn reify<A: Any, C>(value: A) -> Option<C> {
let mut v = Some(value);
let v: &mut dyn Any = &mut v;
v.downcast_mut::<Option<C>>().map(Option::take)
}
```
2022-02-05 16:29:05 -08:00
Stephen Chung
6b02dde848
Gate dead code for no_module.
2022-01-29 11:09:43 +08:00
Stephen Chung
fb0b071fe0
Add lifetimes to GlobalRuntimeState and EvalState for future needs.
2022-01-22 17:48:07 +08:00
Stephen Chung
a267ac5e54
Split Engine into eval folder.
2022-01-07 11:43:47 +08:00
Stephen Chung
d99953c101
Fixup AsRef<str> vs &str.
2022-01-04 15:22:48 +08:00
Stephen Chung
29f1328087
Simplify Dynamic::from for better inlining.
2022-01-02 20:47:03 +08:00