Skip to content

Commit 1877775

Browse files
committed
Fix greediness of function argument matching so prototypes are no longer discovered incorrectly.
1 parent c5d048d commit 1877775

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

History.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
r30829 by Usaku Nakamura.
1313
* Completing via Array#[ in `ri -i` no longer crashes. Ruby Bug #3167
1414
* Completing IO::o in `ri -i` now returns results. Ruby Bug #3167
15+
* RDoc::Parser::C ignores prototypes better. Pull Request #34 by Pete
16+
Higgins.
1517

1618
=== 3.5.3 / 2010-02-06
1719

lib/rdoc/parser/c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def find_body class_name, meth_name, meth_obj, file_content, quiet = false
376376
when %r%((?>/\*.*?\*/\s*)?)
377377
((?:(?:static|SWIGINTERN)\s+)?
378378
(?:intern\s+)?VALUE\s+#{meth_name}
379-
\s*(\(.*?\))([^;]|$))%xm then
379+
\s*(\([^)]*\))([^;]|$))%xm then
380380
comment = $1
381381
body = $2
382382
offset = $~.offset(2).first

test/test_rdoc_parser_c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ def test_define_method_with_prototype
933933
content = <<-EOF
934934
static VALUE rb_io_s_read(int, VALUE*, VALUE);
935935
936-
/*Method Comment! */
936+
/* Method Comment! */
937937
static VALUE
938938
rb_io_s_read(argc, argv, io)
939939
int argc;

0 commit comments

Comments
 (0)