1
0
Fork 0

Add comments with precedence levels

This commit is contained in:
Vili Sinervä 2025-01-31 15:42:09 +02:00
parent 22083ae1f2
commit 9e8df0750f
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996

View file

@ -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 {