Convert hex digit to value.
| 1433 | |
| 1434 | // Convert hex digit to value. |
| 1435 | static int UnHex(int c) { |
| 1436 | if ('0' <= c && c <= '9') |
| 1437 | return c - '0'; |
| 1438 | if ('A' <= c && c <= 'F') |
| 1439 | return c - 'A' + 10; |
| 1440 | if ('a' <= c && c <= 'f') |
| 1441 | return c - 'a' + 10; |
| 1442 | LOG(DFATAL) << "Bad hex digit " << c; |
| 1443 | return 0; |
| 1444 | } |
| 1445 | |
| 1446 | // Parse an escape sequence (e.g., \n, \{). |
| 1447 | // Sets *s to span the remainder of the string. |