Improvements with regex system.
This commit is contained in:
@@ -4,20 +4,18 @@
|
||||
#include "vase/shard.h"
|
||||
|
||||
struct RegexGroup {
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
bool matched;
|
||||
uint32_t start{UINT32_MAX};
|
||||
uint32_t end{UINT32_MAX};
|
||||
};
|
||||
|
||||
struct RegexMatch {
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
std::vector<RegexGroup> groups{};
|
||||
RegexGroup groups[9]{};
|
||||
};
|
||||
|
||||
const std::vector<RegexMatch> regex_search(
|
||||
std::vector<RegexMatch> regex_search(
|
||||
Shard *root, std::string_view pattern_str,
|
||||
uint32_t start_offset, uint32_t end_offset,
|
||||
std::string_view options
|
||||
);
|
||||
void print_regex(const std::vector<RegexMatch> &matches);
|
||||
|
||||
@@ -4,20 +4,20 @@
|
||||
#include "pch.h"
|
||||
|
||||
struct Shard {
|
||||
enum struct ShardKind {
|
||||
enum struct ShardKind : uint8_t {
|
||||
Branch,
|
||||
Petal
|
||||
} kind;
|
||||
|
||||
uint8_t height;
|
||||
|
||||
uint32_t length;
|
||||
uint32_t lines;
|
||||
|
||||
uint8_t height;
|
||||
|
||||
std::atomic_uint32_t refs;
|
||||
|
||||
Shard(ShardKind kind, uint32_t length, uint32_t lines, uint8_t height)
|
||||
: kind(kind), length(length), lines(lines), height(height), refs(1) {};
|
||||
: kind(kind), height(height), length(length), lines(lines), refs(1) {};
|
||||
|
||||
virtual ~Shard() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user