diff --git a/src/common/io/graph/cigar.inl b/src/common/io/graph/cigar.inl index d5e12c386..4c13a768a 100644 --- a/src/common/io/graph/cigar.inl +++ b/src/common/io/graph/cigar.inl @@ -35,13 +35,13 @@ namespace cigar::grammar { auto integer = dsl::if_(dsl::lit_c < '-' > ) + dsl::digits<>.no_leading_zero(); auto fraction = dsl::lit_c < '.' > >> dsl::digits<>; auto exp_char = dsl::lit_c < 'e' > | dsl::lit_c<'E'>; - auto exponent = exp_char >> (dsl::lit_c < '+' > | dsl::lit_c < '-' > ) + dsl::digits<>; + auto exponent = exp_char >> ((dsl::lit_c < '+' > | dsl::lit_c < '-' > ) + dsl::digits<>); return dsl::peek(dsl::lit_c < '-' > / dsl::digit<>) >> - dsl::position + + (dsl::position + integer + dsl::if_(fraction) + dsl::if_(exponent) + - dsl::position; + dsl::position); }(); static constexpr auto value = lexy::callback( @@ -64,17 +64,17 @@ namespace cigar::grammar { static constexpr auto rule = [] { auto colon = dsl::lit_c<':'>; - return dsl::p >> colon + - ( - dsl::capture(LEXY_LIT("A")) >> colon + dsl::p < tag_character > | - dsl::capture(LEXY_LIT("i")) >> colon + dsl::p < tag_integer > | - dsl::capture(LEXY_LIT("f")) >> colon + dsl::p < tag_float > | - dsl::capture(LEXY_LIT("Z")) >> colon + dsl::p < tag_string > | - dsl::capture(LEXY_LIT("J")) >> colon + dsl::p < tag_string > | - dsl::capture(LEXY_LIT("H")) >> colon + dsl::p < tag_string > | - dsl::capture(LEXY_LIT("B")) >> colon + dsl::p < tag_string > | + return dsl::p >> ( + colon + ( + dsl::capture(LEXY_LIT("A")) >> (colon + dsl::p < tag_character >) | + dsl::capture(LEXY_LIT("i")) >> (colon + dsl::p < tag_integer >) | + dsl::capture(LEXY_LIT("f")) >> (colon + dsl::p < tag_float >) | + dsl::capture(LEXY_LIT("Z")) >> (colon + dsl::p < tag_string >) | + dsl::capture(LEXY_LIT("J")) >> (colon + dsl::p < tag_string >) | + dsl::capture(LEXY_LIT("H")) >> (colon + dsl::p < tag_string >) | + dsl::capture(LEXY_LIT("B")) >> (colon + dsl::p < tag_string >) | dsl::error - ); + )); }(); static constexpr auto value = lexy::callback( @@ -101,7 +101,7 @@ namespace cigar::grammar { static constexpr auto value = lexy::callback( []() { return cigar::cigarop{0, 0}; }, [](std::uint32_t cnt, auto lexeme) { - return cigar::cigarop{cnt, lexeme[0]}; + return cigar::cigarop{cnt & 0xFFFFFF, lexeme[0]}; }); }; @@ -116,7 +116,7 @@ namespace cigar::grammar { static constexpr auto rule = [] { auto tags = dsl::list(dsl::p, dsl::trailing_sep(tab)); - return dsl::eof | (tab >> tags + dsl::eof); + return dsl::eof | (tab >> (tags + dsl::eof)); }(); static constexpr auto value = lexy::as_list>; }; diff --git a/src/common/io/graph/gfa.cpp b/src/common/io/graph/gfa.cpp index 850e2497b..99b0cc45f 100644 --- a/src/common/io/graph/gfa.cpp +++ b/src/common/io/graph/gfa.cpp @@ -80,11 +80,11 @@ struct segment { static constexpr auto name = "GFA segment"; static constexpr auto rule = - LEXY_LIT("S") >> + LEXY_LIT("S") >> ( tab + dsl::p + tab + (LEXY_LIT("*") | dsl::identifier(dsl::ascii::alpha)) + - dsl::p; + dsl::p); static constexpr auto value = lexy::construct; }; @@ -103,13 +103,13 @@ struct link { static constexpr auto name = "GFA link line"; static constexpr auto rule = - LEXY_LIT("L") >> + LEXY_LIT("L") >> ( tab + dsl::p + tab + dsl::p + tab + dsl::p + tab + dsl::p + tab + (LEXY_LIT("*") | dsl::p) + - dsl::p; + dsl::p); static constexpr auto value = lexy::construct; }; @@ -127,13 +127,13 @@ struct gaplink { static constexpr auto name = "GFA jump line"; static constexpr auto rule = - LEXY_LIT("J") >> + LEXY_LIT("J") >> ( tab + dsl::p + tab + dsl::p + tab + dsl::p + tab + dsl::p + tab + (LEXY_LIT("*") | (dsl::else_ >> dsl::p)) + - dsl::p; + dsl::p); static constexpr auto value = lexy::construct; }; @@ -159,11 +159,11 @@ struct path { }; static constexpr auto rule = - LEXY_LIT("P") >> + LEXY_LIT("P") >> ( tab + dsl::p + tab + dsl::p + tab + (LEXY_LIT("*") | dsl::p) + - dsl::p; + dsl::p); static constexpr auto value = lexy::construct; }; @@ -209,14 +209,14 @@ struct walk { }; static constexpr auto rule = - LEXY_LIT("W") >> + LEXY_LIT("W") >> ( tab + dsl::p + // SampleId tab + dsl::integer + // HapIndex tab + dsl::p + // SeqId tab + dsl::p + // SeqStart tab + dsl::p + // SeqEnd tab + dsl::p + // Walk - dsl::p; + dsl::p); static constexpr auto value = lexy::construct; }; @@ -241,7 +241,7 @@ struct record { dsl::p | comment | // Explicitly ignore all other records (though require proper tab-delimited format) - dsl::ascii::alpha >> tab + dsl::until(dsl::newline).or_eof() | + dsl::ascii::alpha >> (tab + dsl::until(dsl::newline).or_eof()) | dsl::error; }(); diff --git a/src/common/modules/genome_consistance_checker.cpp b/src/common/modules/genome_consistance_checker.cpp index dc5edb572..3189996e0 100644 --- a/src/common/modules/genome_consistance_checker.cpp +++ b/src/common/modules/genome_consistance_checker.cpp @@ -432,7 +432,7 @@ void GenomeConsistenceChecker::Fill() { } vector theoretic_lens; - for (const auto &prefix: vector{"0_", "1_"}) { + for (auto prefix: {"0_", "1_"}) { for (const auto &chr: genome.GetChromosomes()) { string label = prefix + chr.name; INFO("Spelling label " << label);