src/parser/parser.js
function (expressionClose, expressionOpen, s) {
      var sInner = ''
      var closeTag = null
      var openTag = null
      var findIndex = 0

      do {
        if (closeTag) {
          findIndex += closeTag[0].length
        }
        closeTag = this.findTag(expressionClose, s)
        if (!closeTag) {
          throw new Error('Unclosed ' + this.ldelim + expressionOpen + this.rdelim)
        }
        sInner += s.slice(0, closeTag.index)
        findIndex += closeTag.index
        s = s.slice((closeTag.index + closeTag[0].length))
        openTag = this.findTag(expressionOpen, sInner)
        if (openTag) {
          sInner = sInner.slice((openTag.index + openTag[0].length))
        }
      } while (openTag)

      closeTag.index = findIndex
      return closeTag
    }
function (expressionClose, expressionOpen, s) {
      var sInner = ''
      var closeTag = null
      var openTag = null
      var findIndex = 0

      do {
        if (closeTag) {
          findIndex += closeTag[0].length
        }
        closeTag = this.findTag(expressionClose, s)
        if (!closeTag) {
          throw new Error('Unclosed ' + this.ldelim + expressionOpen + this.rdelim)
        }
        sInner += s.slice(0, closeTag.index)
        findIndex += closeTag.index
        s = s.slice((closeTag.index + closeTag[0].length))
        openTag = this.findTag(expressionOpen, sInner)
        if (openTag) {
          sInner = sInner.slice((openTag.index + openTag[0].length))
        }
      } while (openTag)

      closeTag.index = findIndex
      return closeTag
    }
function ( expressionClose , expressionOpen , s ) { var sInner = '' var closeTag = null var openTag = null var findIndex = 0 do { if ( closeTag ) { findIndex += closeTag [ 0 ] . length } closeTag = this . findTag ( expressionClose , s ) if ( ! closeTag ) { throw new Error ( 'Unclosed ' + this . ldelim + expressionOpen + this . rdelim ) } sInner += s . slice ( 0 , closeTag . index ) findIndex += closeTag . index s = s . slice ( ( closeTag . index + closeTag [ 0 ] . length ) ) openTag = this . findTag ( expressionOpen , sInner ) if ( openTag ) { sInner = sInner . slice ( ( openTag . index + openTag [ 0 ] . length ) ) } } while ( openTag ) closeTag . index = findIndex return closeTag }
Find closing tag which matches. expressionClose.
Find closing tag which matches . expressionClose .