docs: private void parseTemplateVariables() throws MiniTemplator.TemplateSyntaxException {
          int p = 0;
          while (true) {
              p = templateText.indexOf("${", p);
              if (p == -1) {
                  break;
              }
              int p0 = p;
              p = templateText.indexOf("}", p);
              if (p == -1) {
                  throw new MiniTemplator.TemplateSyntaxException(
                          "Invalid variable reference in template at offset " + p0 + ".");
              }
              p++;
              String varName = templateText.substring(p0 + 2, p - 1).trim();
              if (varName.length() == 0) {
                  throw new MiniTemplator.TemplateSyntaxException(
                          "Empty variable name in template at offset " + p0 + ".");
              }
              registerVariableReference(varName, p0, p);
          }
      }