<commit_before>#ifndef AB_PARSE_LOCATION_HPP_
#define AB_PARSE_LOCATION_HPP_

#include <cstddef>
#include <string_view>

namespace Ab::Parse {

/// A position into the input. An offset from the start.
/// @see-also Location
///
class SrcPos {
public:
	SrcPos() = default;

	constexpr explicit SrcPos(std::size_t offset) : offset_(offset) {}

	std::size_t get() const noexcept { return offset_; }

private:
	std::size_t offset_;
};

/// helper constructor for src_pos.
///
constexpr SrcPos src_pos(std::size_t offset) { return SrcPos(offset); }

constexpr bool operator==(const SrcPos& lhs, const SrcPos& rhs) { return lhs.get() == rhs.get(); }

constexpr bool operator!=(const SrcPos& lhs, const SrcPos& rhs) { return lhs.get() != rhs.get(); }

constexpr std::size_t operator-(const SrcPos& lhs, const SrcPos& rhs) {<commit_msg>Make function constexpr<commit_after>#ifndef AB_PARSE_LOCATION_HPP_
#define AB_PARSE_LOCATION_HPP_

#include <cstddef>
#include <string_view>

namespace Ab::Parse {

/// A position into the input. An offset from the start.
/// @see-also Location
///
class SrcPos {
public:
	SrcPos() = default;

	constexpr explicit SrcPos(std::size_t offset) : offset_(offset) {}

	constexpr std::size_t get() const noexcept { return offset_; }

private:
	std::size_t offset_;
};

/// helper constructor for src_pos.
///
constexpr SrcPos src_pos(std::size_t offset) { return SrcPos(offset); }

constexpr bool operator==(const SrcPos& lhs, const SrcPos& rhs) { return lhs.get() == rhs.get(); }

constexpr bool operator!=(const SrcPos& lhs, const SrcPos& rhs) { return lhs.get() != rhs.get(); }

constexpr std::size_t operator-(const SrcPos& lhs, const SrcPos& rhs) {
{'fraction_non_alphanumeric': 0.13842482100238662, 'fraction_numerical': 0.0, 'mean_word_length': 4.904929577464789, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5280576', 'n_tokens_mistral': 592, 'n_tokens_neox': 582, 'n_words': 165}