1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/lib/rdoc/markup
Yusuke Endoh 0a0760aa63 Refactor and improve performance of RDoc::Markup::Parser
This change introduces a wrapper of StringScanner that is aware of the
current position (column and lineno).
It has two advantages: faster and more modular.

The old code frequently runs `@input.byteslice(0, byte_offset).length`
to get the current position, but it was painfully slow.  This change
keeps track of the position at each scan, which reduces about half of
time of "Generating RI format into ..." in Ruby's `make rdoc`
(5.5 sec -> 3.0 sec).

And the old code used four instance variables (`@input`, `@line`,
`@line_pos`, and `@s`) to track the position.  This change factors them
out into MyStringScanner, so now only one variable (`@s`) is needed.
2019-08-16 06:02:45 +09:00
..
attr_changer.rb
attr_span.rb
attribute_manager.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
attributes.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
blank_line.rb
block_quote.rb
document.rb
formatter.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
formatter_test_case.rb
hard_break.rb
heading.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
include.rb
indented_paragraph.rb
list.rb
list_item.rb
paragraph.rb
parser.rb Refactor and improve performance of RDoc::Markup::Parser 2019-08-16 06:02:45 +09:00
pre_process.rb
raw.rb
regexp_handling.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
rule.rb
text_formatter_test_case.rb
to_ansi.rb
to_bs.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
to_html.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
to_html_crossref.rb Fix links to headings 2019-07-14 17:46:16 +09:00
to_html_snippet.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
to_joined_paragraph.rb
to_label.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
to_markdown.rb lib/rdoc/markup/: Remove wrong call to =~ against Array 2018-11-26 05:32:50 +00:00
to_rdoc.rb lib/rdoc/markup/: Remove wrong call to =~ against Array 2018-11-26 05:32:50 +00:00
to_table_of_contents.rb
to_test.rb
to_tt_only.rb Merge rdoc-6.1.0.beta2 2018-10-17 06:28:20 +00:00
verbatim.rb