anchor.diff:         if (indent === previous) {
            // skip indents of the same size as the present indent-size
            this.skip();
  -       }
  -       else if (indent > previous) {
  +       } else if (indent > previous) {
            this.indents.push(indent);
  -         this.emit(this.commonToken(Python3Parser.INDENT, spaces));
  -       }
  -       else {
  +         this.emitToken(this.commonToken(Python3Parser.INDENT, spaces));
  +       } else {
            // Possibly emit more than 1 DEDENT token.
  -         while(this.indents.length && this.indents[this.indents.length - 1] > indent) {
  -           this.emit(this.createDedent());
  +         while (this.indents.length && this.indents[this.indents.length - 1] > indent) {
  +           this.emitToken(this.createDedent());
              this.indents.pop();
            }
          }
  
positive.code: NEWLINE
   : ( {this.atStartOfInput()}?   SPACES
     | ( '\r'? '\n' | '\r' ) SPACES?
     )
     {
       let newLine = this.text.replace(/[^\r\n]+/g, '');
       let spaces = this.text.replace(/[\r\n]+/g, '');
       let next = this._input.LA(1);
  
       if (this.opened > 0 || next === '\r' || next === '\n' || next === '#') {
         // If we're inside a list or on a blank line, ignore all indents,
         // dedents and line breaks.
         this.skip();
       }
       else {
         this.emit(this.commonToken(Python3Lexer.NEWLINE, newLine));
  
         let indent = this.getIndentationCount(spaces);
         let previous = this.indents.length ? this.indents[this.indents.length - 1] : 0;
  
negative.code:    */
    Python3Lexer.prototype.nextToken = function() {
      // Check if the end-of-file is ahead and there are still some DEDENTS expected.
      if (this._input.LA(1) === Python3Parser.EOF && this.indents.length) {
  
        // Remove any trailing EOF tokens from our buffer.
        this.token_queue = this.token_queue.filter(function(val) {
          return val.type !== Python3Parser.EOF;
        });
  
        // First emit an extra line break that serves as the end of the statement.
        this.emitToken(this.commonToken(Python3Parser.NEWLINE, "\n"));
  
        // Now emit as much DEDENT tokens as needed.
        while (this.indents.length) {
          this.emitToken(this.createDedent());
          this.indents.pop();
        }
  
        // Put the EOF back on the token stream.
        this.emitToken(this.commonToken(Python3Parser.EOF, "<EOF>"));
      }
  
      let next = antlr4.Lexer.prototype.nextToken.call(this);
      return this.token_queue.length ? this.token_queue.shift() : next;
    };
  
    Python3Lexer.prototype.createDedent = function() {
      return this.commonToken(Python3Parser.DEDENT, "");
    }
  
    Python3Lexer.prototype.commonToken = function(type, text) {
  