<, <=, > and >= are ordered to happen before == and != instead of defaulting to left-to-right

This commit is contained in:
mark 2023-05-23 19:12:26 +02:00
parent 14d1995d8b
commit 07a443a60b

View File

@ -944,8 +944,8 @@ pub mod implementation {
) )
.to() .to()
} }
// 050 == != > >= < <= // 045 > >= < <=
(0..=50, Some('>')) => { (0..=45, Some('>')) => {
file.next(); file.next();
SStatementEnum::FunctionCall( SStatementEnum::FunctionCall(
if let Some('=') = file.peek() { if let Some('=') = file.peek() {
@ -954,11 +954,11 @@ pub mod implementation {
} else { } else {
"gt".to_owned() "gt".to_owned()
}, },
vec![out, parse_statement_adv(file, false, 51)?], vec![out, parse_statement_adv(file, false, 46)?],
) )
.to() .to()
} }
(0..=50, Some('<')) => { (0..=45, Some('<')) => {
file.next(); file.next();
SStatementEnum::FunctionCall( SStatementEnum::FunctionCall(
if let Some('=') = file.peek() { if let Some('=') = file.peek() {
@ -967,10 +967,11 @@ pub mod implementation {
} else { } else {
"lt".to_owned() "lt".to_owned()
}, },
vec![out, parse_statement_adv(file, false, 51)?], vec![out, parse_statement_adv(file, false, 46)?],
) )
.to() .to()
} }
// 050 == !=
(0..=50, Some('=')) (0..=50, Some('='))
if matches!( if matches!(
file.get_char(file.get_pos().current_char_index + 1), file.get_char(file.get_pos().current_char_index + 1),