Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace the :continue option with a #continue_lex method #1151

Merged
merged 3 commits into from
Jun 3, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
properly deprecate the options hash for Formatter#lex
  • Loading branch information
http://jneen.net/ committed Jun 3, 2019
commit 4de367d1b8ff400ad535c7ec2e423f1e60a8e688
6 changes: 5 additions & 1 deletion lib/rouge/lexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,11 @@ def reset!

# Given a string, yield [token, chunk] pairs. If no block is given,
# an enumerator is returned.
def lex(string, &b)
def lex(string, opts=nil, &b)
if opts
warn 'the :continue option to Formatter#lex is deprecated, use #continue_lex instead.'
end

return enum_for(:lex, string) unless block_given?

Lexer.assert_utf8!(string)
Expand Down