MCPcopy Create free account
hub / github.com/Genivia/ugrep / gethex

Function gethex

lib/pattern.cpp:148–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147#ifndef WITH_NO_CODEGEN
148static uint8_t gethex(const char *& ptr)
149{
150 int hi = *ptr++ - '0';
151 hi -= (hi > 9) * ('a' - '9' - 1);
152 int lo = *ptr++ - '0';
153 lo -= (lo > 9) * ('a' - '9' - 1);
154 int byte = (hi << 4) + lo;
155 if (hi < 0 || lo < 0 || byte > 255)
156 throw regex_error::load_tables;
157 return static_cast<uint8_t>(byte);
158}
159#endif
160
161const std::string Pattern::operator[](Accept choice) const

Callers 1

initMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected