[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:
parent
aba804ef91
commit
51be2cf6d2
@ -720,7 +720,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|||||||
((?>/\*.*?\*/\s+))
|
((?>/\*.*?\*/\s+))
|
||||||
(static\s+)?
|
(static\s+)?
|
||||||
void\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}%, '')
|
comment = $1.sub(%r%Document-(?:class|module):\s+#{class_name}%, '')
|
||||||
elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
|
elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
|
||||||
(?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
|
(?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
|
||||||
|
@ -857,6 +857,23 @@ Init_Foo(void) {
|
|||||||
assert_equal "a comment for class Foo", klass.comment.text
|
assert_equal "a comment for class Foo", klass.comment.text
|
||||||
end
|
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
|
def test_find_class_comment_define_class
|
||||||
content = <<-EOF
|
content = <<-EOF
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user