зеркало из https://github.com/github/ruby.git
[ruby/rdoc] Parse also InitVM-prefixed functions
Initialization depending on VM is separated. https://github.com/ruby/rdoc/commit/030d10fccd
This commit is contained in:
Родитель
aba804ef91
Коммит
51be2cf6d2
|
@ -720,7 +720,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|||
((?>/\*.*?\*/\s+))
|
||||
(static\s+)?
|
||||
void\s+
|
||||
Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)%xmi then
|
||||
Init(?:VM)?_(?i:#{class_name})\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)%xm then
|
||||
comment = $1.sub(%r%Document-(?:class|module):\s+#{class_name}%, '')
|
||||
elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
|
||||
(?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
|
||||
|
|
|
@ -857,6 +857,23 @@ Init_Foo(void) {
|
|||
assert_equal "a comment for class Foo", klass.comment.text
|
||||
end
|
||||
|
||||
|
||||
def test_find_class_comment_initvm
|
||||
content = <<-EOF
|
||||
/*
|
||||
* a comment for class Foo
|
||||
*/
|
||||
void
|
||||
InitVM_Foo(void) {
|
||||
VALUE foo = rb_define_class("Foo", rb_cObject);
|
||||
}
|
||||
EOF
|
||||
|
||||
klass = util_get_class content, 'foo'
|
||||
|
||||
assert_equal "a comment for class Foo", klass.comment.text
|
||||
end
|
||||
|
||||
def test_find_class_comment_define_class
|
||||
content = <<-EOF
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче