int (int start, int i) { do { i++; } while (i < myBufferEnd && myBuffer.charAt(i) == 'u'); int end = parseUnicodeDigits(i); if (end != i + 4) return end; int code = Integer.parseInt(myBuffer.subSequence(i, end).toString(), 16); i = end; // if escape sequence is not translated to backspace then continue from the next symbol if (code != '\\' || i >= myBufferEnd) return i; char c = myBuffer.charAt(i); if (StringUtil.isOctalDigit(c)) { if (i + 2 < myBufferEnd && StringUtil.isOctalDigit(myBuffer.charAt(i + 1)) && StringUtil.isOctalDigit(myBuffer.charAt(i + 1))) { return i + 3; } } else if (c == '\\' && i + 1 < myBufferEnd && myBuffer.charAt(i + 1) == 'u') { i += 2; while (i < myBufferEnd && myBuffer.charAt(i) == 'u') i++; return parseUnicodeDigits(i); } return i + 1; }