code: function Lexer(source) {
    var lines = source;
  
    if (typeof lines === "string") {
      lines = lines
        .replace(/\r\n/g, "\n")
        .replace(/\r/g, "\n")
        .split("\n");
    }
  
    // If the first line is a shebang (#!), make it a blank and move on.
    // Shebangs are used by Node scripts.
  
    if (lines[0] && lines[0].substr(0, 2) === "#!") {
      if (lines[0].indexOf("node") !== -1) {
        state.option.node = true;
      }
      lines[0] = "";
    }
  
    this.emitter = new events.EventEmitter();
    this.source = source;
    this.setLines(lines);
    this.prereg = true;
  
    this.line = 0;
    this.char = 1;
    this.from = 1;
    this.input = "";
    this.inComment = false;
  
    for (var i = 0; i < state.option.indent; i += 1) {
      state.tab += " ";
    }
  }
docs: /*
  Lexer for JSHint.
  
  This object does a char-by-char scan of the provided source code
  and produces a sequence of tokens.
  
  var lex = new Lexer("var i = 0;");
  lex.start();
  lex.token(); // returns the next token
  
  You have to use the token() method to move the lexer forward
  but you don't have to use its return value to get tokens. In addition
  to token() method returning the next token, the Lexer object also
  emits events.
  
  lex.on("Identifier", function (data) {
  if (data.name.indexOf("_") >= 0) {
  // Produce a warning.
  }
  });
  
  Note that the token() method returns tokens in a JSLint-compatible
  format while the event emitter uses a slightly modified version of
  Mozilla's JavaScript Parser API. Eventually, we will move away from
  JSLint format.