code: private void groovySection(Reader reader, StringWriter sw) throws IOException {
          sw.write("\"\"\");");
          int c;
          while ((c = reader.read()) != -1) {
              if (c == '%') {
                  c = reader.read();
                  if (c != '>') {
                      sw.write('%');
                  } else {
                      break;
                  }
              }
              /* Don't eat EOL chars in sections - as they are valid instruction separators.
               * See http://jira.codehaus.org/browse/GROOVY-980
               */
              // if (c != '\n' && c != '\r') {
              sw.write(c);
              //}
          }
          sw.write(";\n"+printCommand()+"(\"\"\"");
      }
docs: Closes the currently open write and writes the following text as normal Groovy script code until it reaches an end %>.
  
  @param reader a reader for the template text
  @param sw     a StringWriter to write expression content
  @throws IOException if something goes wrong