docs: private String expandRHS(final String lhs,
                               int lineOffset) {
          final StringBuilder buf = new StringBuilder();
          final String[] lines = lhs.split((lhs.indexOf("\r\n") >= 0 ? "\r\n":"\n"),
                                            -1 ); // since we assembled the string, we know line breaks are \n
  
          final String[] expanded = new String[lines.length]; // buffer for expanded lines
          int lastExpanded = -1;
          int lastPattern = -1;
          for ( int i = 0; i < lines.length - 1; i++ ) {
              final String trimmed = lines[i].trim();
              expanded[++lastExpanded] = lines[i];
  
              if ( trimmed.length() == 0 || trimmed.startsWith( "#" ) || trimmed.startsWith( "//" ) ) { // comments
                  buf.append( lines[i] );
              } else if ( trimmed.startsWith( ">" ) ) {
                  // passthrough code
                  expanded[lastExpanded] = lines[i].replaceFirst( ">",
                                                                  " " );
              } else { // regular expansions
                  expanded[lastExpanded] =
                          substitute( expanded[lastExpanded],
                                      this.consequence,
                                      i + lineOffset,
                                      useThen,
                                      showSteps );
  
                  // do we need to report errors for that?
                  if ( lines[i].equals( expanded[lastExpanded] ) ) {
                      // report error
                      this.addError( new ExpanderException( "Unable to expand: " + lines[i],
                                                            i + lineOffset ) );
                  }
  
                  // If the original starts with a "-", it means we need to add it
                  // as a modify term to the previous pattern
                  if ( trimmed.startsWith( "-" ) && (!lines[i].equals( expanded[lastExpanded] )) ) {
                      int lastMatchStart = -1;
                      int lastMatchEnd = -1;
                      String modifiers = "";
                      if ( lastPattern >= 0 ) {
                          final Matcher m2 = modifyFinder.matcher( expanded[lastPattern] );
                          while ( m2.find() ) {
                              lastMatchStart = m2.start();
                              lastMatchEnd = m2.end();
                              modifiers = m2.group( 1 ).trim();
                          }
                      }
                      if ( lastMatchStart > -1 ) {
                          // rebuilding previous modify structure
                          expanded[lastPattern] = expanded[lastPattern].substring( 0,
                                                                                   lastMatchStart )
                                                  + "{ " + modifiers +
                                                  ((modifiers.length() == 0) ? "" : ", ") +
                                                  expanded[lastExpanded].trim() + " }" +
                                                  expanded[lastPattern].substring( lastMatchEnd );
                      } else {
                          // error, pattern not found to add constraint to
                          this.addError( new ExpanderException( "No modify was found to add the modifier to: " + lines[i].trim(),
                                                                i + lineOffset ) );
                      }
                      lastExpanded--;
                  } else {
                      lastPattern = lastExpanded;
                  }
              }
          }
  
          for ( int i = 0; i <= lastExpanded; i++ ) {
              buf.append( expanded[i] );
              buf.append( nl );
          }
  
          if ( lines.length == 0 ) {
              buf.append( nl );
          }
          return buf.toString();
      }