1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! Value Expr
//!
//! ## DSL
//!
//! ```dsl
//! Value:
//! i32
//! | Unary
//! | Binary
//! | Assign
//! | Paren
//! | FuncLike
//! | Ident
//! Unary:
//! - Value
//! | ! Value
//! Binary:
//! Value + Value
//! | Value - Value
//! | Value * Value
//! | Value / Value
//! | Value % Value
//! | Value ^ Value
//! | Value & Value
//! | Value | Value
//! | Value << Value
//! | Value >> Value
//! | Value == Value
//! | Value != Value
//! | Value > Value
//! | Value < Value
//! | Value >= Value
//! | Value <= Value
//! | Value && Value
//! | Value || Value
//! Assign:
//! Ident = Value
//! | Ident += Value
//! | Ident -= Value
//! | Ident *= Value
//! | Ident /= Value
//! | Ident %= Value
//! | Ident ^= Value
//! | Ident &= Value
//! | Ident |= Value
//! | Ident <<= Value
//! | Ident >>= Value
//! Paren:
//! ( Values )
//! FuncLike:
//! Ident ( Values )
//! Values:
//! <nothing>
//! | ValuesNext
//! ValuesNext:
//! Value
//! | Value , ValuesNext
//! Ident:
//! <the rust lang ident>
//! ```
//!
//! ## Binary
//!
//! Here is the precedence of binary operators, going from strong to weak.
//! Operators at the same precedence level are all left-associative.
//!
//! If you're unsure about operator precedence, use parentheses to explicitly enforce the desired evaluation order.
//!
//! When mixing numerical and logical operations, any numeric value not 0 is considered true, otherwise false.
//! The logical value true corresponds to 1 numerically, while false corresponds to 0.
//!
//! | Operator | Remark |
//! | -------- | ------- |
//! | `*` `/` `%` | arithmetic |
//! | `+` `-` | arithmetic |
//! | `<<` `>>` | bit shift |
//! | `&` | bit and|
//! | `^` | bit xor |
//! | `\|` | bit or |
//! | `==` `!=` `>` `<` `>=` `<=` | compare |
//! | `&&` | logical and |
//! | `\|\|` | logical or |
//!
//! ## Assign
//!
//! Assign Operators all right-associative.
//!
//! ## FuncLike
//!
//! FuncLike, a function-like object, is similar to a function in that it takes multiple parameters.
//!
//! The difference is that it allows lazy evaluation, enabling you to freely control the order of evaluation.
//!
pub use ContextHelper;
pub use ;
pub use ;