packages/pug-parser/index.js
function(type){
    if (this.peek().type === type) {
      return this.advance();
    } else {
      this.error('INVALID_TOKEN', 'expected "' + type + '", but got "' + this.peek().type + '"', this.peek());
    }
  }
function(type){
    if (this.peek().type === type) {
      return this.advance();
    } else {
      this.error('INVALID_TOKEN', 'expected "' + type + '", but got "' + this.peek().type + '"', this.peek());
    }
  }
function ( type ) { if ( this . peek ( ) . type === type ) { return this . advance ( ) ; } else { this . error ( 'INVALID_TOKEN' , 'expected "' + type + '", but got "' + this . peek ( ) . type + '"' , this . peek ( ) ) ; } }
Expect the given type, or throw an exception.

@param {String} type
@api private
Expect the given type or throw an exception .