ruby-changes:67100
From: aycabta <ko1@a...>
Date: Tue, 10 Aug 2021 02:39:01 +0900 (JST)
Subject: [ruby-changes:67100] 44635ebe9a (master): Update parser files of RDoc generated by the latest KPeg
https://git.ruby-lang.org/ruby.git/commit/?id=44635ebe9a From 44635ebe9a39fbe1fdaf0b65d00f9c89bee43489 Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> Date: Tue, 10 Aug 2021 02:35:33 +0900 Subject: Update parser files of RDoc generated by the latest KPeg --- lib/rdoc/markdown.rb | 79 +++++++++++++++++++++---------------------- lib/rdoc/markdown/literals.rb | 15 ++++---- 2 files changed, 46 insertions(+), 48 deletions(-) diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb index 15beaef..3442f76 100644 --- a/lib/rdoc/markdown.rb +++ b/lib/rdoc/markdown.rb @@ -344,9 +344,8 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L344 end def scan(reg) - if m = reg.match(@string[@pos..-1]) - width = m.end(0) - @pos += width + if m = reg.match(@string, @pos) + @pos = m.end(0) return true end @@ -1060,7 +1059,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L1059 self.pos = _save3 break end - _tmp = scan(/\A(?-mix:#*)/) + _tmp = scan(/\G(?-mix:#*)/) unless _tmp self.pos = _save3 break @@ -1100,7 +1099,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L1099 _save = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:\#{1,6})/) + _tmp = scan(/\G(?-mix:\#{1,6})/) if _tmp text = get_text(_text_start) end @@ -1165,7 +1164,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L1164 self.pos = _save3 break end - _tmp = scan(/\A(?-mix:#*)/) + _tmp = scan(/\G(?-mix:#*)/) unless _tmp self.pos = _save3 break @@ -1225,7 +1224,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L1224 _save = self.pos while true # sequence - _tmp = scan(/\A(?-mix:={1,})/) + _tmp = scan(/\G(?-mix:={1,})/) unless _tmp self.pos = _save break @@ -1246,7 +1245,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L1245 _save = self.pos while true # sequence - _tmp = scan(/\A(?-mix:-{1,})/) + _tmp = scan(/\G(?-mix:-{1,})/) unless _tmp self.pos = _save break @@ -2130,7 +2129,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L2129 self.pos = _save break end - _tmp = scan(/\A(?-mix:[+*-])/) + _tmp = scan(/\G(?-mix:[+*-])/) unless _tmp self.pos = _save break @@ -9385,7 +9384,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9384 self.pos = _save7 break end - _tmp = scan(/\A(?-mix:[^`\n]*$)/) + _tmp = scan(/\G(?-mix:[^`\n]*$)/) unless _tmp self.pos = _save7 end @@ -9476,7 +9475,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9475 self.pos = _save15 break end - _tmp = scan(/\A(?-mix:[^`\n]*$)/) + _tmp = scan(/\G(?-mix:[^`\n]*$)/) unless _tmp self.pos = _save15 end @@ -9725,7 +9724,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9724 _save3 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save3 break @@ -9755,7 +9754,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9754 _save6 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save6 break @@ -9818,7 +9817,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9817 break end _text_start = self.pos - _tmp = scan(/\A(?-mix:[:\\`|*_{}\[\]()#+.!><-])/) + _tmp = scan(/\G(?-mix:[:\\`|*_{}\[\]()#+.!><-])/) if _tmp text = get_text(_text_start) end @@ -9944,7 +9943,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L9943 self.pos = _save5 break end - _tmp = scan(/\A(?-mix:={1,}|-{1,})/) + _tmp = scan(/\G(?-mix:={1,}|-{1,})/) unless _tmp self.pos = _save5 break @@ -10096,7 +10095,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L10095 _save1 = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:\*{4,})/) + _tmp = scan(/\G(?-mix:\*{4,})/) if _tmp text = get_text(_text_start) end @@ -10126,7 +10125,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L10125 self.pos = _save3 break end - _tmp = scan(/\A(?-mix:\*+)/) + _tmp = scan(/\G(?-mix:\*+)/) unless _tmp self.pos = _save3 break @@ -10173,7 +10172,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L10172 _save1 = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:_{4,})/) + _tmp = scan(/\G(?-mix:_{4,})/) if _tmp text = get_text(_text_start) end @@ -10203,7 +10202,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L10202 self.pos = _save3 break end - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save3 break @@ -11564,7 +11563,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L11563 _save1 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:[A-Za-z]+)/) + _tmp = scan(/\G(?-mix:[A-Za-z]+)/) unless _tmp self.pos = _save1 break @@ -11689,7 +11688,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L11688 _save2 = self.pos while true # sequence - _tmp = scan(/\A(?i-mx:[\w+.\/!%~$-]+)/) + _tmp = scan(/\G(?i-mx:[\w+.\/!%~$-]+)/) unless _tmp self.pos = _save2 break @@ -12553,7 +12552,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L12552 self.pos = _save10 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save10 end @@ -12690,7 +12689,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L12689 self.pos = _save24 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save24 end @@ -12867,7 +12866,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L12866 self.pos = _save40 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save40 end @@ -13004,7 +13003,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13003 self.pos = _save54 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save54 end @@ -13181,7 +13180,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13180 self.pos = _save70 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save70 end @@ -13318,7 +13317,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13317 self.pos = _save84 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save84 end @@ -13495,7 +13494,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13494 self.pos = _save100 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save100 end @@ -13632,7 +13631,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13631 self.pos = _save114 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save114 end @@ -13809,7 +13808,7 @@ class RDoc::Markdown https://github.com/ruby/ruby/blob/trunk/lib/rdoc/markdown.rb#L13808 self.pos = _save130 break end - (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/