2021-03-12 12:28:20 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-03-12 12:28:20 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "Token.h"
|
|
|
|
|
|
|
|
|
|
namespace Cpp {
|
|
|
|
|
|
|
|
|
|
bool Position::operator<(const Position& other) const
|
|
|
|
|
{
|
|
|
|
|
return line < other.line || (line == other.line && column < other.column);
|
|
|
|
|
}
|
|
|
|
|
bool Position::operator>(const Position& other) const
|
|
|
|
|
{
|
|
|
|
|
return !(*this < other) && !(*this == other);
|
|
|
|
|
}
|
|
|
|
|
bool Position::operator==(const Position& other) const
|
|
|
|
|
{
|
|
|
|
|
return line == other.line && column == other.column;
|
|
|
|
|
}
|
2021-05-09 21:40:27 +03:00
|
|
|
bool Position::operator<=(const Position& other) const
|
|
|
|
|
{
|
|
|
|
|
return !(*this > other);
|
|
|
|
|
}
|
2021-03-12 12:28:20 +02:00
|
|
|
}
|