joycss/lib/csslib/cssReader.js
function ruleEnd(e){

    var selectors ;

    if (e.old === 'ruleStart'){
      selectors = this.get('selectors');
      //delete the last selector
      selectors.pop();
      var lines = this.get('lines');
      lines.pop();

      this.attributes.nest.pop();

      return;
    } else if (e.old === 'valueStart') {
      this._addValue(e);
    }

    ruleEnd.recode = ruleEnd.recode || 0;
    ruleEnd.recode++;
    this.attributes.nest.pop();

    if (!this.attributes.nest.length){
      var num = this.getLen() - ruleEnd.recode;
      ruleEnd.recode = 0;
      var idList = this.get('idList');
      idList.push(num);
      this.fire(this.get('RULE_END_EVT'), this.getRule(num));
    }
  }
function ruleEnd(e){

    var selectors ;

    if (e.old === 'ruleStart'){
      selectors = this.get('selectors');
      //delete the last selector
      selectors.pop();
      var lines = this.get('lines');
      lines.pop();

      this.attributes.nest.pop();

      return;
    } else if (e.old === 'valueStart') {
      this._addValue(e);
    }

    ruleEnd.recode = ruleEnd.recode || 0;
    ruleEnd.recode++;
    this.attributes.nest.pop();

    if (!this.attributes.nest.length){
      var num = this.getLen() - ruleEnd.recode;
      ruleEnd.recode = 0;
      var idList = this.get('idList');
      idList.push(num);
      this.fire(this.get('RULE_END_EVT'), this.getRule(num));
    }
  }
function ruleEnd ( e ) { var selectors ; if ( e . old === 'ruleStart' ) { selectors = this . get ( 'selectors' ) ; //delete the last selector selectors . pop ( ) ; var lines = this . get ( 'lines' ) ; lines . pop ( ) ; this . attributes . nest . pop ( ) ; return ; } else if ( e . old === 'valueStart' ) { this . _addValue ( e ) ; } ruleEnd . recode = ruleEnd . recode || 0 ; ruleEnd . recode ++ ; this . attributes . nest . pop ( ) ; if ( ! this . attributes . nest . length ) { var num = this . getLen ( ) - ruleEnd . recode ; ruleEnd . recode = 0 ; var idList = this . get ( 'idList' ) ; idList . push ( num ) ; this . fire ( this . get ( 'RULE_END_EVT' ) , this . getRule ( num ) ) ; } }
1. fix the problem when have some empty rule such as
@example .foo {}
remove the selector in the collections of selector
2. fix when the last value don't end with the semicolon
@example .foo { color: red }
1 . fix the problem when have some empty rule such as