diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-12-16 23:49:00 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-12-16 14:55:39 +0000 |
commit | a46fe5c807361f07604eaba447f0487076977e7e (patch) | |
tree | 3a31538efeaf663ea944091a64d86027936f6962 /lib/rdoc | |
parent | 4428c51f01638c1ce6ba8a9eb8ffea00a4c78318 (diff) |
[ruby/rdoc] Fix to parse `rb_define_global_const`
https://github.com/ruby/ruby/pull/12357
https://github.com/ruby/rdoc/commit/458ecbb7f7
Diffstat (limited to 'lib/rdoc')
-rw-r--r-- | lib/rdoc/parser/c.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rdoc/parser/c.rb b/lib/rdoc/parser/c.rb index 8a1bf821ce..7e83a6151f 100644 --- a/lib/rdoc/parser/c.rb +++ b/lib/rdoc/parser/c.rb @@ -405,6 +405,7 @@ class RDoc::Parser::C < RDoc::Parser \s*(.*?)\s*\)\s*; %xm) do |type, var_name, const_name, definition| var_name = "rb_cObject" if !var_name or var_name == "rb_mKernel" + type = "const" if type == "global_const" handle_constants type, var_name, const_name, definition end @@ -760,6 +761,10 @@ class RDoc::Parser::C < RDoc::Parser rb_define_(?<type>\w+)\(\s*(?:\w+),\s* "(?<name>\w+)"\s*, .*?\)\s*; + | (?<doc>(?>^\s*/\*.*?\*/\s+)) + rb_define_global_(?<type>const)\(\s* + "(?<name>\w+)"\s*, + .*?\)\s*; | (?<doc>(?>^\s*/\*.*?\*/\s+)) rb_file_(?<type>const)\(\s* "(?<name>\w+)"\s*, |