| 146 | |
| 147 | #ifndef WITH_NO_CODEGEN |
| 148 | static 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 | |
| 161 | const std::string Pattern::operator[](Accept choice) const |