| 109 | } |
| 110 | |
| 111 | const uint8_t* FindEndOfIdentifier(const uint8_t* start, const uint8_t* end) { |
| 112 | if (start == end) return nullptr; |
| 113 | uint8_t ch = *start++; |
| 114 | if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || |
| 115 | (ch >= '0' && ch <= '9') || ch == '_')) { |
| 116 | return nullptr; |
| 117 | } |
| 118 | while (start != end) { |
| 119 | ch = *start; |
| 120 | if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || |
| 121 | (ch >= '0' && ch <= '9') || ch == '_')) { |
| 122 | return start; |
| 123 | } |
| 124 | ++start; |
| 125 | } |
| 126 | return end; |
| 127 | } |
| 128 | |
| 129 | int FindUtf8PosForward(const uint8_t* ptr, const int len, int index) { |
| 130 | DCHECK_GE(index, 0); |