aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-12-05 13:22:27 +0900
committergit <svn-admin@ruby-lang.org>2023-12-05 08:48:19 +0000
commit113f5d7fd79f2b7dd72a2f748dee475ad793a743 (patch)
tree810ca75a947e718270fdc09109f5ffae788bb952 /lib
parentc0baa3783f1f43072128cb90339a2d00e03dde1c (diff)
downloadruby-113f5d7fd79f2b7dd72a2f748dee475ad793a743.tar.gz
[ruby/rdoc] Allow any single-word token upto 2 before C method implementation
Previously only unknown word `intern` is allowed between a single-word token before a C method. Now any single-word token, such as `inline` which is used for `ArithmeticSequence` in enumerator.c, is allowed instead. https://github.com/ruby/rdoc/commit/3a214c1dd1
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/parser/c.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb
index 57d802266b..d4480d0bdd 100644
--- a/lib/rdoc/parser/c.rb
+++ b/lib/rdoc/parser/c.rb
@@ -575,9 +575,8 @@ class RDoc::Parser::C < RDoc::Parser
table = {}
file_content.scan(%r{
((?>/\*.*?\*/\s*)?)
- ((?:(?:\w+)\s+)?
- (?:intern\s+)?VALUE\s+(\w+)
- \s*(?:\([^)]*\))(?:[^\);]|$))
+ ((?:\w+\s+){0,2} VALUE\s+(\w+)
+ \s*(?:\([^\)]*\))(?:[^\);]|$))
| ((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+(\w+)\s+(\w+))
| ^\s*\#\s*define\s+(\w+)\s+(\w+)
}xm) do