/**
* Consume characters until a literal character is complete.
*/
private char unescapeCharacterLiteral() throws CompileException, IOException {
if (this.nextChar == -1) throw new CompileException("EOF in character literal", this.location());
if (this.nextChar == '\r' || this.nextChar == '\n') {
throw new CompileException("Line break in literal not allowed", this.location());
}
if (this.nextChar != '\\') {
char res = (char) this.nextChar;
this.readNextChar();
return res;
}
this.readNextChar();
int idx = "btnfr".indexOf(this.nextChar);
if (idx != -1) {
char res = "\b\t\n\f\r".charAt(idx);
this.readNextChar();
return res;
}
idx = "01234567".indexOf(this.nextChar);
if (idx != -1) {
int code = idx;
this.readNextChar();
idx = "01234567".indexOf(this.nextChar);
if (idx == -1) return (char) code;
code = 8 * code + idx;
this.readNextChar();
idx = "01234567".indexOf(this.nextChar);
if (idx == -1) return (char) code;
code = 8 * code + idx;
if (code > 255) throw new CompileException("Invalid octal escape", this.location());
this.readNextChar();
return (char) code;
}
char res = (char) this.nextChar;