MCPcopy Create free account
hub / github.com/ashvardanian/less_slow.cpp / config_parse_ctre

Function config_parse_ctre

less_slow.cpp:4615–4625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4613#endif
4614
4615void config_parse_ctre(std::string_view config_text, std::vector<std::pair<std::string, std::string>> &settings) {
4616 // ! CTRE isn't currently handling the `$` anchor correctly.
4617 // ! The current workaround is to add `?` to the last whitespace group.
4618 // ! https://github.com/hanickadot/compile-time-regular-expressions/issues/334#issuecomment-2571614075
4619 constexpr auto regex_fsm = regex_for_config_ctre();
4620 for (auto match : regex_fsm(config_text)) {
4621 std::string_view key = match.get<1>().to_view();
4622 std::string_view value = match.get<2>().to_view();
4623 settings.emplace_back(key, value);
4624 }
4625}
4626
4627void parse_ctre(bm::State &state, std::string_view config_text) {
4628 std::size_t pairs = 0, bytes = 0;

Callers 1

parse_ctreFunction · 0.85

Calls 1

regex_for_config_ctreFunction · 0.85

Tested by

no test coverage detected