if ((i0 < 0 || i2 < i0) && (i8 < 0 || i2 < i8)) { // found end of string
addStringComponent(components, avt, last, i2);
last = i2;
break;
} else if (i0 >= 0 && i0 != i1 && i8 < i0) { // found a "{" with no matching "}"
StaticError err = new StaticError(
"Unmatched opening curly brace in attribute value template \"" + avt.substring(0,i2) + "\"");
err.setErrorCode("XT0350");
throw err;
} else if (i8 >= 0 && (i0 < 0 || i8 < i0)) { // found a "}"
if (i8 != i9) { // a "}" that isn't a "}}"
StaticError err = new StaticError(
"Closing curly brace in attribute value template \"" + avt.substring(0,i2) + "\" must be doubled");
err.setErrorCode("XT0360");
throw err;
}
addStringComponent(components, avt, last, i8 + 1);
last = i8 + 2;
} else if (i1 >= 0 && i1 == i0) { // found a doubled "{{"