code: public int getKeyWord(char[] array, int currentIndex, StringBuffer velocityBlock, VelocityParserContext context)
          throws InvalidVelocityException
      {
          int i = currentIndex;
  
          if (i + 1 >= array.length) {
              throw new InvalidVelocityException();
          }
  
          if (array[i + 1] == '#') {
              // A simple line comment
              i = getSimpleComment(array, currentIndex, velocityBlock, context);
          } else if (array[i + 1] == '*') {
              // A multi lines comment
              i = getMultilinesComment(array, currentIndex, velocityBlock, context);
          } else if (array[i + 1] == '{' || Character.isLetter(array[i + 1])) {
              // A directive
              i = getDirective(array, currentIndex, velocityBlock, context);
          } else {
              throw new InvalidVelocityException();
          }
  
          return i;
      }
docs: Get any valid Velocity block starting with a sharp character (#if, #somemaccro(), ##comment etc.).
  
  @param array the source to parse
  @param currentIndex the current index in the <code>array</code>
  @param velocityBlock the buffer where to append matched velocity block
  @param context the parser context to put some informations
  @return the index in the <code>array</code> after the matched block
  @throws InvalidVelocityException not a valid velocity block