diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-23 08:07:54 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-01-23 08:07:54 +0100 |
| commit | 912b5bab6074d3bb2758c3d489009760d8c519d9 (patch) | |
| tree | 69d9454e864b2ccf56eebacf1e093e460a090cc4 /lib | |
| parent | 9660a01f4bcc514b70fe83fb64dc91659cf2bfa2 (diff) | |
| download | tools.nes-912b5bab6074d3bb2758c3d489009760d8c519d9.tar.gz tools.nes-912b5bab6074d3bb2758c3d489009760d8c519d9.zip | |
Add support for a single equal sign operator
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/xixanta/src/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/xixanta/src/parser.rs b/lib/xixanta/src/parser.rs index d508003..8672923 100644 --- a/lib/xixanta/src/parser.rs +++ b/lib/xixanta/src/parser.rs @@ -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)), |
