lib/xml-stream.js
function getFinalState(selector) {
  if (__own.call(this._finalStates, selector.normalized)) {
    var finalState = this._finalStates[selector.normalized];
  } else {
    var n = selector.parts.length;
    var immediate = false;
    this._startState[this._lastState] = true;
    for (var i = 0; i < n; i++) {
      var part = selector.parts[i];
      if (part === '>') {
        immediate = true;
      } else {
        if (!immediate) {
          this._fa.transition(this._lastState, '', this._lastState);
        }
        this._fa.transition(this._lastState, part, ++this._lastState);
        immediate = false;
      }
    }
    var finalState = this._lastState++;
    this._finalStates[selector.normalized] = finalState;
  }
  return finalState;
}
function getFinalState(selector) {
  if (__own.call(this._finalStates, selector.normalized)) {
    var finalState = this._finalStates[selector.normalized];
  } else {
    var n = selector.parts.length;
    var immediate = false;
    this._startState[this._lastState] = true;
    for (var i = 0; i < n; i++) {
      var part = selector.parts[i];
      if (part === '>') {
        immediate = true;
      } else {
        if (!immediate) {
          this._fa.transition(this._lastState, '', this._lastState);
        }
        this._fa.transition(this._lastState, part, ++this._lastState);
        immediate = false;
      }
    }
    var finalState = this._lastState++;
    this._finalStates[selector.normalized] = finalState;
  }
  return finalState;
}
function getFinalState ( selector ) { if ( __own . call ( this . _finalStates , selector . normalized ) ) { var finalState = this . _finalStates [ selector . normalized ] ; } else { var n = selector . parts . length ; var immediate = false ; this . _startState [ this . _lastState ] = true ; for ( var i = 0 ; i < n ; i ++ ) { var part = selector . parts [ i ] ; if ( part === '>' ) { immediate = true ; } else { if ( ! immediate ) { this . _fa . transition ( this . _lastState , '' , this . _lastState ) ; } this . _fa . transition ( this . _lastState , part , ++ this . _lastState ) ; immediate = false ; } } var finalState = this . _lastState ++ ; this . _finalStates [ selector . normalized ] = finalState ; } return finalState ; }
Compiles a given selector object to a finite automata and returns its last state.
Compiles a given selector object to a finite automata and returns its last state .