Add comments with precedence levels
This commit is contained in:
parent
22083ae1f2
commit
9e8df0750f
1 changed files with 9 additions and 8 deletions
|
@ -28,14 +28,15 @@ fn parse_expression<'source>(
|
||||||
tokens: &[Token<'source>],
|
tokens: &[Token<'source>],
|
||||||
) -> Expression<'source> {
|
) -> Expression<'source> {
|
||||||
const OPS: [&[&str]; 8] = [
|
const OPS: [&[&str]; 8] = [
|
||||||
&["="],
|
&["="], // 0
|
||||||
&["or"],
|
&["or"], // 1
|
||||||
&["and"],
|
&["and"], // 2
|
||||||
&["==", "!="],
|
&["==", "!="], // 3
|
||||||
&["<", "<=", "=>", ">"],
|
&["<", "<=", "=>", ">"], // 4
|
||||||
&["+", "-"],
|
&["+", "-"], // 5
|
||||||
&["*", "/", "%"],
|
&["*", "/", "%"], // 6
|
||||||
&["not", "-"],
|
&["not", "-"], // 7
|
||||||
|
// 8
|
||||||
];
|
];
|
||||||
|
|
||||||
match level {
|
match level {
|
||||||
|
|
Reference in a new issue