Skip to content

Commit

Permalink
more peeking
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Jul 25, 2024
1 parent dee8d07 commit 92c5f23
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions crates/hdx_parser/src/comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@ impl<'a> Parse<'a> for Comparison {
Ok(if match_token_kind_and_char!(next, Kind::Delim, '=') {
Comparison::Equal
} else if match_token_kind_and_char!(next, Kind::Delim, '>') {
if let (Kind::Delim, Some('=')) =
(parser.peek_with(Include::Whitespace).kind(), parser.peek_with(Include::Whitespace).char())
{
let peek = parser.peek_with(Include::Whitespace);
if match_token_kind_and_char!(peek, Kind::Delim, '=') {
parser.advance_with(Include::Whitespace);
Comparison::GreaterThanEqual
} else {
Comparison::GreaterThan
}
} else if match_token_kind_and_char!(next, Kind::Delim, '<') {
if let (Kind::Delim, Some('=')) =
(parser.peek_with(Include::Whitespace).kind(), parser.peek_with(Include::Whitespace).char())
{
let peek = parser.peek_with(Include::Whitespace);
if match_token_kind_and_char!(peek, Kind::Delim, '=') {
parser.advance_with(Include::Whitespace);
Comparison::LessThanEqual
} else {
Expand Down

0 comments on commit 92c5f23

Please sign in to comment.