Replace Either with std::variant (#1731)

This commit is contained in:
Rangi
2025-07-08 13:59:03 -04:00
committed by GitHub
parent 35962dedc4
commit fda54fd0c3
17 changed files with 94 additions and 271 deletions

View File

@@ -8,9 +8,9 @@
#include <optional>
#include <stdint.h>
#include <string>
#include <variant>
#include <vector>
#include "either.hpp"
#include "platform.hpp" // SSIZE_MAX
// This value is a compromise between `LexerState` allocation performance when `mmap` works, and
@@ -97,7 +97,7 @@ struct LexerState {
bool expandStrings;
std::deque<Expansion> expansions; // Front is the innermost current expansion
Either<ViewedContent, BufferedContent> content;
std::variant<std::monostate, ViewedContent, BufferedContent> content;
~LexerState();