final String name = pattern.substring(x + 1, x2);
if (!name.startsWith("-")) {
final ExprInfo vi = getExprInfo(name);
final DefaultExpression<?> expr = vi.classes[0].getDefaultExpression();
if (expr == null)
throw new SkriptAPIException("The class '" + vi.classes[0].getCodeName() + "' does not provide a default expression. Either allow null (with %-" + vi.classes[0].getCodeName() + "%) or make it mandatory [pattern: " + info.patterns[i] + "]");
if (!(expr instanceof Literal) && (vi.flagMask & PARSE_EXPRESSIONS) == 0)
throw new SkriptAPIException("The default expression of '" + vi.classes[0].getCodeName() + "' is not a literal. Either allow null (with %-*" + vi.classes[0].getCodeName() + "%) or make it mandatory [pattern: " + info.patterns[i] + "]");
if (expr instanceof Literal && (vi.flagMask & PARSE_LITERALS) == 0)
throw new SkriptAPIException("The default expression of '" + vi.classes[0].getCodeName() + "' is a literal. Either allow null (with %-~" + vi.classes[0].getCodeName() + "%) or make it mandatory [pattern: " + info.patterns[i] + "]");
if (!vi.isPlural[0] && !expr.isSingle())
throw new SkriptAPIException("The default expression of '" + vi.classes[0].getCodeName() + "' is not a single-element expression. Change your pattern to allow multiple elements or make the expression mandatory [pattern: " + info.patterns[i] + "]");
if (vi.time != 0 && !expr.setTime(vi.time))
throw new SkriptAPIException("The default expression of '" + vi.classes[0].getCodeName() + "' does not have distinct time states. [pattern: " + info.patterns[i] + "]");
if (!expr.init())
continue patternsLoop;
res.exprs[j] = expr;
}
}