Skip to content

Commit

Permalink
Add support for a single equal sign operator
Browse files Browse the repository at this point in the history
Signed-off-by: Miquel Sabaté Solà <[email protected]>
  • Loading branch information
mssola committed Jan 23, 2025
1 parent 9660a01 commit 912b5ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/xixanta/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,10 @@ impl Parser {
},
'=' => match second {
'=' => Ok((Some(NodeType::Operation(OperationType::Equal)), 2)),
_ => Err(self.parser_error(format!("unknown operator '={}'", second).as_str())),
// 'ca65' allows a single '=' for comparison as well. This is in
// my humble opinion bad, but existing code uses this, so let's
// add support for it.
_ => Ok((Some(NodeType::Operation(OperationType::Equal)), 1)),
},
'!' => match second {
'=' => Ok((Some(NodeType::Operation(OperationType::NotEqual)), 2)),
Expand Down

0 comments on commit 912b5ba

Please sign in to comment.