text reader passes tests
This commit is contained in:
@@ -15,15 +15,15 @@ namespace spider {
|
||||
/** @brief Indicates if the token composition successfully matched the input boundary. */
|
||||
bool success = false;
|
||||
|
||||
optional<std::string_view> tag;
|
||||
optional<std::string_view> tag = {};
|
||||
|
||||
/**
|
||||
* @brief Holds the deep-copied UTF-32 matching substring upon victory.
|
||||
* @note Returns empty when success is false.
|
||||
*/
|
||||
std::u32string match;
|
||||
std::u32string match = U"";
|
||||
|
||||
vector<TokenResult> child;
|
||||
vector<TokenResult> child = {};
|
||||
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace spider {
|
||||
std::vector<std::unique_ptr<Token>> arena;
|
||||
|
||||
// Deduplication caches
|
||||
std::unordered_map<std::string, const Token*> lit_cache;
|
||||
std::unordered_map<std::string, Token*> lit_cache;
|
||||
|
||||
public:
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace spider {
|
||||
|
||||
public:
|
||||
|
||||
TagToken(const Token* t, std::string_view tag, bool doflatten = false);
|
||||
TagToken(const Token* t, std::string_view tag, bool doflatten);
|
||||
|
||||
TokenResult test(TextReader& ctx) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user