mirror of
https://github.com/tstack/lnav
synced 2024-11-01 21:40:34 +00:00
[data_scanner] fix DT_H1 detection
Fix a broken refactor
This commit is contained in:
parent
016bca01db
commit
8391de3ad6
@ -251,7 +251,6 @@ public:
|
|||||||
metadata walk()
|
metadata walk()
|
||||||
{
|
{
|
||||||
metadata_builder mb;
|
metadata_builder mb;
|
||||||
data_token_t dt = DT_INVALID;
|
|
||||||
size_t garbage_count = 0;
|
size_t garbage_count = 0;
|
||||||
|
|
||||||
while (garbage_count < 1000) {
|
while (garbage_count < 1000) {
|
||||||
@ -260,6 +259,7 @@ public:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto dt = tokenize_res->tr_token;
|
||||||
element el(tokenize_res->tr_token, tokenize_res->tr_capture);
|
element el(tokenize_res->tr_token, tokenize_res->tr_capture);
|
||||||
|
|
||||||
switch (dt) {
|
switch (dt) {
|
||||||
|
@ -210,6 +210,7 @@ CREATE TABLE lnav_file (
|
|||||||
loo.loo_include_in_session = true;
|
loo.loo_include_in_session = true;
|
||||||
this->lf_collection.fc_file_names[path] = std::move(loo);
|
this->lf_collection.fc_file_names[path] = std::move(loo);
|
||||||
lf->set_filename(path);
|
lf->set_filename(path);
|
||||||
|
this->lf_collection.regenerate_unique_file_names();
|
||||||
|
|
||||||
init_session();
|
init_session();
|
||||||
load_session();
|
load_session();
|
||||||
|
@ -45,7 +45,7 @@ detect_text_format(string_fragment sf,
|
|||||||
static const auto MARKDOWN_EXT = ghc::filesystem::path(".markdown");
|
static const auto MARKDOWN_EXT = ghc::filesystem::path(".markdown");
|
||||||
|
|
||||||
static const auto MAN_MATCHERS = lnav::pcre2pp::code::from_const(
|
static const auto MAN_MATCHERS = lnav::pcre2pp::code::from_const(
|
||||||
R"(^[A-Z]+\(\d\)\s+)", PCRE2_MULTILINE);
|
R"(^[A-Za-z][A-Za-z\-_\+0-9]+\(\d\)\s+)", PCRE2_MULTILINE);
|
||||||
|
|
||||||
// XXX This is a pretty crude way of detecting format...
|
// XXX This is a pretty crude way of detecting format...
|
||||||
static const auto PYTHON_MATCHERS = lnav::pcre2pp::code::from_const(
|
static const auto PYTHON_MATCHERS = lnav::pcre2pp::code::from_const(
|
||||||
|
@ -125,6 +125,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
auto meta = lnav::document::discover_structure(INPUT, line_range{0, -1});
|
auto meta = lnav::document::discover_structure(INPUT, line_range{0, -1});
|
||||||
|
|
||||||
|
CHECK(meta.m_sections_root->hn_named_children.size() == 3);
|
||||||
meta.m_sections_tree.visit_all([](const auto& intv) {
|
meta.m_sections_tree.visit_all([](const auto& intv) {
|
||||||
auto ser = intv.value.match(
|
auto ser = intv.value.match(
|
||||||
[](const std::string& name) { return name; },
|
[](const std::string& name) { return name; },
|
||||||
|
Loading…
Reference in New Issue
Block a user