switch (status) {
case EXPR_BEGIN: {
if (from < to) {
char c = s.charAt(from);
if (c == '}') {
throw new SyntaxException(CODE_MISSING_EXPR_IDENT, "Missing expression identifier at " + from, Location.at(1 + from));
} else {
status = EXPR_IDENT;
break;
}
} else {
throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
}
}
case EXPR_IDENT: {
if (from < to) {
char c = s.charAt(from);
if (c == '}') {
handler.exprIdent(s, pos, from);
return ++from;
} else {
++from;
break;
}
} else {
throw new SyntaxException(CODE_UNCLOSED_EXPR, "Unclosed expression at " + from, Location.at(1 + from));
}
}
default:
throw new UnsupportedOperationException("todo");
}