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>],
|
||||
) -> Expression<'source> {
|
||||
const OPS: [&[&str]; 8] = [
|
||||
&["="],
|
||||
&["or"],
|
||||
&["and"],
|
||||
&["==", "!="],
|
||||
&["<", "<=", "=>", ">"],
|
||||
&["+", "-"],
|
||||
&["*", "/", "%"],
|
||||
&["not", "-"],
|
||||
&["="], // 0
|
||||
&["or"], // 1
|
||||
&["and"], // 2
|
||||
&["==", "!="], // 3
|
||||
&["<", "<=", "=>", ">"], // 4
|
||||
&["+", "-"], // 5
|
||||
&["*", "/", "%"], // 6
|
||||
&["not", "-"], // 7
|
||||
// 8
|
||||
];
|
||||
|
||||
match level {
|
||||
|
|
Reference in a new issue