getu4 decodes \uXXXX from the beginning of s, returning the hex value, or it returns -1.
(s []byte)
| 241 | // getu4 decodes \uXXXX from the beginning of s, returning the hex value, |
| 242 | // or it returns -1. |
| 243 | func getu4(s []byte) rune { |
| 244 | if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { |
| 245 | return -1 |
| 246 | } |
| 247 | r, err := strconv.ParseUint(string(s[2:6]), 16, 64) |
| 248 | if err != nil { |
| 249 | return -1 |
| 250 | } |
| 251 | return rune(r) |
| 252 | } |
| 253 | |
| 254 | // TODO(pquerna): consider combining wibth the normal byte mask. |
| 255 | var lt [256]bool = [256]bool{ |
no outgoing calls
no test coverage detected
searching dependent graphs…