peach.js
/*
          1. Process if statement -- if true, replace entire string with contents
          2. If statement is false, remove it and a possible 'else' and reprocess
        */
1. Process if statement -- if true, replace entire string with contents
2. If statement is false, remove it and a possible 'else' and reprocess
1 . Process if statement -- if true replace entire string with contents 2 . If statement is false remove it and a possible ' else ' and reprocess
function doIf () {
          var _if        = getIf(string);
          var _ifmatch   = string.match(_if);
          var _else      = peach.getNest('^{}',string);
          var _elsematch = string.match(_else);
          if (_if) {
            if (ifmatch(_ifmatch[1])) {
              string = _ifmatch[2];
            } else {
              string = string.replace(new RegExp(_if),'');
              doIf();
            }
          } else if (_else) {
            string = _elsematch[1];
          } else {
            string = "";
          }
        }
function doIf ( ) { var _if = getIf ( string ) ; var _ifmatch = string . match ( _if ) ; var _else = peach . getNest ( '^{}' , string ) ; var _elsematch = string . match ( _else ) ; if ( _if ) { if ( ifmatch ( _ifmatch [ 1 ] ) ) { string = _ifmatch [ 2 ] ; } else { string = string . replace ( new RegExp ( _if ) , '' ) ; doIf ( ) ; } } else if ( _else ) { string = _elsematch [ 1 ] ; } else { string = "" ; } }
1.
1 .