diff options
author | aycabta <[email protected]> | 2021-08-10 02:35:33 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2021-08-10 02:36:00 +0900 |
commit | 44635ebe9a39fbe1fdaf0b65d00f9c89bee43489 (patch) | |
tree | 41b04f0a4dec974ab4e7b2d936d3436b0731bc9d /lib/rdoc/markdown | |
parent | 6b439e9c4e361c2b0763af950beeb7d908ddbab8 (diff) |
Update parser files of RDoc generated by the latest KPeg
Diffstat (limited to 'lib/rdoc/markdown')
-rw-r--r-- | lib/rdoc/markdown/literals.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/rdoc/markdown/literals.rb b/lib/rdoc/markdown/literals.rb index 31cd237f12..943c2d268a 100644 --- a/lib/rdoc/markdown/literals.rb +++ b/lib/rdoc/markdown/literals.rb @@ -174,9 +174,8 @@ class RDoc::Markdown::Literals 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 @@ -366,14 +365,14 @@ class RDoc::Markdown::Literals # Alphanumeric = /\p{Word}/ def _Alphanumeric - _tmp = scan(/\A(?-mix:\p{Word})/) + _tmp = scan(/\G(?-mix:\p{Word})/) set_failed_rule :_Alphanumeric unless _tmp return _tmp end # AlphanumericAscii = /[A-Za-z0-9]/ def _AlphanumericAscii - _tmp = scan(/\A(?-mix:[A-Za-z0-9])/) + _tmp = scan(/\G(?-mix:[A-Za-z0-9])/) set_failed_rule :_AlphanumericAscii unless _tmp return _tmp end @@ -387,21 +386,21 @@ class RDoc::Markdown::Literals # Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/ def _Newline - _tmp = scan(/\A(?-mix:\n|\r\n?|\p{Zl}|\p{Zp})/) + _tmp = scan(/\G(?-mix:\n|\r\n?|\p{Zl}|\p{Zp})/) set_failed_rule :_Newline unless _tmp return _tmp end # NonAlphanumeric = /\p{^Word}/ def _NonAlphanumeric - _tmp = scan(/\A(?-mix:\p{^Word})/) + _tmp = scan(/\G(?-mix:\p{^Word})/) set_failed_rule :_NonAlphanumeric unless _tmp return _tmp end # Spacechar = /\t|\p{Zs}/ def _Spacechar - _tmp = scan(/\A(?-mix:\t|\p{Zs})/) + _tmp = scan(/\G(?-mix:\t|\p{Zs})/) set_failed_rule :_Spacechar unless _tmp return _tmp end |