{"record":{"id":"38d3cb2f850d976d","repo":"rouge-ruby/rouge","slug":"improper-use-of-lexer-lex-this-method-does-not-r","errorCode":null,"errorMessage":"Improper use of Lexer#lex - this method does not receive options. This will become an error in a future version.","messagePattern":"Improper use of Lexer#lex - this method does not receive options\\. This will become an error in a future version\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/rouge/lexer.rb","lineNumber":518,"sourceCode":"    def reset!\n    end\n\n    # Given a string, yield [token, chunk] pairs.  If no block is given,\n    # an enumerator is returned.\n    #\n    # @option opts :continue\n    #   Continue the lex from the previous state (i.e. don't call #reset!)\n    #\n    # @note The use of :continue => true has been deprecated. A warning is\n    #       issued if run with `$VERBOSE` set to true.\n    #\n    # @note The use of arbitrary `opts` has never been supported, but we\n    #       previously ignored them with no error. We now warn unconditionally.\n    def lex(string, opts=nil, &b)\n      if opts\n        if (opts.keys - [:continue]).size > 0\n          # improper use of options hash\n          warn('Improper use of Lexer#lex - this method does not receive options.' +\n               ' This will become an error in a future version.')\n        end\n\n        if opts[:continue]\n          warn '`lex :continue => true` is deprecated, please use #continue_lex instead'\n          return continue_lex(string, &b)\n        end\n      end\n\n      return enum_for(:lex, string) unless block_given?\n\n      Lexer.assert_utf8!(string)\n      reset!\n\n      continue_lex(string, &b)\n    end\n\n    # Continue the lex from the the current state without resetting","sourceCodeStart":500,"sourceCodeEnd":536,"githubUrl":"https://github.com/rouge-ruby/rouge/blob/bd7dad7b0939c556e582a0370686f6fc022c8af5/lib/rouge/lexer.rb#L500-L536","documentation":"Error \"Improper use of Lexer#lex - this method does not receive options. This will become an error in a future version.\" thrown in rouge-ruby/rouge.","triggerScenarios":"Thrown at lib/rouge/lexer.rb:518 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bd7dad7b0939c556e582a0370686f6fc022c8af5","analyzedAt":"2026-08-23T11:34:50.713Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}