1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/rdoc] Update generated files

This commit is contained in:
Nobuyoshi Nakada 2022-02-12 15:22:47 +09:00
parent 5348a34504
commit e95ad70079
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
3 changed files with 26 additions and 10 deletions

View file

@ -29,6 +29,7 @@ class RDoc::Markdown::Literals
@result = nil @result = nil
@failed_rule = nil @failed_rule = nil
@failing_rule_offset = -1 @failing_rule_offset = -1
@line_offsets = nil
setup_foreign_grammar setup_foreign_grammar
end end
@ -45,6 +46,20 @@ class RDoc::Markdown::Literals
target + 1 target + 1
end end
if [].respond_to? :bsearch_index
def current_line(target=pos)
unless @line_offsets
@line_offsets = []
total = 0
string.each_line do |line|
total += line.size
@line_offsets << total
end
end
@line_offsets.bsearch_index {|x| x >= target } + 1 || -1
end
else
def current_line(target=pos) def current_line(target=pos)
cur_offset = 0 cur_offset = 0
cur_line = 0 cur_line = 0
@ -57,6 +72,7 @@ class RDoc::Markdown::Literals
-1 -1
end end
end
def lines def lines
lines = [] lines = []

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# #
# DO NOT MODIFY!!!! # DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.5.2 # This file is automatically generated by Racc 1.6.0
# from Racc grammar file "". # from Racc grammar file "".
# #

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
# #
# DO NOT MODIFY!!!! # DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.5.2 # This file is automatically generated by Racc 1.6.0
# from Racc grammar file "". # from Racc grammar file "".
# #