Skip to content

Commit

Permalink
Add <> as an alternate syntax for !=
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Mar 6, 2024
1 parent e5f4f62 commit 211c066
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ fn parse_symbol(ch: char, input: &mut &str) -> FResult<Token> {
'<' => {
if test_next('<') {
Symbol::ShiftLeft
} else if test_next('>') {
Symbol::NotEquals
} else {
return Err(FendError::UnexpectedChar(ch));
}
Expand Down
1 change: 1 addition & 0 deletions core/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5889,6 +5889,7 @@ fn test_equality() {
test_eval("1 + 2 == 3", "true");
test_eval("1 + 2 != 4", "true");
test_eval("1 + 2 ≠ 4", "true");
test_eval("1 + 2 <> 4", "true");
test_eval("true == false", "false");
test_eval("true != false", "true");
test_eval("true ≠ false", "true");
Expand Down

0 comments on commit 211c066

Please sign in to comment.