docs: function initLexerFor(codestr, filenameOrLexer, options) {
  
    options = options || {};
    var lexer;
    var filename;
    if(filenameOrLexer instanceof lex.Lexer) {
       lexer = filenameOrLexer;
       filename = lexer.filename;
    }
    else {
      filename = filenameOrLexer;
    }
  
    // we've had trouble preserving comments -
    // for now, default to leaving them out:
    if (typeof options.includeComments === 'undefined') {
      options.includeComments = false;
    }
  
    if(!lexer) {
      // create a Lexer object per file that holds state
      // e.g. the current position when reading the file
      lexer = new lex.Lexer(codestr, filename, options);
    }
    else {
      // change the source text being lexed
      // (yet retaining already #used dialects the Lexer already has)
      lexer.set_source_text(codestr, options);
    }
  
    // All the modules can access the Lexer for the main source file
    // via the transpiler context...
    // note:  this is fairly simplistic right now - it's assuming
    //  just one source file of any importance (as opposed to
    //  transpiling multiple source files with multiple Lexers all
    //  at the same time).  So it's fine for now but might change...
  // DELETE? if(!ctx.lexer) {
      ctx.lexer = lexer;
  //  }
  
    var fileext = utils.getFileExt(filename, "slisp");
  
    // filetypes defines the dialect's this dialect builds upon:
    var baseDialectNames = options.baseDialectNames || filetypes[fileext];
    if(!baseDialectNames) {
      throw new Error(filename + " is not a recognized sugarlisp file type.");
    }
  
    // options.autouse=false can be used to disable the base dialects
    // (but this is not typical)
    if(typeof options.autouse === 'undefined' || options.autouse) {
      // then add the others
      for (var i=baseDialectNames.length; i--; ) {
        var dialectName = baseDialectNames[i];
        // we skip core here because we *always* include core (see below)
  //DELETE      if(dialectName !== 'core') {
  //DELETE prepend #use statements just as if they'd done it themselves
  //DELETE codestr = '#use "' + dialectName +  '"\n' + codestr;
          // bootstrap the core dialect which everything must have
          use_dialect(dialectName, lexer);
  //      }
      }
    }
  
    // bootstrap the core dialect which everything must have
  //  use_dialect('core', lexer);
  
    return lexer;
  }