We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6b3b402 commit 7eefb5cCopy full SHA for 7eefb5c
1 file changed
lib/source/pl/core/token.cpp
@@ -112,6 +112,9 @@ namespace pl::core {
112
113
std::strong_ordering Token::Literal::operator<=>(const Literal &other) const {
114
return std::visit(wolv::util::overloaded {
115
+ [](std::shared_ptr<ptrn::Pattern> lhs, std::shared_ptr<ptrn::Pattern> rhs) {
116
+ return lhs->getOffset() <=> rhs->getOffset();
117
+ },
118
[]<typename T>(T lhs, T rhs) -> std::strong_ordering {
119
if (lhs == rhs) return std::strong_ordering::equal;
120
if (lhs < rhs) return std::strong_ordering::less;
@@ -158,7 +161,7 @@ namespace pl::core {
158
161
}
159
162
},
160
163
[](auto, auto) -> std::strong_ordering {
- return std::strong_ordering::less;
164
+ return std::strong_ordering::equal;
165
166
}, *this, other);
167
0 commit comments